mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-31 07:10:14 -05:00
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
@ -1,10 +1,20 @@
|
|||||||
<?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"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_width="fill_parent">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical"
|
android:layout_marginBottom="54dip"
|
||||||
android:padding="6dip"
|
android:padding="6dip"
|
||||||
>
|
android:fadingEdge="none"
|
||||||
|
android:scrollbarStyle="outsideInset">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/account_setup_basics_instructions"
|
android:text="@string/account_setup_basics_instructions"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -41,29 +51,36 @@
|
|||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_marginTop="-45dip"
|
||||||
android:layout_height="54dip"
|
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
|
<Button
|
||||||
android:id="@+id/manual_setup"
|
android:id="@+id/manual_setup"
|
||||||
android:text="@string/account_setup_basics_manual_setup_action"
|
android:text="@string/account_setup_basics_manual_setup_action"
|
||||||
|
android:minWidth="@dimen/button_minWidth"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:minWidth="@dimen/button_minWidth"
|
android:layout_marginBottom="-4dip"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="false"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/next"
|
android:id="@+id/next"
|
||||||
android:text="@string/next_action"
|
android:text="@string/next_action"
|
||||||
|
android:minWidth="@dimen/button_minWidth"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:minWidth="@dimen/button_minWidth"
|
|
||||||
android:drawableRight="@drawable/button_indicator_next"
|
android:drawableRight="@drawable/button_indicator_next"
|
||||||
|
android:layout_marginBottom="-4dip"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="false"
|
||||||
/>
|
/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -3,8 +3,12 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:padding="6dip"
|
|
||||||
android:orientation="vertical">
|
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
|
<View
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="100sp" />
|
android:layout_height="100sp" />
|
||||||
@ -26,17 +30,6 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
<RelativeLayout
|
</LinearLayout>
|
||||||
android:layout_width="fill_parent"
|
<include layout="@layout/wizard_cancel" />
|
||||||
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>
|
</LinearLayout>
|
||||||
|
@ -169,19 +169,5 @@
|
|||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<RelativeLayout
|
<include layout="@layout/wizard_next" />
|
||||||
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>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -3,8 +3,19 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:padding="6dip"
|
|
||||||
android:orientation="vertical">
|
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
|
<TextView
|
||||||
android:text="@string/account_setup_names_instructions"
|
android:text="@string/account_setup_names_instructions"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -37,18 +48,25 @@
|
|||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_marginTop="-45dip"
|
||||||
|
android:padding="0dip"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
android:gravity="bottom|right"
|
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
|
<Button
|
||||||
android:id="@+id/done"
|
android:id="@+id/done"
|
||||||
android:text="@string/done_action"
|
android:text="@string/done_action"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="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_alignParentRight="true"
|
||||||
android:layout_centerVertical="true" />
|
android:layout_centerVertical="false"
|
||||||
|
/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:padding="6dip"
|
|
||||||
android:layout_width="fill_parent">
|
android:layout_width="fill_parent">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
@ -11,6 +10,7 @@
|
|||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_marginBottom="54dip"
|
android:layout_marginBottom="54dip"
|
||||||
android:fadingEdge="none"
|
android:fadingEdge="none"
|
||||||
|
android:padding="6dip"
|
||||||
android:scrollbarStyle="outsideInset">
|
android:scrollbarStyle="outsideInset">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
@ -63,20 +63,6 @@
|
|||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<RelativeLayout
|
<include layout="@layout/wizard_next" />
|
||||||
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>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:padding="6dip"
|
|
||||||
android:layout_width="fill_parent">
|
android:layout_width="fill_parent">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
android:padding="6dip"
|
||||||
android:layout_marginBottom="54dip"
|
android:layout_marginBottom="54dip"
|
||||||
android:fadingEdge="none"
|
android:fadingEdge="none"
|
||||||
android:scrollbarStyle="outsideInset">
|
android:scrollbarStyle="outsideInset">
|
||||||
@ -89,19 +89,5 @@
|
|||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<RelativeLayout
|
<include layout="@layout/wizard_next" />
|
||||||
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>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?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"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="fill_parent"
|
||||||
android:layout_width="fill_parent">
|
android:layout_width="fill_parent">
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@android:id/list"
|
android:id="@android:id/list"
|
||||||
@ -36,21 +36,6 @@
|
|||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<RelativeLayout
|
<include layout="@layout/wizard_next" />
|
||||||
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>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</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.setOnItemClickListener(this);
|
||||||
listView.setItemsCanFocus(false);
|
listView.setItemsCanFocus(false);
|
||||||
listView.setEmptyView(findViewById(R.id.empty));
|
listView.setEmptyView(findViewById(R.id.empty));
|
||||||
findViewById(R.id.add_new_account).setOnClickListener(this);
|
findViewById(R.id.next).setOnClickListener(this);
|
||||||
registerForContextMenu(listView);
|
registerForContextMenu(listView);
|
||||||
|
|
||||||
if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) {
|
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) {
|
public void onClick(View view) {
|
||||||
if (view.getId() == R.id.add_new_account) {
|
if (view.getId() == R.id.next) {
|
||||||
onAddNewAccount();
|
onAddNewAccount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user