Search in sources :

Example 1 with HScaleLayoutManager

use of me.dkzwm.widget.srl.manager.HScaleLayoutManager in project SmoothRefreshLayout by dkzwm.

the class TestHorizontalScaleEffectActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_horizontal_scale_effect);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setTitle(R.string.test_horizontal_scale_effect);
    SmoothRefreshLayout refreshLayout = findViewById(R.id.smoothRefreshLayout_test_horizontal_scale_effect);
    refreshLayout.setDisableLoadMore(false);
    refreshLayout.setDurationToClose(800);
    refreshLayout.setLayoutManager(new HScaleLayoutManager());
    Interpolator interpolator = new Interpolator() {

        @Override
        public float getInterpolation(float input) {
            return (float) (--input * input * ((1.7 + 1f) * input + 1.7) + 1f);
        }
    };
    refreshLayout.setSpringBackInterpolator(interpolator);
}
Also used : HScaleLayoutManager(me.dkzwm.widget.srl.manager.HScaleLayoutManager) Interpolator(android.view.animation.Interpolator) SmoothRefreshLayout(me.dkzwm.widget.srl.SmoothRefreshLayout)

Aggregations

Interpolator (android.view.animation.Interpolator)1 SmoothRefreshLayout (me.dkzwm.widget.srl.SmoothRefreshLayout)1 HScaleLayoutManager (me.dkzwm.widget.srl.manager.HScaleLayoutManager)1