Java Code Examples for com.nineoldandroids.view.ViewHelper.setScaleX()

The following are Jave code examples for showing how to use setScaleX() of the com.nineoldandroids.view.ViewHelper class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: HutHelper   File: DragLayout.java   View Source Code Vote up 6 votes
private void animateView(float percent) {
    float f1 = 1 - percent * 0.3f;
    ViewHelper.setScaleX(vg_main, f1);   //主布局逐渐变大
    ViewHelper.setScaleY(vg_main, f1);
    ViewHelper.setTranslationX(vg_left, -vg_left.getWidth() / 2.3f
            + vg_left.getWidth() / 2.3f * percent);
    ViewHelper.setScaleX(vg_left, 0.5f + 0.5f * percent);//左边的布局逐渐变小
    ViewHelper.setScaleY(vg_left, 0.5f + 0.5f * percent);
    ViewHelper.setAlpha(vg_left, percent);
    if (isShowShadow) {
        ViewHelper.setScaleX(iv_shadow, f1 * 1.4f * (1 - percent * 0.12f));
        ViewHelper.setScaleY(iv_shadow, f1 * 1.85f * (1 - percent * 0.12f));
    }
    getBackground().setColorFilter(
            evaluate(percent, Color.BLACK, Color.TRANSPARENT),
            Mode.SRC_OVER);
}
 
Example 2
Project: JewelryUI   File: JazzyViewPager.java   View Source Code Vote up 6 votes
protected void animateStack(View left, View right, float positionOffset, int positionOffsetPixels) {		
	if (mState != State.IDLE) {
		if (right != null) {
			manageLayer(right, true);
			mScale = (1-SCALE_MAX) * positionOffset + SCALE_MAX;
			mTrans = -getWidth()-getPageMargin()+positionOffsetPixels;
			ViewHelper.setScaleX(right, mScale);
			ViewHelper.setScaleY(right, mScale);
			ViewHelper.setTranslationX(right, mTrans);
		}
		if (left != null) {
			left.bringToFront();
		}
	}
}
 
Example 3
Project: JazzyViewPager   File: JazzyViewPager.java   View Source Code Vote up 6 votes
private void animateAccordion(View left, View right, float positionOffset) {
	if (mState != State.IDLE) {
		if (left != null) {
			manageLayer(left, true);
			ViewHelper.setPivotX(left, left.getMeasuredWidth());
			ViewHelper.setPivotY(left, 0);
			ViewHelper.setScaleX(left, 1-positionOffset);
		}
		if (right != null) {
			manageLayer(right, true);
			ViewHelper.setPivotX(right, 0);
			ViewHelper.setPivotY(right, 0);
			ViewHelper.setScaleX(right, positionOffset);
		}
	}
}
 
Example 4
Project: GongXianSheng   File: BaseViewAnimator.java   View Source Code Vote up 5 votes
/**
 * reset the view to default status
 *
 * @param target
 */
public void reset(View target) {
	ViewHelper.setAlpha(target, 1);
	ViewHelper.setScaleX(target, 1);
	ViewHelper.setScaleY(target, 1);
	ViewHelper.setTranslationX(target, 0);
	ViewHelper.setTranslationY(target, 0);
	ViewHelper.setRotation(target, 0);
	ViewHelper.setRotationY(target, 0);
	ViewHelper.setRotationX(target, 0);
	ViewHelper.setPivotX(target, target.getMeasuredWidth() / 2.0f);
	ViewHelper.setPivotY(target, target.getMeasuredHeight() / 2.0f);
}
 
Example 5
Project: MyAnimeViewer   File: BaseItemAnimator.java   View Source Code Vote up 5 votes
public static void clear(View v) {
    ViewHelper.setAlpha(v, 1);
    ViewHelper.setScaleY(v, 1);
    ViewHelper.setScaleX(v, 1);
    ViewHelper.setTranslationY(v, 0);
    ViewHelper.setTranslationX(v, 0);
    ViewHelper.setRotation(v, 0);
    ViewHelper.setRotationY(v, 0);
    ViewHelper.setRotationX(v, 0);
    // @TODO https://code.google.com/p/android/issues/detail?id=80863
    //        ViewHelper.setPivotY(v, v.getMeasuredHeight() / 2);
    v.setPivotY(v.getMeasuredHeight() / 2);
    ViewHelper.setPivotX(v, v.getMeasuredWidth() / 2);
    ViewPropertyAnimator.animate(v).setInterpolator(null);
}
 
