}
public void show() {
- int offset = mLayout.getHeight();
- mLayout.setTranslationY(offset);
- mLayout.animate().translationY(0).setDuration(ANIM_DURATION)
- .setInterpolator(Gusterpolator.INSTANCE);
+ if (mLayout.getTranslationY() > 0) {
+ mLayout.animate().translationY(0).setDuration(ANIM_DURATION)
+ .setInterpolator(Gusterpolator.INSTANCE);
+ }
}
public void hide() {
int offset = mLayout.getHeight();
- mLayout.setTranslationY(0);
- mLayout.animate().translationY(offset).setDuration(ANIM_DURATION)
- .setInterpolator(Gusterpolator.INSTANCE);
+ if (mLayout.getTranslationY() < offset) {
+ mLayout.animate().translationY(offset).setDuration(ANIM_DURATION)
+ .setInterpolator(Gusterpolator.INSTANCE);
+ }
}
}
mSwipeTrend = (((int) dx) >> 1) + (mSwipeTrend >> 1);
if (dx < 0 && mFilmstripContentLayout.getTranslationX() == 0) {
mBackgroundDrawable.setOffset(0);
+ FilmstripLayout.this.onSwipeOutBegin();
}
// When we start translating the filmstrip in, we want the left edge of the