Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The members of an interface declaration or class should appear in a pre-defined order #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,38 @@ public class FrameLayoutWithHole extends FrameLayout {
private Overlay mOverlay;

private ArrayList<AnimatorSet> mAnimatorSetArrayList;
private boolean mCleanUpLock = false;

public FrameLayoutWithHole(Activity context, View view) {
this(context, view, TourGuide.MotionType.AllowAll);
}

public FrameLayoutWithHole(Activity context, View view, TourGuide.MotionType motionType) {
this(context, view, motionType, new Overlay());
}

public FrameLayoutWithHole(Activity context, View view, TourGuide.MotionType motionType, Overlay overlay) {
super(context);
mActivity = context;
mViewHole = view;
init(null, 0);
enforceMotionType();
mOverlay = overlay;

int [] pos = new int[2];
mViewHole.getLocationOnScreen(pos);
mPos = pos;

mDensity = context.getResources().getDisplayMetrics().density;
int padding = (int)(20 * mDensity);

if (mViewHole.getHeight() > mViewHole.getWidth()) {
mRadius = mViewHole.getHeight()/2 + padding;
} else {
mRadius = mViewHole.getWidth()/2 + padding;
}
mMotionType = motionType;
}

public void setViewHole(View viewHole) {
this.mViewHole = viewHole;
Expand Down Expand Up @@ -72,35 +104,6 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
}
}

public FrameLayoutWithHole(Activity context, View view) {
this(context, view, TourGuide.MotionType.AllowAll);
}
public FrameLayoutWithHole(Activity context, View view, TourGuide.MotionType motionType) {
this(context, view, motionType, new Overlay());
}

public FrameLayoutWithHole(Activity context, View view, TourGuide.MotionType motionType, Overlay overlay) {
super(context);
mActivity = context;
mViewHole = view;
init(null, 0);
enforceMotionType();
mOverlay = overlay;

int [] pos = new int[2];
mViewHole.getLocationOnScreen(pos);
mPos = pos;

mDensity = context.getResources().getDisplayMetrics().density;
int padding = (int)(20 * mDensity);

if (mViewHole.getHeight() > mViewHole.getWidth()) {
mRadius = mViewHole.getHeight()/2 + padding;
} else {
mRadius = mViewHole.getWidth()/2 + padding;
}
mMotionType = motionType;
}
private void init(AttributeSet attrs, int defStyle) {
// Load attributes
// final TypedArray a = getContext().obtainStyledAttributes(
Expand Down Expand Up @@ -137,7 +140,6 @@ private void init(AttributeSet attrs, int defStyle) {

}

private boolean mCleanUpLock = false;
protected void cleanUp(){
if (getParent() != null) {
if (mOverlay!=null && mOverlay.mExitAnimation!=null) {
Expand Down
10 changes: 5 additions & 5 deletions tourguide/src/main/java/tourguide/tourguide/TourGuide.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ public enum MotionType {
*
*************/

/* Static builder */
public static TourGuide init(Activity activity){
return new TourGuide(activity);
}

/* Constructor */
public TourGuide(Activity activity){
mActivity = activity;
}

/* Static builder */
public static TourGuide init(Activity activity){
return new TourGuide(activity);
}

/**
* Setter for the animation to be used
* @param technique Animation to be used
Expand Down