Added dynamic themes for slecting holo were avaiable

fixed the button bars in the map fragment, and parking timer to use
android's button bar styles

Change-Id: I63e1d2a07f6d13964616f23cc3772dd99437bbee
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-04-16 11:21:10 -04:00
parent e5f57674fd
commit 21d43d7f97
6 changed files with 70 additions and 104 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
package="com.TwentyCodes.android.FindMyCarFull" package="com.TwentyCodes.android.FindMyCarFull"
android:installLocation="auto"
android:versionCode="200" android:versionCode="200"
android:versionName="4.0" > android:versionName="4.0" >
@@ -27,14 +27,14 @@
<application <application
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:label="@string/app_name" > android:label="@string/app_name"
android:theme="@style/MyTheme" >
<uses-library android:name="com.google.android.maps" /> <uses-library android:name="com.google.android.maps" />
<activity <activity
android:name="Main" android:name="Main"
android:configChanges="keyboard|keyboardHidden|orientation" android:configChanges="keyboard|keyboardHidden|orientation"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar"
android:uiOptions="splitActionBarWhenNarrow" > android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -54,9 +54,7 @@
android:name="com.TwentyCodes.android.FindMyCarLib.ParkingTimerService" android:name="com.TwentyCodes.android.FindMyCarLib.ParkingTimerService"
android:process=":parkingtimer" /> android:process=":parkingtimer" />
<activity <activity android:name="com.TwentyCodes.android.FindMyCarLib.Settings" />
android:name="com.TwentyCodes.android.FindMyCarLib.Settings"
android:theme="@android:style/Theme.Light" />
<activity <activity
android:name="com.TwentyCodes.android.exception.ExceptionReportActivity" android:name="com.TwentyCodes.android.exception.ExceptionReportActivity"
android:configChanges="keyboard|keyboardHidden|orientation" /> android:configChanges="keyboard|keyboardHidden|orientation" />
@@ -65,7 +63,7 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity <activity
android:name="com.TwentyCodes.android.FindMyCarLib.ParkignTimerActivity" android:name="com.TwentyCodes.android.FindMyCarLib.ParkignTimerActivity"
android:theme="@android:style/Theme.Dialog" /> android:theme="@style/MyDialogTheme" />
<service android:name="com.TwentyCodes.android.exception.ReportPostingService" /> <service android:name="com.TwentyCodes.android.exception.ReportPostingService" />
</application> </application>

View File

@@ -1,94 +1,55 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/distance_background" android:background="@drawable/distance_background"
android:baselineAligned="false"
android:orientation="horizontal" > android:orientation="horizontal" >
<RelativeLayout <ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingBottom="10dip"
android:paddingTop="10dip" >
<com.TwentyCodes.android.FindMyCarLib.UI.DelegatedImageButton
android:id="@+id/my_location" android:id="@+id/my_location"
android:layout_width="wrap_content" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_weight="1"
android:background="@drawable/my_location_action_bar"
android:contentDescription="@string/my_location" android:contentDescription="@string/my_location"
android:duplicateParentState="true" /> android:src="@drawable/my_location_action_bar" />
</RelativeLayout>
<RelativeLayout <ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingBottom="10dip"
android:paddingTop="10dip" >
<com.TwentyCodes.android.FindMyCarLib.UI.DelegatedImageButton
android:id="@+id/mark_my_location" android:id="@+id/mark_my_location"
android:layout_width="wrap_content" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_weight="1"
android:background="@drawable/mark_my_location_action_bar"
android:contentDescription="@string/mark_car" android:contentDescription="@string/mark_car"
android:duplicateParentState="true" /> android:src="@drawable/mark_my_location_action_bar" />
</RelativeLayout>
<RelativeLayout <ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingBottom="10dip"
android:paddingTop="10dip" >
<com.TwentyCodes.android.FindMyCarLib.UI.DelegatedImageButton
android:id="@+id/show_both" android:id="@+id/show_both"
android:layout_width="wrap_content" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/car_action_bar"
android:duplicateParentState="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:paddingBottom="10dip" android:contentDescription="@string/show_both"
android:paddingTop="10dip" > android:src="@drawable/car_action_bar" />
<com.TwentyCodes.android.FindMyCarLib.UI.DelegatedImageButton <ImageButton
android:id="@+id/parking_timer" android:id="@+id/parking_timer"
android:layout_width="wrap_content" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/time_action_bar"
android:contentDescription="@string/parking_timer"
android:duplicateParentState="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:paddingBottom="10dip" android:contentDescription="@string/parking_timer"
android:paddingTop="10dip" > android:src="@drawable/time_action_bar" />
<com.TwentyCodes.android.FindMyCarLib.UI.DelegatedImageButton <ImageButton
android:id="@+id/directions" android:id="@+id/directions"
android:layout_width="wrap_content" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_weight="1"
android:background="@drawable/nav_action_bar"
android:contentDescription="@string/directions" android:contentDescription="@string/directions"
android:duplicateParentState="true" /> android:src="@drawable/nav_action_bar" />
</RelativeLayout>
</LinearLayout> </LinearLayout>

