[Android] Video player: Enforce black background
Geoffrey Métais
git at videolan.org
Tue Dec 3 11:20:12 CET 2019
vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey at videolan.org> | Tue Dec 3 09:24:34 2019 +0000| [78c4f498eff5807193cbebbee9b61fbecd038bf1] | committer: Geoffrey Métais
Video player: Enforce black background
Some shitty ROM change android.R.color.black to brown.
(cherry picked from commit ee227373ecbbf51ea1956350017e88e3d861acd7)
> https://code.videolan.org/videolan/vlc-android/commit/78c4f498eff5807193cbebbee9b61fbecd038bf1
---
libvlc/res/values/colors.xml | 4 ++++
libvlc/src/org/videolan/libvlc/util/VLCVideoLayout.java | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/libvlc/res/values/colors.xml b/libvlc/res/values/colors.xml
new file mode 100644
index 000000000..1aba70608
--- /dev/null
+++ b/libvlc/res/values/colors.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="black">#000000</color>
+</resources>
\ No newline at end of file
diff --git a/libvlc/src/org/videolan/libvlc/util/VLCVideoLayout.java b/libvlc/src/org/videolan/libvlc/util/VLCVideoLayout.java
index 575f4e164..5fad6429f 100644
--- a/libvlc/src/org/videolan/libvlc/util/VLCVideoLayout.java
+++ b/libvlc/src/org/videolan/libvlc/util/VLCVideoLayout.java
@@ -8,13 +8,13 @@ import android.view.TextureView;
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import org.videolan.R;
-import org.videolan.libvlc.MediaPlayer;
-
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
+import org.videolan.R;
+import org.videolan.libvlc.MediaPlayer;
+
/**
* VLC-ready layout which includes 2 {@link SurfaceView} (video+subtitles) and 1 {@link TextureView}
* All these surfaces are stubs, only the relevant one(s) will be inflated
@@ -50,7 +50,7 @@ public class VLCVideoLayout extends FrameLayout {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- setBackgroundColor(getResources().getColor(android.R.color.black));
+ setBackgroundResource(R.color.black);
final ViewGroup.LayoutParams lp = getLayoutParams();
lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
lp.width = ViewGroup.LayoutParams.MATCH_PARENT;
More information about the Android
mailing list