use of android.view.animation.Animation.AnimationListener in project robolectric by robolectric.
the class ShadowViewGroupTest method testLayoutAnimationListener.
@Test
public void testLayoutAnimationListener() {
assertThat(root.getLayoutAnimationListener()).isNull();
AnimationListener animationListener = new AnimationListener() {
@Override
public void onAnimationEnd(Animation a) {
}
@Override
public void onAnimationRepeat(Animation a) {
}
@Override
public void onAnimationStart(Animation a) {
}
};
root.setLayoutAnimationListener(animationListener);
assertThat(root.getLayoutAnimationListener()).isSameAs(animationListener);
}
use of android.view.animation.Animation.AnimationListener in project JamsMusicPlayer by psaravan.
the class ListViewFragment method showSearch.
/**
* Displays the search field.
*/
private void showSearch() {
mSearchLayout.setVisibility(View.VISIBLE);
final TranslateAnimation searchAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, -2f, Animation.RELATIVE_TO_SELF, 0f);
searchAnim.setDuration(500l);
searchAnim.setInterpolator(new AccelerateDecelerateInterpolator());
final TranslateAnimation gridListAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 2f);
gridListAnim.setDuration(500l);
gridListAnim.setInterpolator(new LinearInterpolator());
gridListAnim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
mListView.setAdapter(null);
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationStart(Animation animation) {
mSearchLayout.startAnimation(searchAnim);
mSearchLayout.setVisibility(View.VISIBLE);
}
});
searchAnim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
if (mSearchEditText.requestFocus()) {
mFragment.getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
});
mListView.startAnimation(gridListAnim);
}
use of android.view.animation.Animation.AnimationListener in project ListViewCellDeleteAnimation by paraches.
the class MainActivity method deleteCell.
private void deleteCell(final View v, final int index) {
AnimationListener al = new AnimationListener() {
@Override
public void onAnimationEnd(Animation arg0) {
mAnimList.remove(index);
ViewHolder vh = (ViewHolder) v.getTag();
vh.needInflate = true;
mMyAnimListAdapter.notifyDataSetChanged();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationStart(Animation animation) {
}
};
collapse(v, al);
}
use of android.view.animation.Animation.AnimationListener in project KeepScore by nolanlawson.
the class MainActivity method startShowButtonRowAnimation.
private void startShowButtonRowAnimation() {
Animation animation = AnimationUtils.loadAnimation(this, R.anim.slide_bottom_to_top);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
// propertly shrink the scroll view
spacerView.setVisibility(View.VISIBLE);
}
});
buttonRow.setAnimation(animation);
buttonRow.setVisibility(View.VISIBLE);
buttonRow.startAnimation(animation);
}
use of android.view.animation.Animation.AnimationListener in project FloatingStickies by MohammadAdib.
the class MainActivity method onTouch.
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
Animation anim = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);
anim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = prefs.edit();
CheckBox cb = (CheckBox) findViewById(R.id.checkBox);
editor.putBoolean("key", cb.isChecked());
editor.commit();
finish();
}
});
findViewById(R.id.ll0).startAnimation(anim);
}
return true;
}
Aggregations