Search in sources :

Example 1 with VScaleLayoutManager

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

the class TestScaleEffectActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_scale_effect);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setTitle(R.string.test_scale_effect);
    ListView listView = findViewById(R.id.listView_test_scale_effect);
    ListViewAdapter adapter = new ListViewAdapter(this, getLayoutInflater());
    List<String> list = DataUtil.createList(0, 40);
    adapter.updateData(list);
    listView.setAdapter(adapter);
    SmoothRefreshLayout refreshLayout = findViewById(R.id.smoothRefreshLayout_test_scale_effect);
    refreshLayout.setDisableLoadMore(false);
    refreshLayout.setLayoutManager(new VScaleLayoutManager());
    refreshLayout.setDurationToClose(550);
    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 : ListView(android.widget.ListView) ListViewAdapter(me.dkzwm.widget.srl.sample.adapter.ListViewAdapter) VScaleLayoutManager(me.dkzwm.widget.srl.manager.VScaleLayoutManager) Interpolator(android.view.animation.Interpolator) SmoothRefreshLayout(me.dkzwm.widget.srl.SmoothRefreshLayout)

Aggregations

Interpolator (android.view.animation.Interpolator)1 ListView (android.widget.ListView)1 SmoothRefreshLayout (me.dkzwm.widget.srl.SmoothRefreshLayout)1 VScaleLayoutManager (me.dkzwm.widget.srl.manager.VScaleLayoutManager)1 ListViewAdapter (me.dkzwm.widget.srl.sample.adapter.ListViewAdapter)1