List of usage examples for android.widget LinearLayout getLeft
@ViewDebug.CapturedViewProperty public final int getLeft()
From source file:shetye.prathamesh.notifyme.Utilities.java
public void showView(LinearLayout lview) { // get the center for the clipping circle int cx = (lview.getLeft() + lview.getRight()) / 2; int cy = (lview.getTop() + lview.getBottom()) / 2; // get the final radius for the clipping circle int finalRadius = Math.max(lview.getWidth(), lview.getHeight()); // create the animator for this view (the start radius is zero) Animator anim = ViewAnimationUtils.createCircularReveal(lview, cx, cy, 0, finalRadius); // make the view visible and start the animation lview.setVisibility(View.VISIBLE); anim.start();//from w ww . j ava2 s .co m }
From source file:shetye.prathamesh.notifyme.Utilities.java
public void hideView(final LinearLayout lview) { // get the center for the clipping circle int cx = (lview.getLeft() + lview.getRight()) / 2; int cy = (lview.getTop() + lview.getBottom()) / 2; // get the initial radius for the clipping circle int initialRadius = lview.getWidth(); // create the animation (the final radius is zero) Animator anim = ViewAnimationUtils.createCircularReveal(lview, cx, cy, initialRadius, 0); // make the view invisible when the animation is done anim.addListener(new AnimatorListenerAdapter() { @Override//from www. j av a 2 s .c om public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); lview.setVisibility(View.INVISIBLE); } }); anim.start(); }
From source file:com.mobicage.rogerthat.plugins.friends.ServiceSearchActivity.java
private void displayTab(int tab) { final int childCount = mSearchCategoryViewFlipper.getChildCount(); if (childCount == 0) { return;// w w w. j ava 2 s. c o m } while (tab < 0) tab += childCount; tab = tab % childCount; mSearchCategoryViewFlipper.setDisplayedChild(tab); for (int i = 0; i < childCount; i++) { SearchInfo si = mSearchInfoByListView.get(mSearchCategoryViewFlipper.getChildAt(i)); if (si == null) { L.bug("Could not find list view!"); return; } final boolean selected = tab == i; final LinearLayout v = si.label; setCatorySelected(v, selected); if (selected) { final HorizontalScrollView sv = (HorizontalScrollView) findViewById( R.id.search_category_scroll_container); sv.post(new SafeRunnable() { @Override public void safeRun() { int vLeft = v.getLeft(); int vRight = v.getRight(); int width = v.getWidth(); sv.smoothScrollTo(((vLeft + vRight) / 2) - (width), 0); } }); } } }