Example 6
Project: PhotoPicker-master   File: ImagePagerFragment.java   View Source Code Vote up 5 votes
/**
 * The enter animation scales the picture in from its previous thumbnail
 * size/location, colorizing it in parallel. In parallel, the background of the
 * activity is fading in. When the pictue is in place, the text description
 * drops down.
 */
private void runEnterAnimation() {
  final long duration = ANIM_DURATION;

  // Set starting values for properties we're going to animate. These
  // values scale and position the full size version down to the thumbnail
  // size/location, from which we'll animate it back up
  ViewHelper.setPivotX(mViewPager, 0);
  ViewHelper.setPivotY(mViewPager, 0);
  ViewHelper.setScaleX(mViewPager, (float) thumbnailWidth / mViewPager.getWidth());
  ViewHelper.setScaleY(mViewPager, (float) thumbnailHeight / mViewPager.getHeight());
  ViewHelper.setTranslationX(mViewPager, thumbnailLeft);
  ViewHelper.setTranslationY(mViewPager, thumbnailTop);

  // Animate scale and translation to go from thumbnail to full size
  ViewPropertyAnimator.animate(mViewPager)
      .setDuration(duration)
      .scaleX(1)
      .scaleY(1)
      .translationX(0)
      .translationY(0)
      .setInterpolator(new DecelerateInterpolator());

  // Fade in the black background
  ObjectAnimator bgAnim = ObjectAnimator.ofInt(mViewPager.getBackground(), "alpha", 0, 255);
  bgAnim.setDuration(duration);
  bgAnim.start();

  // Animate a color filter to take the image from grayscale to full color.
  // This happens in parallel with the image scaling and moving into place.
  ObjectAnimator colorizer = ObjectAnimator.ofFloat(ImagePagerFragment.this,
      "saturation", 0, 1);
  colorizer.setDuration(duration);
  colorizer.start();

}
 
Example 7
Project: Hotspot-master-devp   File: PagerSlidingTabStrip.java   View Source Code Vote up 5 votes
@Override
public void onPageSelected(int position) {
    selectedPosition = position;
    //set old view statue
    ViewHelper.setAlpha(tabViews.get(oldPosition).get("normal"), 1);
    ViewHelper.setAlpha(tabViews.get(oldPosition).get("selected"), 0);
    if(oldPosition<tabsContainer.getChildCount()) {
        View v_old = tabsContainer.getChildAt(oldPosition);
        ViewHelper.setPivotX(v_old, v_old.getMeasuredWidth() * 0.5f);
        ViewHelper.setPivotY(v_old, v_old.getMeasuredHeight() * 0.5f);
        ViewHelper.setScaleX(v_old, 1f);
        ViewHelper.setScaleY(v_old, 1f);
    }

    //set new view statue
    ViewHelper.setAlpha(tabViews.get(position).get("normal"), 0);
    ViewHelper.setAlpha(tabViews.get(position).get("selected"), 1);

    if(position<tabsContainer.getChildCount()) {
        View v_new = tabsContainer.getChildAt(position);
        ViewHelper.setPivotX(v_new, v_new.getMeasuredWidth() * 0.5f);
        ViewHelper.setPivotY(v_new, v_new.getMeasuredHeight() * 0.5f);
        ViewHelper.setScaleX(v_new, 1 + zoomMax);
        ViewHelper.setScaleY(v_new, 1 + zoomMax);
    }

    if (delegatePageListener != null) {
        delegatePageListener.onPageSelected(position);
    }
    oldPosition = selectedPosition;
}
 
