use of it.gmariotti.recyclerview.adapter.SlideInBottomAnimatorAdapter in project RecyclerViewItemAnimators by gabrielemariotti.
the class AnimationGridActivity 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.adapters, 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:
AlphaAnimatorAdapter animatorAdapter = new AlphaAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(animatorAdapter);
break;
case 1:
SlideInLeftAnimatorAdapter slideInLeftAnimationRecyclerViewAdapter = new SlideInLeftAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(slideInLeftAnimationRecyclerViewAdapter);
break;
case 2:
SlideInRightAnimatorAdapter slideInRightAnimatorAdapter = new SlideInRightAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(slideInRightAnimatorAdapter);
break;
case 3:
SlideInBottomAnimatorAdapter slideInBottomAnimatorAdapter = new SlideInBottomAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(slideInBottomAnimatorAdapter);
break;
case 4:
ScaleInAnimatorAdapter scaleInRecyclerViewAnimationAdapter = new ScaleInAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(scaleInRecyclerViewAnimationAdapter);
break;
case 5:
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(swingBottomInAnimationAdapter);
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
use of it.gmariotti.recyclerview.adapter.SlideInBottomAnimatorAdapter in project RecyclerViewItemAnimators by gabrielemariotti.
the class AnimationListActivity 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.adapters, 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:
AlphaAnimatorAdapter animatorAdapter = new AlphaAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(animatorAdapter);
break;
case 1:
SlideInLeftAnimatorAdapter slideInLeftAnimationRecyclerViewAdapter = new SlideInLeftAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(slideInLeftAnimationRecyclerViewAdapter);
break;
case 2:
SlideInRightAnimatorAdapter slideInRightAnimatorAdapter = new SlideInRightAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(slideInRightAnimatorAdapter);
break;
case 3:
SlideInBottomAnimatorAdapter slideInBottomAnimatorAdapter = new SlideInBottomAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(slideInBottomAnimatorAdapter);
break;
case 4:
ScaleInAnimatorAdapter scaleInRecyclerViewAnimationAdapter = new ScaleInAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(scaleInRecyclerViewAnimationAdapter);
break;
case 5:
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(swingBottomInAnimationAdapter);
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
}
Aggregations