mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-15 22:15:15 -05:00
extract animation code from MessageView
This commit is contained in:
parent
5f9eae1580
commit
76fd8e9939
@ -11,6 +11,9 @@ import android.view.GestureDetector;
|
||||
import android.view.GestureDetector.SimpleOnGestureListener;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
import com.fsck.k9.K9;
|
||||
@ -106,6 +109,30 @@ public class K9Activity extends Activity
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected Animation inFromRightAnimation()
|
||||
{
|
||||
return slideAnimation(0.0f, +1.0f);
|
||||
}
|
||||
|
||||
protected Animation outToLeftAnimation()
|
||||
{
|
||||
return slideAnimation(0.0f, -1.0f);
|
||||
}
|
||||
|
||||
private Animation slideAnimation(float right, float left)
|
||||
{
|
||||
|
||||
Animation slide = new TranslateAnimation(
|
||||
Animation.RELATIVE_TO_PARENT, right, Animation.RELATIVE_TO_PARENT, left,
|
||||
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f
|
||||
);
|
||||
slide.setDuration(125);
|
||||
slide.setFillBefore(true);
|
||||
slide.setInterpolator(new AccelerateInterpolator());
|
||||
return slide;
|
||||
}
|
||||
|
||||
class MyGestureDetector extends SimpleOnGestureListener
|
||||
{
|
||||
|
||||
|
@ -2590,28 +2590,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
}
|
||||
|
||||
|
||||
private Animation inFromRightAnimation()
|
||||
{
|
||||
return slideAnimation(0.0f, +1.0f);
|
||||
}
|
||||
|
||||
private Animation outToLeftAnimation()
|
||||
{
|
||||
return slideAnimation(0.0f, -1.0f);
|
||||
}
|
||||
|
||||
private Animation slideAnimation(float right, float left)
|
||||
{
|
||||
|
||||
Animation slide = new TranslateAnimation(
|
||||
Animation.RELATIVE_TO_PARENT, right, Animation.RELATIVE_TO_PARENT, left,
|
||||
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f
|
||||
);
|
||||
slide.setDuration(125);
|
||||
slide.setFillBefore(true);
|
||||
slide.setInterpolator(new AccelerateInterpolator());
|
||||
return slide;
|
||||
}
|
||||
|
||||
private void initializeCrypto()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user