Example 8
Project: CustomWeight   File: MainActivity.java   View Source Code Vote up 5 votes
private void initView() {
    QuickIndexBar quickIndexBar = (QuickIndexBar) findViewById(R.id.quick_index_bar);
    listView = (ListView) findViewById(R.id.list_view);
    tvCurrentWord = (TextView) findViewById(R.id.tv_current_word);

    prepareData(); // 虚拟数据
    Collections.sort(friends); // 排序
    listView.setAdapter(new FriendAdapter(this, friends));

    quickIndexBar.setOnTouchLetterListener(new QuickIndexBar.OnTouchLetterListener() {
        @Override
        public void onTouchLetter(String letter) {
            //根据当前触摸的字母,去集合中找那个 item 的首字母和 letter 一样,然后将对应的item放到屏幕顶端
            for (int i = 0; i < friends.size(); i++) {
                String firstWord = friends.get(i).getPinYin().charAt(0) + "";
                if (letter.equals(firstWord)) {
                    // 说明找到了,那么应该讲当前的 item 放到屏幕顶端
                    listView.setSelection(i);
                    break;
                }
            }
            // 显示当前触摸的字母
            showCurrentWord(letter);
        }
    });

    // 通过缩小 tvCurrentWord 来隐藏
    ViewHelper.setScaleX(tvCurrentWord, 0f);
    ViewHelper.setScaleY(tvCurrentWord, 0f);
}
 
Example 9
Project: Sega   File: BackgroundToForegroundTransformer.java   View Source Code Vote up 5 votes
@Override
protected void onTransform(View view, float position) {
	final float height = view.getHeight();
	final float width = view.getWidth();
	final float scale = min(position < 0 ? 1f : Math.abs(1f - position), 0.5f);

       ViewHelper.setScaleX(view,scale);
       ViewHelper.setScaleY(view,scale);
       ViewHelper.setPivotX(view,width*0.5f);
       ViewHelper.setPivotY(view,height*0.5f);
       ViewHelper.setTranslationX(view,position < 0 ? width * position : -width * position * 0.25f);
}
 
Example 10
Project: Widgets   File: SlideLayout.java   View Source Code Vote up 5 votes
/**
     * 伴随动画
     *
     * @return 当前滑动的比例
     */
    private float animViews() {
        float percent = mSlideDx * 1.0f / mSlideRang;

        // 左面板: 缩放动画, 平移动画, 透明度动画
//        ViewHelper.setScaleX(mLeftView, 0.4f + 0.4f * percent);
//        ViewHelper.setScaleY(mLeftView, 0.4f + 0.4f * percent);
        ViewHelper.setScaleX(mLeftView, evaluate(percent, 0.4f, 1.0f));
        ViewHelper.setScaleY(mLeftView, evaluate(percent, 0.4f, 1.0f));
        // 平移动画: -mWidth / 2.0f -> 0.0f
        ViewHelper.setTranslationX(mLeftView, evaluate(percent, -mWidth / 2.0f, 0));
        // 透明度: 0.4 -> 1.0f
        ViewHelper.setAlpha(mLeftView, evaluate(percent, 0.4f, 1.0f));

        // 主面板: 缩放动画  1.0f -> 0.8f
        ViewHelper.setScaleX(mMainView, evaluate(percent, 1.0f, 0.8f));
        ViewHelper.setScaleY(mMainView, evaluate(percent, 1.0f, 0.8f));

        // 透明度: 1.0 -> 0.6f
        if (mMainAlphaEnable) {
            ViewHelper.setAlpha(mMainView, evaluate(percent, 1.0f, 0.6f));
        }

        // 整个控件的背景动画: 亮度变化 (颜色变化)
        if (null != getBackground()) {
            getBackground().setColorFilter((Integer) evaluateColor(percent, mAlphaColor, Color.TRANSPARENT), PorterDuff.Mode.SRC_OVER);
        }

        return percent;
    }
 
Example 11
Project: Sega   File: DepthPageTransformer.java   View Source Code Vote up 5 votes
@Override
protected void onTransform(View view, float position) {
	if (position <= 0f) {
           ViewHelper.setTranslationX(view,0f);
           ViewHelper.setScaleX(view,1f);
           ViewHelper.setScaleY(view,1f);
	} else if (position <= 1f) {
		final float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position));
           ViewHelper.setAlpha(view,1-position);
           ViewHelper.setPivotY(view,0.5f * view.getHeight());
           ViewHelper.setTranslationX(view,view.getWidth() * - position);
           ViewHelper.setScaleX(view,scaleFactor);
           ViewHelper.setScaleY(view,scaleFactor);
	}
}
 
