[Android] Create a custom VLC style for the ActionBar

Ludovic Fauvet git at videolan.org
Thu Jun 21 16:04:53 CEST 2012


android | branch: master | Ludovic Fauvet <etix at videolan.org> | Thu Jun 21 16:00:08 2012 +0200| [2c9438d3afbf238287a72b7b457d9169a502c49d] | committer: Ludovic Fauvet

Create a custom VLC style for the ActionBar

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=2c9438d3afbf238287a72b7b457d9169a502c49d
---

 vlc-android/AndroidManifest.xml                   |    8 ++++----
 vlc-android/res/drawable/actionbar_background.xml |    4 ++++
 vlc-android/res/values/styles.xml                 |    9 +++++++++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index f7022b6..e07f318 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -18,14 +18,14 @@
     <application
         android:icon="@drawable/icon"
         android:label="@string/app_name"
-        android:theme="@style/Theme.Sherlock"
+        android:theme="@style/Theme.VLC"
         android:hardwareAccelerated="true" >
         <activity
             android:name=".gui.MainActivity"
             android:configChanges="orientation|screenSize"
             android:icon="@drawable/icon"
             android:label="@string/app_name"
-            android:theme="@style/Theme.Sherlock" >
+            android:theme="@style/Theme.VLC" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
@@ -58,7 +58,7 @@
             android:theme="@android:style/Theme.NoTitleBar" />
         <activity
             android:name=".gui.video.VideoListFragment"
-            android:theme="@style/Theme.Sherlock"/>
+            android:theme="@style/Theme.VLC"/>
         <activity
             android:name=".gui.video.MediaInfoActivity"
             android:theme="@android:style/Theme.NoTitleBar" />
@@ -88,7 +88,7 @@
             android:theme="@android:style/Theme.NoTitleBar" />
         <activity
             android:name=".gui.audio.AudioListActivity"
-            android:theme="@style/Theme.Sherlock"  />
+            android:theme="@style/Theme.VLC"  />
         <activity
             android:name=".gui.audio.AudioActivityGroup"
             android:theme="@android:style/Theme.NoTitleBar" />
diff --git a/vlc-android/res/drawable/actionbar_background.xml b/vlc-android/res/drawable/actionbar_background.xml
new file mode 100644
index 0000000..f2f3257
--- /dev/null
+++ b/vlc-android/res/drawable/actionbar_background.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+		android:src="@drawable/header"
+		android:tileMode="repeat" />
\ No newline at end of file
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index b796b63..a71661a 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -7,4 +7,13 @@
         <item name="android:backgroundDimEnabled">true</item>
         <item name="android:windowNoTitle">true</item>
     </style>
+
+    <style name="Theme.VLC" parent="Theme.Sherlock">
+        <item name="android:actionBarStyle">@style/ActionBar</item>
+        <item name="actionBarStyle">@style/ActionBar</item>
+    </style>
+
+    <style name="ActionBar" parent="@android:style/Widget.Holo.ActionBar">
+        <item name="android:background">@drawable/actionbar_background</item>
+    </style>
 </resources>



More information about the Android mailing list