[Android] [PATCH 1/3] Video Player: translucent title after Android 4.2

Thomas Guillem thomas.guillem at gmail.com
Thu Oct 2 09:25:50 CEST 2014


Set the title under the StatusBar translucent with a black shadow.
---
 vlc-android/res/layout-v17/action_bar_layout.xml | 8 ++++++--
 vlc-android/res/values-v17/styles.xml            | 1 +
 vlc-android/res/values/attrs.xml                 | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/layout-v17/action_bar_layout.xml b/vlc-android/res/layout-v17/action_bar_layout.xml
index 7fdf996..c6ba0eb 100644
--- a/vlc-android/res/layout-v17/action_bar_layout.xml
+++ b/vlc-android/res/layout-v17/action_bar_layout.xml
@@ -8,10 +8,14 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="top"
-        android:background="?attr/video_player_overlay"
+        android:background="?attr/status_bar_overlay"
         android:text="@string/title"
         android:textColor="#ffffff"
         android:paddingLeft="5dp"
         android:paddingRight="5dp"
-        android:textSize="15sp" />
+        android:textSize="15sp"
+        android:shadowColor="@color/black"
+        android:shadowDx="3"
+        android:shadowDy="3"
+        android:shadowRadius="1.5" />
 </RelativeLayout>
diff --git a/vlc-android/res/values-v17/styles.xml b/vlc-android/res/values-v17/styles.xml
index fca6653..151b5a8 100644
--- a/vlc-android/res/values-v17/styles.xml
+++ b/vlc-android/res/values-v17/styles.xml
@@ -5,6 +5,7 @@
         <item name="android:windowActionBarOverlay">true</item>
 
         <item name="video_player_overlay">@color/transparent_gray</item>
+        <item name="status_bar_overlay">@android:color/transparent</item>
         <item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsBlack</item>
     </style>
 </resources>
diff --git a/vlc-android/res/values/attrs.xml b/vlc-android/res/values/attrs.xml
index 3b6f386..cf6a7ee 100644
--- a/vlc-android/res/values/attrs.xml
+++ b/vlc-android/res/values/attrs.xml
@@ -13,6 +13,7 @@
     <attr name="font_default" format="reference|color" />
     <attr name="font_light" format="reference|color" />
     <attr name="video_player_overlay" format="reference|color" />
+    <attr name="status_bar_overlay" format="reference|color" />
     <attr name="advanced_options_divider" format="reference|color" />
     <attr name="audio_browser_separator" format="reference|color" />
     <attr name="playlist_item_drag_shadow" format="reference|color" />
-- 
2.1.0



More information about the Android mailing list