Example 12
Project: Sega   File: ZoomOutTransformer.java   View Source Code Vote up 5 votes
@Override
protected void onTransform(View view, float position) {
    final float scale = 1f + Math.abs(position);
    ViewHelper.setScaleX(view,scale);
    ViewHelper.setScaleY(view,scale);
    ViewHelper.setPivotX(view,view.getWidth() * 0.5f);
    ViewHelper.setPivotY(view,view.getWidth() * 0.5f);
    ViewHelper.setAlpha(view,position < -1f || position > 1f ? 0f : 1f - (scale - 1f));
    if(position < -0.9){
        //-0.9 to prevent a small bug
        ViewHelper.setTranslationX(view,view.getWidth() * position);
    }
}
 
Example 13
Project: Sega   File: ZoomInTransformer.java   View Source Code Vote up 5 votes
@Override
protected void onTransform(View view, float position) {
	final float scale = position < 0 ? position + 1f : Math.abs(1f - position);
	ViewHelper.setScaleX(view,scale);
       ViewHelper.setScaleY(view,scale);
       ViewHelper.setPivotX(view,view.getWidth() * 0.5f);
       ViewHelper.setPivotY(view,view.getHeight() * 0.5f);
       ViewHelper.setAlpha(view,position < -1f || position > 1f ? 0f : 1f - (scale - 1f));
}
 
Example 14
Project: Sega   File: ZoomOutSlideTransformer.java   View Source Code Vote up 5 votes
@Override
protected void onTransform(View view, float position) {
	if (position >= -1 || position <= 1) {
		// Modify the default slide transition to shrink the page as well
		final float height = view.getHeight();
		final float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs(position));
		final float vertMargin = height * (1 - scaleFactor) / 2;
		final float horzMargin = view.getWidth() * (1 - scaleFactor) / 2;

           // Center vertically
           ViewHelper.setPivotY(view,0.5f * height);


		if (position < 0) {
               ViewHelper.setTranslationX(view,horzMargin - vertMargin / 2);
		} else {
               ViewHelper.setTranslationX(view,-horzMargin + vertMargin / 2);
		}

		// Scale the page down (between MIN_SCALE and 1)
		ViewHelper.setScaleX(view,scaleFactor);
           ViewHelper.setScaleY(view,scaleFactor);

		// Fade the page relative to its size.
           ViewHelper.setAlpha(view,MIN_ALPHA + (scaleFactor - MIN_SCALE) / (1 - MIN_SCALE) * (1 - MIN_ALPHA));
	}
}
 
