From 0631c2925a9cbc469abe2c02171ca06b06d46072 Mon Sep 17 00:00:00 2001 From: seven332 Date: Wed, 12 Nov 2014 23:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=98=85=E8=AF=BB=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=BB=91=E8=B0=83=E6=B6=88=E5=A4=B1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hippo/ehviewer/ui/GalleryActivity.java | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/com/hippo/ehviewer/ui/GalleryActivity.java b/src/com/hippo/ehviewer/ui/GalleryActivity.java index 31cebbc1e..b45311070 100644 --- a/src/com/hippo/ehviewer/ui/GalleryActivity.java +++ b/src/com/hippo/ehviewer/ui/GalleryActivity.java @@ -86,26 +86,30 @@ private void cancelFullScreenTask() { void setFullScreen(final boolean fullScreen) { mFullScreenHelper.setFullScreen(fullScreen); - AlphaAnimation aa = fullScreen ? new AlphaAnimation(1.0f, 0.0f) : new AlphaAnimation(0.0f, 1.0f); - aa.setDuration(Constants.ANIMATE_TIME); - aa.setAnimationListener(new AnimationListener() { - @Override - public void onAnimationStart(Animation animation) { - mFooter.setVisibility(View.VISIBLE); - } - - @Override - public void onAnimationEnd(Animation animation) { - if (fullScreen) - mFooter.setVisibility(View.INVISIBLE); - } - - @Override - public void onAnimationRepeat(Animation animation) { - // Empty - } - }); - mFooter.startAnimation(aa); + if (!(fullScreen && mFooter.getVisibility() == View.GONE) && + !(!fullScreen && mFooter.getVisibility() == View.VISIBLE)) { + AlphaAnimation aa = fullScreen ? new AlphaAnimation(1.0f, 0.0f) : + new AlphaAnimation(0.0f, 1.0f); + aa.setDuration(Constants.ANIMATE_TIME); + aa.setAnimationListener(new AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + mFooter.setVisibility(View.VISIBLE); + } + + @Override + public void onAnimationEnd(Animation animation) { + if (fullScreen) + mFooter.setVisibility(View.GONE); + } + + @Override + public void onAnimationRepeat(Animation animation) { + // Empty + } + }); + mFooter.startAnimation(aa); + } if (!fullScreen) startFullScreenTask();