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);
}
Aggregations