Example 15
Project: GitHub   File: OneAdapter.java   View Source Code Vote up 4 votes
@Override
        public void onBindViewHolder(final SubjectsBean positionData, final int position) {
            if (positionData != null) {
                binding.setSubjectsBean(positionData);
                // 图片
//                ImgLoadUtil.displayEspImage(positionData.getImages().getLarge(), binding.ivOnePhoto,0);
                // 导演
//                binding.tvOneDirectors.setText(StringFormatUtil.formatName(positionData.getDirectors()));
                // 主演
//                binding.tvOneCasts.setText(StringFormatUtil.formatName(positionData.getCasts()));
                // 类型
//                binding.tvOneGenres.setText("类型:" + StringFormatUtil.formatGenres(positionData.getGenres()));
                // 评分
//                binding.tvOneRatingRate.setText("评分:" + String.valueOf(positionData.getRating().getAverage()));
                // 分割线颜色
                binding.viewColor.setBackgroundColor(CommonUtils.randomColor());

                ViewHelper.setScaleX(itemView,0.8f);
                ViewHelper.setScaleY(itemView,0.8f);
                ViewPropertyAnimator.animate(itemView).scaleX(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();
                ViewPropertyAnimator.animate(itemView).scaleY(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();

                binding.llOneItem.setOnClickListener(new PerfectClickListener() {
                    @Override
                    protected void onNoDoubleClick(View v) {

                        OneMovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);

//                        if (position % 2 == 0) {

//                            SlideScrollViewActivity.start(activity, positionData, binding.ivOnePhoto);

//                            MovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);
//                            OneMovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);

//                            TestActivity.start(activity, positionData, binding.ivOnePhoto);
//                            activity.overridePendingTransition(R.anim.push_fade_out, R.anim.push_fade_in);
//                        } else {
//                            SlideScrollViewActivity.start(activity, positionData, binding.ivOnePhoto);
//                            SlideShadeViewActivity.start(activity, positionData, binding.ivOnePhoto);
//                            OneMovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);
//                        }

                        // 这个可以
//                        SlideScrollViewActivity.start(activity, positionData, binding.ivOnePhoto);
//                        TestActivity.start(activity,positionData,binding.ivOnePhoto);
//                        v.getContext().startActivity(new Intent(v.getContext(), SlideScrollViewActivity.class));

//                        SlideShadeViewActivity.start(activity, positionData, binding.ivOnePhoto);

                    }
                });
            }
        }
 
Example 16
Project: Hotspot-master-devp   File: PagerSlidingTabStrip.java   View Source Code Vote up 4 votes
private void updateTabStyles() {
    for (int i = 0; i < tabCount; i++) {
        FrameLayout frameLayout = (FrameLayout) tabsContainer.getChildAt(i);
        frameLayout.setBackgroundResource(tabBackgroundResId);

        for (int j = 0; j < frameLayout.getChildCount(); j++) {
            View v = frameLayout.getChildAt(j);
            if (v instanceof TextView) {
                TextView tab = (TextView) v;
                tab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize);
                tab.setTypeface(tabTypeface, tabTypefaceStyle);
                tab.setPadding(tabPadding, 0, tabPadding, 0);
                if (j == 0) {
                    tab.setTextColor(tabTextColor);
                } else {
                    tab.setTextColor(selectedTabTextColor);
                }
                ViewHelper.setAlpha(tabViews.get(i).get("normal"), 1);
                ViewHelper.setAlpha(tabViews.get(i).get("selected"), 0);

                //set normal  Scale
                ViewHelper.setPivotX(frameLayout, frameLayout.getMeasuredWidth() * 0.5f);
                ViewHelper.setPivotY(frameLayout, frameLayout.getMeasuredHeight() * 0.5f);
                ViewHelper.setScaleX(frameLayout, 1f);
                ViewHelper.setScaleY(frameLayout, 1f);

                // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a
                // pre-ICS-build
                if (textAllCaps) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                        tab.setAllCaps(true);
                    } else {
                        tab.setText(tab.getText().toString().toUpperCase(locale));
                    }
                }
                if (i == selectedPosition) {
                    ViewHelper.setAlpha(tabViews.get(i).get("normal"), 0);
                    ViewHelper.setAlpha(tabViews.get(i).get("selected"), 1);

                    //set select  Scale
                    ViewHelper.setPivotX(frameLayout, frameLayout.getMeasuredWidth() * 0.5f);
                    ViewHelper.setPivotY(frameLayout, frameLayout.getMeasuredHeight() * 0.5f);
                    ViewHelper.setScaleX(frameLayout, 1 + zoomMax);
                    ViewHelper.setScaleY(frameLayout, 1 + zoomMax);
                }
            }
        }
    }
}
 
Example 17
Project: fastindex-master   File: MainActivity.java   View Source Code Vote up 4 votes
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        quickIndexBar = (FastIndexBar) findViewById(R.id.quickIndexBar);
        listview = (ListView) findViewById(R.id.listview);
        currentWord = (TextView) findViewById(R.id.currentWord);

        //1.准备数据
        fillList();
        //2.对数据进行排序
        Collections.sort(friends);
        //3.设置Adapter
        listview.setAdapter(new MyAdapter(this,friends));

        quickIndexBar.setOnTouchLetterChangeListener(new FastIndexBar.OnTouchIndexChangedListner() {
            @Override
            public void onLetterChange(String mText) {
                //根据当前触摸的字母,去集合中找那个item的首字母和letter一样,然后将对应的item放到屏幕顶端
                for (int i = 0; i < friends.size(); i++) {
                    String firstWord = friends.get(i).getPinyin().charAt(0)+"";
                    if(mText.equals(firstWord)){
                        //说明找到了,那么应该讲当前的item放到屏幕顶端
                        listview.setSelection(i);
                        break;//只需要找到第一个就行
                    }
                }

                //显示当前触摸的字母
                showCurrentWord(mText);
            }

        });


        //通过缩小currentWord来隐藏
        ViewHelper.setScaleX(currentWord, 0);
        ViewHelper.setScaleY(currentWord, 0);

