use of it.gmariotti.recyclerview.itemanimator.SlideInOutLeftItemAnimator in project RecyclerViewItemAnimators by gabrielemariotti.
the class ListActivity method setupSpinner.
private void setupSpinner() {
Spinner spinner = (Spinner) findViewById(R.id.spinner);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.animators, android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
switch(position) {
case 0:
mRecyclerView.setItemAnimator(new SlideInOutLeftItemAnimator(mRecyclerView));
break;
case 1:
mRecyclerView.setItemAnimator(new SlideInOutRightItemAnimator(mRecyclerView));
break;
case 2:
mRecyclerView.setItemAnimator(new SlideInOutTopItemAnimator(mRecyclerView));
break;
case 3:
mRecyclerView.setItemAnimator(new SlideInOutBottomItemAnimator(mRecyclerView));
break;
case 4:
mRecyclerView.setItemAnimator(new ScaleInOutItemAnimator(mRecyclerView));
break;
case 5:
mRecyclerView.setItemAnimator(new SlideScaleInOutRightItemAnimator(mRecyclerView));
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
use of it.gmariotti.recyclerview.itemanimator.SlideInOutLeftItemAnimator in project RecyclerViewItemAnimators by gabrielemariotti.
the class GridActivity method setupSpinner.
private void setupSpinner() {
Spinner spinner = (Spinner) findViewById(R.id.spinner);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.animators, android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
spinner.setAdapter(adapter);
spinner.setSelection(1);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
switch(position) {
case 0:
mRecyclerView.setItemAnimator(new SlideInOutLeftItemAnimator(mRecyclerView));
break;
case 1:
mRecyclerView.setItemAnimator(new SlideInOutRightItemAnimator(mRecyclerView));
break;
case 2:
mRecyclerView.setItemAnimator(new SlideInOutTopItemAnimator(mRecyclerView));
break;
case 3:
mRecyclerView.setItemAnimator(new SlideInOutBottomItemAnimator(mRecyclerView));
break;
case 4:
mRecyclerView.setItemAnimator(new ScaleInOutItemAnimator(mRecyclerView));
break;
case 5:
mRecyclerView.setItemAnimator(new SlideScaleInOutRightItemAnimator(mRecyclerView));
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
Aggregations