[Android] Video Player : save focus object when hiding overlay

Alexandre Perraud git at videolan.org
Fri Nov 27 18:22:34 CET 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Nov 27 17:38:21 2015 +0100| [64e520aa5a8f56c6a1bebd096c73d138e5af9851] | committer: Alexandre Perraud

Video Player : save focus object when hiding overlay

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=64e520aa5a8f56c6a1bebd096c73d138e5af9851
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java     |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 9e26cfc..fa836d5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -223,6 +223,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     private ImageView mAdvOptions;
     private ImageView mDelayPlus;
     private ImageView mDelayMinus;
+    private View mObjectFocused;
     private boolean mEnableBrightnessGesture;
     private boolean mEnableCloneMode;
     private boolean mDisplayRemainingTime = false;
@@ -2385,6 +2386,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         if (mOverlayTimeout != OVERLAY_INFINITE)
             mHandler.sendMessageDelayed(mHandler.obtainMessage(FADE_OUT), mOverlayTimeout);
         updateOverlayPausePlay();
+        if (!(mObjectFocused == null)) {
+            if (mObjectFocused.isFocusable())
+                mObjectFocused.requestFocus();
+            mObjectFocused =  null;
+        }
     }
 
 
@@ -2396,6 +2402,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             mHandler.removeMessages(FADE_OUT);
             mHandler.removeMessages(SHOW_PROGRESS);
             Log.i(TAG, "remove View!");
+            mObjectFocused = getCurrentFocus();
             if (mOverlayTips != null) mOverlayTips.setVisibility(View.INVISIBLE);
             if (!fromUser && !mIsLocked) {
                 mOverlayProgress.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out));



More information about the Android mailing list