Java Code Examples for android.widget.FrameLayout#getRight()

The following examples show how to use android.widget.FrameLayout#getRight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NeighborsFragment.java    From android-wallet-app with GNU General Public License v3.0 6 votes vote down vote up
private void showRevealEditText(FrameLayout view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        int cx = view.getRight() - 30;
        int cy = view.getBottom() - 60;
        int finalRadius = Math.max(view.getWidth(), view.getHeight());

        Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);
        view.setVisibility(View.VISIBLE);
        isEditTextVisible = true;
        anim.start();
    } else {
        view.setVisibility(View.VISIBLE);
        isEditTextVisible = true;
    }

}
 
Example 2
Source File: NeighborsFragment.java    From android-wallet-app with GNU General Public License v3.0 6 votes vote down vote up
private void hideReavelEditText(final FrameLayout view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        int cx = view.getRight() - 30;
        int cy = view.getBottom() - 60;
        int initialRadius = view.getWidth();

        Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, initialRadius, 0);
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                view.setVisibility(View.INVISIBLE);
            }
        });
        isEditTextVisible = false;
        anim.start();
    } else {
        view.setVisibility(View.INVISIBLE);
        isEditTextVisible = false;
    }
}
 
Example 3
Source File: SearchBox.java    From NHentai-android with GNU General Public License v3.0 4 votes vote down vote up
/***
 * Hide the searchbox using the circle animation. Can be called regardless of result list length
 * @param activity Activity
 */
public void hideCircularly(Activity activity){
	Display display = activity.getWindowManager().getDefaultDisplay();
	Point size = new Point();
	final FrameLayout layout = (FrameLayout) activity.getWindow().getDecorView()
			.findViewById(android.R.id.content);
	RelativeLayout root = (RelativeLayout) findViewById(R.id.search_root);
	display.getSize(size);
	Resources r = getResources();
	float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 96,
			r.getDisplayMetrics());
	int cx = layout.getLeft() + layout.getRight();
	int cy = layout.getTop();
	int finalRadius = (int) Math.max(layout.getWidth()*1.5, px);

	SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
			root, cx, cy, 0, finalRadius);
	animator.setInterpolator(new ReverseInterpolator());
	animator.setDuration(250);
	animator.start();
	animator.addListener(new SupportAnimator.AnimatorListener(){

		@Override
		public void onAnimationStart() {
			
		}

		@Override
		public void onAnimationEnd() {
			setVisibility(View.GONE);
		}

		@Override
		public void onAnimationCancel() {
			
		}

		@Override
		public void onAnimationRepeat() {
			
		}
		
	});
}
 
Example 4
Source File: SearchBox.java    From NHentai-android with GNU General Public License v3.0 4 votes vote down vote up
private void revealFrom(float x, float y, Activity a, SearchBox s) {
	FrameLayout layout = (FrameLayout) a.getWindow().getDecorView()
			.findViewById(android.R.id.content);
	RelativeLayout root = (RelativeLayout) s.findViewById(R.id.search_root);
	Resources r = getResources();
	float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 96,
			r.getDisplayMetrics());
	int cx = layout.getLeft() + layout.getRight();
	int cy = layout.getTop();

	int finalRadius = (int) Math.max(layout.getWidth(), px);

	SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
			root, cx, cy, 0, finalRadius);
	animator.setInterpolator(new AccelerateDecelerateInterpolator());
	animator.setDuration(500);
	animator.addListener(new SupportAnimator.AnimatorListener(){

		@Override
		public void onAnimationCancel() {
			
		}

		@Override
		public void onAnimationEnd() {
			toggleSearch();				
		}

		@Override
		public void onAnimationRepeat() {
			
		}

		@Override
		public void onAnimationStart() {
			
		}
		
	});
	animator.start();
}
 
Example 5
Source File: SearchBox.java    From ExpressHelper with GNU General Public License v3.0 4 votes vote down vote up
/***
 * Hide the searchbox using the circle animation. Can be called regardless of result list length
 * @param activity
 */
public void hideCircularly(Activity activity){
	Display display = activity.getWindowManager().getDefaultDisplay();
	Point size = new Point();
	final FrameLayout layout = (FrameLayout) activity.getWindow().getDecorView()
			.findViewById(android.R.id.content);
	RelativeLayout root = (RelativeLayout) findViewById(R.id.search_root);
	display.getSize(size);
	Resources r = getResources();
	float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 96,
			r.getDisplayMetrics());
	int cx = layout.getLeft() + layout.getRight();
	int cy = layout.getTop();
	int finalRadius = (int) Math.max(layout.getWidth()*1.5, px);

	SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
			root, cx, cy, 0, finalRadius);
	animator.setInterpolator(new ReverseInterpolator());
	animator.setDuration(500);
	animator.start();
	animator.addListener(new SupportAnimator.AnimatorListener(){

		@Override
		public void onAnimationStart() {
			
		}

		@Override
		public void onAnimationEnd() {
			setVisibility(View.GONE);
		}

		@Override
		public void onAnimationCancel() {
			
		}

		@Override
		public void onAnimationRepeat() {
			
		}
		
	});
}
 
Example 6
Source File: SearchBox.java    From ExpressHelper with GNU General Public License v3.0 4 votes vote down vote up
private void revealFrom(float x, float y, Activity a, SearchBox s) {
	Display display = a.getWindowManager().getDefaultDisplay();
	Point size = new Point();
	FrameLayout layout = (FrameLayout) a.getWindow().getDecorView()
			.findViewById(android.R.id.content);
	RelativeLayout root = (RelativeLayout) s.findViewById(R.id.search_root);
	display.getSize(size);
	Resources r = getResources();
	float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 96,
			r.getDisplayMetrics());
	int cx = layout.getLeft() + layout.getRight();
	int cy = layout.getTop();

	int finalRadius = (int) Math.max(layout.getWidth(), px);

	SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
			root, cx, cy, 0, finalRadius);
	animator.setInterpolator(new AccelerateDecelerateInterpolator());
	animator.setDuration(500);
	animator.addListener(new SupportAnimator.AnimatorListener(){

		@Override
		public void onAnimationCancel() {
			
		}

		@Override
		public void onAnimationEnd() {
			toggleSearch();				
		}

		@Override
		public void onAnimationRepeat() {
			
		}

		@Override
		public void onAnimationStart() {
			
		}
		
	});
	animator.start();
}