1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-13 13:05:03 -05:00

Used traditional cancel/next buttons on confirm screens. Implemented the Cancel action.

This commit is contained in:
Sander Bogaert 2012-04-30 14:38:52 +02:00 committed by Andrew Chen
parent 44fae8bbdb
commit 92cd70c068
2 changed files with 213 additions and 178 deletions

View File

@ -1,7 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="54dip" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
@ -36,12 +43,14 @@
android:drawSelectorOnTop="true"
android:prompt="@string/account_setup_basics_email_hint" />
<!--<TextView
<!--
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_column="3"
android:gravity="center_vertical|center_horizontal"
android:text="Extra information" />-->
android:text="Extra information" />
-->
</TableRow>
<TableRow>
@ -61,12 +70,14 @@
android:drawSelectorOnTop="true"
android:prompt="@string/account_setup_basics_email_hint" />
<!--<TextView
<!--
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_column="3"
android:gravity="center_vertical|center_horizontal"
android:text="Extra information" />-->
android:text="Extra information" />
-->
</TableRow>
</TableLayout>
@ -180,20 +191,38 @@
android:layout_below="@id/server_documentation_header"
android:padding="8dp" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="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/confirm_cancel_button"
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/cancel_action" />
<Button
android:id="@+id/confirm_ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="Ok go" />
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>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -130,6 +130,7 @@ public abstract class AbstractSetupConfirmActivity extends K9Activity implements
mProtocolSpinner.setOnItemSelectedListener(this);
mSocketTypeSpinner.setOnItemSelectedListener(this);
mOkButton.setOnClickListener(this);
((Button)findViewById(R.id.confirm_cancel_button)).setOnClickListener(this);
mUsernameField.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}
@ -150,6 +151,11 @@ public abstract class AbstractSetupConfirmActivity extends K9Activity implements
case R.id.confirm_ok_button:
finishAction();
break;
case R.id.confirm_cancel_button:
// by deleting we make sure the user ends up in the init screen again instead of a useless accountlist
Preferences.getPreferences(this).deleteAccount(mAccount);
finish();
return;
case R.id.confirm_next_server_button:
// TODO: write this,... it will probably never be used since no isp has 2 host for exact the same thing
break;