Commit cd9e5999 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Dim the naviguation bar when a video is playing (Android 3.0+)

parent 4ee3ebc3
......@@ -192,6 +192,12 @@ public class VideoPlayerActivity extends Activity {
load();
}
@Override
protected void onStart() {
super.onStart();
dimStatusBar(true);
}
@Override
protected void onPause() {
long time = 0;
......@@ -662,6 +668,7 @@ public class VideoPlayerActivity extends Activity {
mShowing = true;
mOverlayHeader.setVisibility(View.VISIBLE);
mOverlay.setVisibility(View.VISIBLE);
dimStatusBar(false);
}
Message msg = mHandler.obtainMessage(FADE_OUT);
if (timeout != 0) {
......@@ -692,9 +699,26 @@ public class VideoPlayerActivity extends Activity {
mOverlayHeader.setVisibility(View.INVISIBLE);
mOverlay.setVisibility(View.INVISIBLE);
mShowing = false;
dimStatusBar(true);
}
}
/**
* Dim the status bar and/or navigation icons when needed.
* Android 3.0 and later
*/
private void dimStatusBar(boolean dim) {
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
if (dim) {
mSurface.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
} else {
mSurface.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
}
}
private void updateOverlayPausePlay() {
if (mLibVLC == null) {
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment