For Holo theme, add a divider above borderless buttons.

This commit is contained in:
Jimmy Shih
2013-06-19 14:52:33 -07:00
parent 421dbe5632
commit bcf94161b6
13 changed files with 51 additions and 22 deletions
+1
View File
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- In v14, postive button on the right. -->
<Button
android:id="@+id/help_about"
android:layout_gravity="left"
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- In v14, postive button on the right. -->
<Button
android:id="@+id/marker_edit_cancel"
android:layout_gravity="left"
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- In v14, postive button on the right. -->
<Button
android:id="@+id/track_edit_cancel"
android:layout_gravity="left"
@@ -15,14 +15,15 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- In v14, postive button on the right. -->
<Button
android:id="@+id/bottom_buttons_add"
android:id="@+id/track_widget_config_cancel"
android:layout_gravity="left"
android:text="@string/generic_add"
style="@style/BottomButton" />
<Button
android:id="@+id/bottom_buttons_cancel"
android:layout_gravity="right"
android:text="@string/generic_cancel"
style="@style/BottomButton" />
<Button
android:id="@+id/track_widget_config_add"
android:layout_gravity="right"
android:text="@string/generic_add"
style="@style/BottomButton" />
</merge>
+1
View File
@@ -24,6 +24,7 @@ limitations under the License.
android:layout_height="wrap_content"
android:layout_width="match_parent" />
</ScrollView>
<View style="@style/BottomButtonDivider" />
<LinearLayout style="@style/BottomButtonBar" >
<include layout="@layout/help_buttons" />
</LinearLayout>
+1
View File
@@ -69,6 +69,7 @@ limitations under the License.
</LinearLayout>
</LinearLayout>
</ScrollView>
<View style="@style/BottomButtonDivider" />
<LinearLayout style="@style/BottomButtonBar" >
<include layout="@layout/marker_edit_buttons" />
</LinearLayout>
+2 -1
View File
@@ -50,7 +50,7 @@ limitations under the License.
android:layout_weight="1"
android:layout_width="0dp"
style="@style/EditCategory" />
<Spinner
<Spinner
android:id="@+id/track_edit_activity_type_icon"
android:layout_gravity="bottom"
android:layout_height="wrap_content"
@@ -66,6 +66,7 @@ limitations under the License.
style="@style/EditDescription" />
</LinearLayout>
</ScrollView>
<View style="@style/BottomButtonDivider" />
<LinearLayout style="@style/BottomButtonBar" >
<include layout="@layout/track_edit_buttons" />
</LinearLayout>
+2 -1
View File
@@ -38,7 +38,8 @@ limitations under the License.
style="@style/TrackWidgetConfigSpinner" />
</LinearLayout>
</ScrollView>
<View style="@style/BottomButtonDivider" />
<LinearLayout style="@style/BottomButtonBar" >
<include layout="@layout/bottom_buttons" />
<include layout="@layout/track_widget_config_buttons" />
</LinearLayout>
</LinearLayout>
@@ -16,13 +16,13 @@ limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<Button
android:id="@+id/bottom_buttons_cancel"
android:id="@+id/track_widget_config_add"
android:layout_gravity="left"
android:text="@string/generic_cancel"
style="@style/BottomButton" />
<Button
android:id="@+id/bottom_buttons_add"
android:layout_gravity="right"
android:text="@string/generic_add"
style="@style/BottomButton" />
<Button
android:id="@+id/track_widget_config_cancel"
android:layout_gravity="right"
android:text="@string/generic_cancel"
style="@style/BottomButton" />
</merge>
+13 -3
View File
@@ -20,19 +20,29 @@ limitations under the License.
<item name="android:background">@drawable/ab_transparent_dark_holo</item>
</style>
<style name="BottomButton" parent="@android:style/Widget.Holo.Button.Borderless">
<!-- Same as BottomButton in values/styles.xml except inheriting from a parent -->
<!-- Same as BottomButton in values/styles.xml except inheriting from Widget.Holo.Button.Borderles. -->
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_width">0dp</item>
<item name="android:maxLines">2</item>
</style>
<style name="BottomButtonBar" parent="@android:style/Holo.ButtonBar">
<!-- Same as BottomButtonBar in values/styles.xml except inheriting from a parent -->
<!--
Same as BottomButtonBar in values/styles.xml except inheriting from Holo.ButtonBar and
adding measureWithLargestChild.
-->
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:orientation">horizontal</item>
<item name="android:measureWithLargestChild">true</item>
<item name="android:orientation">horizontal</item>
</style>
<style name="BottomButtonDivider">
<item name="android:background">?android:attr/dividerVertical</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_marginLeft">4dp</item>
<item name="android:layout_marginRight">4dp</item>
<item name="android:layout_width">match_parent</item>
</style>
<style name="ListItem">
<item name="android:background">?android:attr/activatedBackgroundIndicator</item>
</style>
+8 -3
View File
@@ -17,18 +17,23 @@ limitations under the License.
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The style for choose activity text -->
<style name="BottomButton" parent="@android:style/Widget.DeviceDefault.Button.Borderless">
<!-- Same as BottomButton in values/styles.xml except inheriting from a parent -->
<!--
Same as BottomButton in values/styles.xml except inheriting from
Widget.DeviceDefault.Button.Borderless.
-->
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_width">0dp</item>
<item name="android:maxLines">2</item>
</style>
<style name="BottomButtonBar" parent="@android:style/DeviceDefault.ButtonBar">
<!-- Same as BottomButtonBar in values/styles.xml except inheriting from a parent and adding measureWithLargestChild -->
<!--
Same as BottomButtonBar in values-11/styles.xml except inheriting from DeviceDefault.ButtonBar.
-->
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:orientation">horizontal</item>
<item name="android:measureWithLargestChild">true</item>
<item name="android:orientation">horizontal</item>
</style>
<style name="StatsSmallLabel" parent="@style/TextSmall">
<!-- same as StatsSmallLabel in values/styles.xml except adding textAllCaps -->
+6
View File
@@ -32,6 +32,12 @@ limitations under the License.
<item name="android:layout_width">match_parent</item>
<item name="android:orientation">horizontal</item>
</style>
<!-- bottom button divider -->
<style name="BottomButtonDivider">
<item name="android:layout_height">0dp</item>
<item name="android:layout_width">0dp</item>
<item name="android:visibility">gone</item>
</style>
<!-- edit category -->
<style name="EditCategory" parent="@style/TextMedium">
<item name="android:layout_width">match_parent</item>
@@ -80,7 +80,7 @@ public class TrackWidgetConfigActivity extends Activity {
configSpinner(item4, list, PreferencesUtils.getInt(
this, R.string.track_widget_item4, PreferencesUtils.TRACK_WIDGET_ITEM4_DEFAULT));
findViewById(R.id.bottom_buttons_add).setOnClickListener(new View.OnClickListener() {
findViewById(R.id.track_widget_config_add).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Push widget update to surface with newly set prefix
@@ -104,7 +104,7 @@ public class TrackWidgetConfigActivity extends Activity {
finish();
}
});
findViewById(R.id.bottom_buttons_cancel).setOnClickListener(new View.OnClickListener() {
findViewById(R.id.track_widget_config_cancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();