//		Log.e("tag", PinYinUtil.getPinyin("黑    马"));//HEIMA
//		Log.e("tag", PinYinUtil.getPinyin("#黑**马"));//#HEI**MA
//		Log.e("tag", PinYinUtil.getPinyin("O(∩_∩)O~黑。,马"));//HEIMA
    }
 
Example 18
Project: Sega   File: FlipPageViewTransformer.java   View Source Code Vote up 4 votes
private void setSize(View view, float position, float percentage) {
    ViewHelper.setScaleX(view,(position != 0 && position != 1) ? percentage : 1);
    ViewHelper.setScaleY(view,(position != 0 && position != 1) ? percentage : 1);
}
 
Example 19
Project: Nearby   File: LogDetailInfoActivity.java   View Source Code Vote up 4 votes
@Override
    public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) {
        draggerView.setSlideEnabled(scrollY <= 0);
        // Translate overlay and image
        float flexibleRange = mFlexibleSpaceImageHeight - mActionBarSize;
        int minOverlayTransitionY = mActionBarSize - mOverlayView.getHeight();
        ViewHelper.setTranslationY(mOverlayView, ScrollUtils.getFloat(-scrollY, minOverlayTransitionY, 0));
        ViewHelper.setTranslationY(mImageView, ScrollUtils.getFloat(-scrollY, minOverlayTransitionY, 0));

        // Change alpha of overlay
//        ViewHelper.setAlpha(mOverlayView, ScrollUtils.getFloat((float) scrollY / flexibleRange, 0, 1));

        // Scale title text
        float scale = 1 + ScrollUtils.getFloat((flexibleRange - scrollY) / flexibleRange, 0, MAX_TEXT_SCALE_DELTA);
        ViewHelper.setPivotX(mTitleView, 0);
        ViewHelper.setPivotY(mTitleView, 0);
        ViewHelper.setScaleX(mTitleView, scale);
        ViewHelper.setScaleY(mTitleView, scale);

        // Translate title text
        int maxTitleTranslationY = (int) (mFlexibleSpaceImageHeight - mTitleView.getHeight() * scale);
        int titleTranslationY = maxTitleTranslationY - scrollY;
        ViewHelper.setTranslationY(mTitleView, titleTranslationY);

        // Translate FAB
        int maxFabTranslationY = mFlexibleSpaceImageHeight - 0 / 2;
        float fabTranslationY = ScrollUtils.getFloat(
                -scrollY + mFlexibleSpaceImageHeight - 0 / 2,
                mActionBarSize - 0 / 2,
                maxFabTranslationY);
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
            // On pre-honeycomb, ViewHelper.setTranslationX/Y does not set margin,
            // which causes FAB's OnClickListener not working.
//            FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mFab.getLayoutParams();
//            lp.leftMargin = mOverlayView.getWidth() - mFabMargin - mFab.getWidth();
//            lp.topMargin = (int) fabTranslationY;
//            mFab.requestLayout();
        } else {
//            ViewHelper.setTranslationX(mFab, mOverlayView.getWidth() - mFabMargin - mFab.getWidth());
//            ViewHelper.setTranslationY(mFab, fabTranslationY);
        }

        // Show/hide FAB
        if (fabTranslationY < mFlexibleSpaceShowFabOffset) {
            hideFab();
        } else {
            showFab();
        }
    }
 
Example 20
Project: Sega   File: AccordionTransformer.java   View Source Code Vote up 4 votes
@Override
protected void onTransform(View view, float position) {
    ViewHelper.setPivotX(view,position < 0 ? 0 : view.getWidth());
    ViewHelper.setScaleX(view,position < 0 ? 1f + position : 1f - position);
}