Change style for button bar in setup (Android 3+)

Use the button bar layout from Roman Nurik's WizardPager example:
https://code.google.com/p/romannurik-code/source/browse/misc/wizardpager
This commit is contained in:
cketti 2013-03-08 03:17:22 +01:00
parent 658b5dbff6
commit 0c16b8cec8
20 changed files with 308 additions and 126 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

View File

@ -0,0 +1,22 @@
<!--
Copyright 2012 Roman Nurik
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/item_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/item_focused" android:state_focused="true" />
<item android:drawable="@drawable/item_focused" android:state_selected="true" />
<item android:drawable="@android:color/transparent" />
</selector>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/dividerHorizontal" />
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/cancel"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/cancel_action" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/dividerHorizontal" />
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<Button
android:id="@+id/done"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/done_action" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/dividerHorizontal" />
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<Button
android:id="@+id/next"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/next_action" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/dividerHorizontal" />
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/manual_setup"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/account_setup_basics_manual_setup_action" />
<Button
android:id="@+id/next"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/next_action" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/dividerHorizontal" />
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/import_settings"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/settings_import" />
<Button
android:id="@+id/next"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selectable_item_background"
android:text="@string/next_action" />
</LinearLayout>
</merge>

View File

@ -7,8 +7,8 @@
<ScrollView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="6dip"
android:fadingEdge="none"
android:scrollbarStyle="outsideInset">
@ -42,34 +42,5 @@
/>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_marginTop="-45dip"
android:padding="0dip"
android:layout_alignParentBottom="true"
android:gravity="bottom|right"
android:background="@android:drawable/bottom_bar"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<Button
android:id="@+id/manual_setup"
android:text="@string/account_setup_basics_manual_setup_action"
android:minWidth="@dimen/button_minWidth"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="-4dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="false"
/>
<Button
android:id="@+id/next"
android:text="@string/next_action"
android:minWidth="@dimen/button_minWidth"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:drawableRight="@drawable/button_indicator_next"
android:layout_marginBottom="-4dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="false"
/>
</RelativeLayout>
<include layout="@layout/wizard_setup"/>
</LinearLayout>

View File

@ -6,8 +6,8 @@
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="6dip"
android:fadingEdge="none"
android:scrollbarStyle="outsideInset">

View File

@ -7,8 +7,8 @@
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="6dip"
android:fadingEdge="none"
android:scrollbarStyle="outsideInset">

View File

@ -7,8 +7,8 @@
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="6dip"
android:fadingEdge="none"
android:scrollbarStyle="outsideInset">
@ -38,22 +38,5 @@
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_marginTop="-45dip"
android:padding="0dip"
android:layout_alignParentBottom="true"
android:gravity="bottom|right"
android:background="@android:drawable/bottom_bar"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<Button
android:id="@+id/done"
android:text="@string/done_action"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="-4dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="false"
/>
</RelativeLayout>
<include layout="@layout/wizard_done" />
</LinearLayout>

View File

@ -7,9 +7,10 @@
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip"
android:fadingEdge="none"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="54dip"
android:fadingEdge="none"
android:padding="6dip"
android:scrollbarStyle="outsideInset">
<LinearLayout

View File

@ -2,14 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="6dip"
android:layout_marginBottom="54dip"
android:fadingEdge="none"
android:scrollbarStyle="outsideInset">
<LinearLayout
@ -108,6 +108,6 @@
android:layout_height="0dip"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
</ScrollView>
<include layout="@layout/wizard_next" />
</LinearLayout>

View File

@ -6,8 +6,8 @@
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip"
android:layout_height="0dp"
android:layout_weight="1"
android:fadingEdge="none" >
<LinearLayout
@ -30,35 +30,6 @@
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_marginTop="-45dip"
android:background="@android:drawable/bottom_bar"
android:gravity="bottom|right"
android:padding="0dip" >
<Button
android:id="@+id/import_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="false"
android:layout_marginBottom="-4dip"
android:minWidth="@dimen/button_minWidth"
android:text="@string/settings_import" />
<Button
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="false"
android:layout_marginBottom="-4dip"
android:drawableRight="@drawable/button_indicator_next"
android:minWidth="@dimen/button_minWidth"
android:text="@string/next_action" />
</RelativeLayout>
<include layout="@layout/wizard_welcome" />
</LinearLayout>

View File

@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginTop="-45dip"
android:padding="0dip"
android:layout_alignParentBottom="true"
android:gravity="bottom|left"
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/bottom_bar"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
android:gravity="bottom|left" >
<Button
android:id="@+id/cancel"
android:text="@string/cancel_action"
android:minWidth="@dimen/button_minWidth"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="-4dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="false"
/>
</RelativeLayout>
android:layout_height="wrap_content"
android:minWidth="@dimen/button_minWidth"
android:text="@string/cancel_action" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/bottom_bar"
android:gravity="bottom|right" >
<Button
android:id="@+id/done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/button_indicator_next"
android:minWidth="@dimen/button_minWidth"
android:text="@string/done_action" />
</LinearLayout>
</merge>

View File

@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginTop="-45dip"
android:padding="0dip"
android:layout_alignParentBottom="true"
android:gravity="bottom|right"
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/bottom_bar"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
android:gravity="bottom|right" >
<Button
android:id="@+id/next"
android:text="@string/next_action"
android:minWidth="@dimen/button_minWidth"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/button_indicator_next"
android:layout_marginBottom="-4dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="false"
/>
</RelativeLayout>
android:minWidth="@dimen/button_minWidth"
android:text="@string/next_action" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/bottom_bar"
android:gravity="bottom|right" >
<Button
android:id="@+id/manual_setup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:minWidth="@dimen/button_minWidth"
android:text="@string/account_setup_basics_manual_setup_action" />
<Button
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawableRight="@drawable/button_indicator_next"
android:minWidth="@dimen/button_minWidth"
android:text="@string/next_action" />
</RelativeLayout>
</merge>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/bottom_bar"
android:gravity="bottom|right" >
<Button
android:id="@+id/import_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:minWidth="@dimen/button_minWidth"
android:text="@string/settings_import" />
<Button
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawableRight="@drawable/button_indicator_next"
android:minWidth="@dimen/button_minWidth"
android:text="@string/next_action" />
</RelativeLayout>
</merge>