View File

@@ -102,31 +102,28 @@
<LinearLayout <LinearLayout
android:id="@+id/llButtons" android:id="@+id/llButtons"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/notiyfyme" android:layout_below="@id/notiyfyme"
android:layout_marginTop="10dip"
android:background="@drawable/distance_background" android:background="@drawable/distance_background"
android:gravity="center"
android:orientation="horizontal" > android:orientation="horizontal" >
<Button <Button
android:id="@+id/btSetTimer" android:id="@+id/btSetTimer"
android:layout_width="130dip" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_horizontal|center_vertical" android:text="@string/setTimer" />
android:text="@string/setTimer"
android:textSize="14dip" />
<Button <Button
android:id="@+id/btRemoveTimer" android:id="@+id/btRemoveTimer"
android:layout_width="130dip" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_horizontal|center_vertical" android:text="@string/removeTimer" />
android:text="@string/removeTimer"
android:textSize="14dip" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Any customizations for your app running on devices with Theme.Holo here -->
<style name="MyTheme" parent="@android:style/Theme.Holo.Light.NoActionBar"></style>
<style name="MyDialogTheme" parent="@android:style/Theme.Holo.Dialog"></style>
</resources>

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="MyTheme" parent="@android:style/Theme">
<!-- Any customizations for your app running on pre-3.0 devices here --> <!-- Any customizations for your app running on pre-3.0 devices here -->
</style>
<style name="MyTheme" parent="@android:style/Theme.Light.NoTitleBar"></style>
<style name="MyDialogTheme" parent="@android:style/Theme.Dialog"></style>
</resources> </resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
package="com.TwentyCodes.android.FindMyCarLite" package="com.TwentyCodes.android.FindMyCarLite"
android:installLocation="auto"
android:versionCode="200" android:versionCode="200"
android:versionName="4.0" > android:versionName="4.0" >
@@ -27,14 +27,14 @@
<application <application
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:label="@string/app_name" > android:label="@string/app_name"
android:theme="@style/MyTheme" >
<uses-library android:name="com.google.android.maps" /> <uses-library android:name="com.google.android.maps" />
<activity <activity
android:name="FindMyCar" android:name="FindMyCar"
android:configChanges="keyboard|keyboardHidden|orientation" android:configChanges="keyboard|keyboardHidden|orientation"
android:label="@string/app_name_lite" android:label="@string/app_name_lite"
android:theme="@android:style/Theme.Light.NoTitleBar"
android:uiOptions="splitActionBarWhenNarrow" > android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -54,9 +54,7 @@
android:name="com.TwentyCodes.android.FindMyCarLib.ParkingTimerService" android:name="com.TwentyCodes.android.FindMyCarLib.ParkingTimerService"
android:process=":parkingtimer" /> android:process=":parkingtimer" />
<activity <activity android:name="com.TwentyCodes.android.FindMyCarLib.Settings" />
android:name="com.TwentyCodes.android.FindMyCarLib.Settings"
android:theme="@android:style/Theme.Light" />
<activity <activity
android:name="com.TwentyCodes.android.exception.ExceptionReportActivity" android:name="com.TwentyCodes.android.exception.ExceptionReportActivity"
android:configChanges="keyboard|keyboardHidden|orientation" /> android:configChanges="keyboard|keyboardHidden|orientation" />
@@ -65,7 +63,7 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity <activity
android:name="com.TwentyCodes.android.FindMyCarLib.ParkignTimerActivity" android:name="com.TwentyCodes.android.FindMyCarLib.ParkignTimerActivity"
android:theme="@android:style/Theme.Dialog" /> android:theme="@style/MyDialogTheme" />
<service android:name="com.TwentyCodes.android.exception.ReportPostingService" /> <service android:name="com.TwentyCodes.android.exception.ReportPostingService" />
</application> </application>