Search in sources :

Example 1 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project WilliamChart by diogobernardino.

the class BarFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.fragment_bar, container, false);
    mChart = (BarChartView) layout.findViewById(R.id.chart);
    mFirstStage = true;
    layout.setOnClickListener(this);
    mChart.setOnClickListener(this);
    BarSet dataset = new BarSet(mLabels, mValues[0]);
    dataset.setColor(Color.parseColor("#eb993b"));
    mChart.addData(dataset);
    mChart.setBarSpacing(Tools.fromDpToPx(3));
    mChart.setXLabels(AxisRenderer.LabelPosition.NONE).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false);
    mChart.show(new Animation().setEasing(new BounceInterpolator()));
    return layout;
}
Also used : BarSet(com.db.chart.model.BarSet) BounceInterpolator(android.view.animation.BounceInterpolator) Animation(com.db.chart.animation.Animation) BarChartView(com.db.chart.view.BarChartView) View(android.view.View)

Example 2 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project UltimateAndroid by cymcsg.

the class PullDoorView method setupView.

@SuppressLint("NewApi")
private void setupView() {
    // 这个Interpolator你可以设置别的 我这里选择的是有弹跳效果的Interpolator
    Interpolator polator = new BounceInterpolator();
    mScroller = new Scroller(mContext, polator);
    // 获取屏幕分辨率
    WindowManager wm = (WindowManager) (mContext.getSystemService(Context.WINDOW_SERVICE));
    DisplayMetrics dm = new DisplayMetrics();
    wm.getDefaultDisplay().getMetrics(dm);
    mScreenHeigh = dm.heightPixels;
    mScreenWidth = dm.widthPixels;
    // 这里你一定要设置成透明背景,不然会影响你看到底层布局
    this.setBackgroundColor(Color.argb(0, 0, 0, 0));
    mImgView = new ImageView(mContext);
    mImgView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    // 填充整个屏幕
    mImgView.setScaleType(ImageView.ScaleType.FIT_XY);
    // 默认背景
    mImgView.setImageResource(R.drawable.test);
    addView(mImgView);
}
Also used : BounceInterpolator(android.view.animation.BounceInterpolator) BounceInterpolator(android.view.animation.BounceInterpolator) Interpolator(android.view.animation.Interpolator) Scroller(android.widget.Scroller) ImageView(android.widget.ImageView) DisplayMetrics(android.util.DisplayMetrics) WindowManager(android.view.WindowManager) SuppressLint(android.annotation.SuppressLint)

Example 3 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project UltimateAndroid by cymcsg.

the class PullDoorView method setupView.

@SuppressLint("NewApi")
private void setupView() {
    Interpolator polator = new BounceInterpolator();
    mScroller = new Scroller(mContext, polator);
    WindowManager wm = (WindowManager) (mContext.getSystemService(Context.WINDOW_SERVICE));
    DisplayMetrics dm = new DisplayMetrics();
    wm.getDefaultDisplay().getMetrics(dm);
    mScreenHeigh = dm.heightPixels;
    mScreenWidth = dm.widthPixels;
    this.setBackgroundColor(Color.argb(0, 0, 0, 0));
    mImgView = new ImageView(mContext);
    mImgView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    mImgView.setScaleType(ImageView.ScaleType.FIT_XY);
    mImgView.setImageResource(R.drawable.circle_button_ic_action_tick);
    addView(mImgView);
}
Also used : BounceInterpolator(android.view.animation.BounceInterpolator) BounceInterpolator(android.view.animation.BounceInterpolator) Interpolator(android.view.animation.Interpolator) Scroller(android.widget.Scroller) ImageView(android.widget.ImageView) DisplayMetrics(android.util.DisplayMetrics) WindowManager(android.view.WindowManager) SuppressLint(android.annotation.SuppressLint)

Example 4 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project FlexibleAdapter by davideas.

the class SlideItemAnimator method animateAddImpl.

protected ViewPropertyAnimatorCompat animateAddImpl(ViewHolder holder) {
    final View view = holder.itemView;
    ViewCompat.animate(view).cancel();
    int width = getWidth(holder);
    return ViewCompat.animate(view).translationXBy(-width).setInterpolator(new BounceInterpolator());
}
Also used : BounceInterpolator(android.view.animation.BounceInterpolator) View(android.view.View)

Example 5 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project CurtainView by aicaprio.

the class SampleActivity method showSample2.

private void showSample2() {
    setContentView(R.layout.activity_sample2);
    final CurtainView curtainView = (CurtainView) findViewById(R.id.cv1);
    final ImageView iv1 = (ImageView) findViewById(R.id.iv1);
    final GridView gv1 = (GridView) findViewById(R.id.gv1);
    final List<Map<String, Integer>> data = getData();
    gv1.setAdapter(new SimpleAdapter(this, data, R.layout.item_numbers, new String[] { TEXT_TAG }, new int[] { R.id.item_tvNum }));
    gv1.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            showToast(data.get(position).get(TEXT_TAG) + " clicked");
        }
    });
    iv1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            curtainView.toggleStatus();
        }
    });
    curtainView.setScrollerInterpolator(new BounceInterpolator());
    curtainView.post(new Runnable() {

        @Override
        public void run() {
            curtainView.setCurtainGravityAndFixedValue(null, iv1.getHeight());
        }
    });
}
Also used : BounceInterpolator(android.view.animation.BounceInterpolator) SimpleAdapter(android.widget.SimpleAdapter) GridView(android.widget.GridView) ImageView(android.widget.ImageView) CurtainView(com.movitech.aicaprio.CurtainView) View(android.view.View) AdapterView(android.widget.AdapterView) CurtainView(com.movitech.aicaprio.CurtainView) AdapterView(android.widget.AdapterView) ImageView(android.widget.ImageView) GridView(android.widget.GridView) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

BounceInterpolator (android.view.animation.BounceInterpolator)30 View (android.view.View)8 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)6 ImageView (android.widget.ImageView)6 ObjectAnimator (android.animation.ObjectAnimator)5 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)5 LinearInterpolator (android.view.animation.LinearInterpolator)5 TextView (android.widget.TextView)5 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)4 AnticipateInterpolator (android.view.animation.AnticipateInterpolator)4 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)4 Interpolator (android.view.animation.Interpolator)4 OvershootInterpolator (android.view.animation.OvershootInterpolator)4 Scroller (android.widget.Scroller)4 Animator (android.animation.Animator)3 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)3 Animation (com.db.chart.animation.Animation)3 ValueAnimator (android.animation.ValueAnimator)2 SuppressLint (android.annotation.SuppressLint)2 DisplayMetrics (android.util.DisplayMetrics)2