Overhaul our setup wizard to have a more reasonable bottom bar and to reuse that layout code where possible; standardize the id of the 'next' button
This commit is contained in:
parent
8e0655d915
commit
ee463b32ff
10 changed files with 109 additions and 97 deletions
|
@ -1,10 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="54dip"
|
||||
android:padding="6dip"
|
||||
>
|
||||
android:fadingEdge="none"
|
||||
android:scrollbarStyle="outsideInset">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:text="@string/account_setup_basics_instructions"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -41,29 +51,36 @@
|
|||
android:layout_height="0dip"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="54dip"
|
||||
|
||||
>
|
||||
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:minWidth="@dimen/button_minWidth"
|
||||
android:layout_marginBottom="-4dip"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="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:minWidth="@dimen/button_minWidth"
|
||||
android:drawableRight="@drawable/button_indicator_next"
|
||||
android:layout_marginBottom="-4dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerVertical="false"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -3,8 +3,12 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="6dip"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="6dip"
|
||||
android:layout_width="fill_parent">
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="100sp" />
|
||||
|
@ -26,17 +30,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1" />
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="54dip"
|
||||
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:text="@string/cancel_action"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="@dimen/button_minWidth"
|
||||
android:layout_centerVertical="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
<include layout="@layout/wizard_cancel" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -169,19 +169,5 @@
|
|||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="-54dip"
|
||||
android:gravity="bottom|right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<Button
|
||||
android:id="@+id/next"
|
||||
android:text="@string/next_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="@dimen/button_minWidth"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableRight="@drawable/button_indicator_next"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="false" />
|
||||
</RelativeLayout>
|
||||
<include layout="@layout/wizard_next" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -3,8 +3,19 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="6dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginBottom="54dip"
|
||||
android:padding="6dip"
|
||||
android:fadingEdge="none"
|
||||
android:scrollbarStyle="outsideInset">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:text="@string/account_setup_names_instructions"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -37,18 +48,25 @@
|
|||
android:layout_height="0dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_marginTop="-45dip"
|
||||
android:padding="0dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="bottom|right"
|
||||
android:layout_height="54dip"
|
||||
>
|
||||
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:minWidth="@dimen/button_minWidth"
|
||||
android:drawableRight="@drawable/button_indicator_next"
|
||||
android:layout_marginBottom="-4dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="false"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="6dip"
|
||||
android:layout_width="fill_parent">
|
||||
|
||||
<ScrollView
|
||||
|
@ -11,6 +10,7 @@
|
|||
android:layout_height="fill_parent"
|
||||
android:layout_marginBottom="54dip"
|
||||
android:fadingEdge="none"
|
||||
android:padding="6dip"
|
||||
android:scrollbarStyle="outsideInset">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -63,20 +63,6 @@
|
|||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="-54dip"
|
||||
android:gravity="bottom|right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<Button
|
||||
android:id="@+id/next"
|
||||
android:text="@string/next_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="@dimen/button_minWidth"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableRight="@drawable/button_indicator_next"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="false" />
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
<include layout="@layout/wizard_next" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="6dip"
|
||||
android:layout_width="fill_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="6dip"
|
||||
android:layout_marginBottom="54dip"
|
||||
android:fadingEdge="none"
|
||||
android:scrollbarStyle="outsideInset">
|
||||
|
@ -89,19 +89,5 @@
|
|||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="-54dip"
|
||||
android:gravity="bottom|right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<Button
|
||||
android:id="@+id/next"
|
||||
android:text="@string/next_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="@dimen/button_minWidth"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableRight="@drawable/button_indicator_next"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="false" />
|
||||
</RelativeLayout>
|
||||
<include layout="@layout/wizard_next" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent">
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
|
@ -36,21 +36,6 @@
|
|||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="-54dip"
|
||||
android:gravity="bottom|right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<Button
|
||||
android:id="@+id/add_new_account"
|
||||
android:layout_width="wrap_content"
|
||||
android:minWidth="@dimen/button_minWidth"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/next_action"
|
||||
android:drawableRight="@drawable/button_indicator_next"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="false"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
<include layout="@layout/wizard_next" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
20
res/layout/wizard_cancel.xml
Normal file
20
res/layout/wizard_cancel.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?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"
|
||||
android:background="@android:drawable/bottom_bar"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent">
|
||||
<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>
|
21
res/layout/wizard_next.xml
Normal file
21
res/layout/wizard_next.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?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"
|
||||
android:background="@android:drawable/bottom_bar"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent">
|
||||
<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>
|
|
@ -263,7 +263,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
|||
listView.setOnItemClickListener(this);
|
||||
listView.setItemsCanFocus(false);
|
||||
listView.setEmptyView(findViewById(R.id.empty));
|
||||
findViewById(R.id.add_new_account).setOnClickListener(this);
|
||||
findViewById(R.id.next).setOnClickListener(this);
|
||||
registerForContextMenu(listView);
|
||||
|
||||
if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) {
|
||||
|
@ -357,7 +357,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
|||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
if (view.getId() == R.id.add_new_account) {
|
||||
if (view.getId() == R.id.next) {
|
||||
onAddNewAccount();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue