[Android] Simplify code
Geoffrey Métais
git at videolan.org
Tue Jul 11 11:59:53 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jul 11 11:54:12 2017 +0200| [9ab3bdd1dfb190cfe307b0de501a320527f22e27] | committer: Geoffrey Métais
Simplify code
> https://code.videolan.org/videolan/vlc-android/commit/9ab3bdd1dfb190cfe307b0de501a320527f22e27
---
.../src/org/videolan/vlc/gui/video/PopupManager.java | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.java b/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.java
index c97e7bfb8..fc180318c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/PopupManager.java
@@ -235,18 +235,10 @@ public class PopupManager implements PlaybackService.Callback, GestureDetector.O
private Handler mHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
- switch (msg.what) {
- case SHOW_BUTTONS:
- mPlayPauseButton.setVisibility(View.VISIBLE);
- mCloseButton.setVisibility(View.VISIBLE);
- mExpandButton.setVisibility(View.VISIBLE);
- break;
- case HIDE_BUTTONS:
- mPlayPauseButton.setVisibility(View.GONE);
- mCloseButton.setVisibility(View.GONE);
- mExpandButton.setVisibility(View.GONE);
- break;
- }
+ int visibility = msg.what == SHOW_BUTTONS ? View.VISIBLE : View.GONE;
+ mPlayPauseButton.setVisibility(visibility);
+ mCloseButton.setVisibility(visibility);
+ mExpandButton.setVisibility(visibility);
}
};
More information about the Android
mailing list