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

Updated the layout of the confirmation screens.

This commit is contained in:
dzan 2011-07-25 17:09:02 +02:00 committed by Andrew Chen
parent 252b406d8e
commit 71c7a5c9ef
4 changed files with 94 additions and 43 deletions

View File

@ -110,13 +110,13 @@
</activity> </activity>
<activity <activity
android:name="com.fsck.k9.activity.setup.AccountSetupConfirmIncoming" android:name="com.fsck.k9.activity.setup.AccountSetupConfirmIncoming"
android:label="@string/account_setup_autoconfig_title" android:label="@string/account_setup_confirm_incoming_title"
android:configChanges="keyboardHidden|orientation|locale" android:configChanges="keyboardHidden|orientation|locale"
> >
</activity> </activity>
<activity <activity
android:name="com.fsck.k9.activity.setup.AccountSetupConfirmOutgoing" android:name="com.fsck.k9.activity.setup.AccountSetupConfirmOutgoing"
android:label="@string/account_setup_autoconfig_title" android:label="@string/account_setup_confirm_outgoing_title"
android:configChanges="keyboardHidden|orientation|locale" android:configChanges="keyboardHidden|orientation|locale"
> >
</activity> </activity>

View File

@ -2,45 +2,95 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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:orientation="vertical">
<LinearLayout android:id="@+id/confirm_first_option" <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:id="@+id/confirm_options"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:orientation="horizontal">
<TextView android:id="@+id/confirm_type_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Type" /> android:layout_centerHorizontal="true"
android:stretchColumns="3"
android:padding="15dp">
<TableRow>
<TextView android:layout_column="1"
android:textSize="14sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Type:"
android:paddingRight="40dp"/>
<Spinner android:id="@+id/spinner_protocol"
android:layout_column="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/account_setup_basics_email_hint" />
<TextView android:layout_column="3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Extra information"
android:gravity="center_vertical|center_horizontal"/>
</TableRow>
<TableRow>
<TextView android:layout_column="1"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Security:" />
<Spinner android:id="@+id/spinner_sockettype"
android:layout_column="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/account_setup_basics_email_hint"/>
<TextView android:layout_column="3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Extra information"
android:gravity="center_vertical|center_horizontal"/>
</TableRow>
</TableLayout>
<Spinner android:id="@+id/spinner_protocol" <RelativeLayout android:id="@+id/server_information_header"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawSelectorOnTop="true" android:layout_below="@id/confirm_options"
android:layout_toRightOf="@id/confirm_type_label" android:layout_marginTop="3dp"
android:prompt="@string/account_setup_basics_email_hint" /> android:padding="9dp"
</LinearLayout> android:textSize="16sp"
android:background="#AAA" >
<LinearLayout android:id="@+id/confirm_second_option" <TextView android:text="Server information"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:layout_alignParentLeft="true"/>
android:layout_below="@id/confirm_first_option"> <TextView android:id="@+id/server_count_label"
<TextView android:id="@+id/confirm_security_label" android:text="( 1 / 1 )"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Security" /> android:layout_alignParentRight="true"/>
</RelativeLayout>
<Spinner android:id="@+id/spinner_sockettype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/account_setup_basics_email_hint"
android:layout_toRightOf="@id/confirm_security_label" />
</LinearLayout>
<TextView android:id="@+id/server_information" <TextView android:id="@+id/server_information"
android:padding="8dp"
android:layout_below="@id/server_information_header"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="wrap_content" />
android:layout_below="@id/confirm_second_option"/>
<!-- ONLY SHOW WHEN USER HAS TO ENTER A USERNAME HIMSELF -->
<!-- TODO -->
<!-- SHOULD ONLY BE MADE VISIBLE WHEN THERE ARE MULTIPLE MATCHING SERVERS -->
<!-- TODO -->
<!-- SHOULD ONLY BE MADE VISIBLE WHEN THE XML PROVIDES EXTRA INFORMATION LINKS -->
<!-- TODO -->
<Button android:id="@+id/confirm_ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:text="Ok go"/>
</RelativeLayout> </RelativeLayout>

View File

@ -2,7 +2,6 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView 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="10dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:textSize="16sp" > android:textSize="14sp" >
</TextView> </TextView>

View File

@ -10,11 +10,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.*;
import android.widget.AdapterView.OnItemSelectedListener; import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;
import com.fsck.k9.Account; import com.fsck.k9.Account;
import com.fsck.k9.Preferences; import com.fsck.k9.Preferences;
import com.fsck.k9.R; import com.fsck.k9.R;
@ -61,6 +58,7 @@ public abstract class AbstractSetupConfirmActivity extends K9Activity implements
Spinner mProtocolSpinner; Spinner mProtocolSpinner;
Spinner mSocketTypeSpinner; Spinner mSocketTypeSpinner;
TextView mServerInfoText; TextView mServerInfoText;
Button mOkButton;
// difference between incomming & outgoing // difference between incomming & outgoing
protected abstract List<? extends Server> getServers(); protected abstract List<? extends Server> getServers();
@ -76,6 +74,7 @@ public abstract class AbstractSetupConfirmActivity extends K9Activity implements
mSocketTypeSpinner = (Spinner) findViewById(R.id.spinner_sockettype); mSocketTypeSpinner = (Spinner) findViewById(R.id.spinner_sockettype);
mProtocolSpinner = (Spinner) findViewById(R.id.spinner_protocol); mProtocolSpinner = (Spinner) findViewById(R.id.spinner_protocol);
mServerInfoText = (TextView) findViewById(R.id.server_information); mServerInfoText = (TextView) findViewById(R.id.server_information);
mOkButton = (Button) findViewById(R.id.confirm_ok_button);
// get the data out of our intent // get the data out of our intent
// if no blank account passed make one // if no blank account passed make one
@ -101,11 +100,14 @@ public abstract class AbstractSetupConfirmActivity extends K9Activity implements
// attach the listeners // attach the listeners
mProtocolSpinner.setOnItemSelectedListener(this); mProtocolSpinner.setOnItemSelectedListener(this);
mSocketTypeSpinner.setOnItemSelectedListener(this); mSocketTypeSpinner.setOnItemSelectedListener(this);
mOkButton.setOnClickListener(this);
} }
@Override @Override
public void onClick(View view) { public void onClick(View view) {
//To change body of implemented methods use File | Settings | File Templates. if( view.getId() == R.id.confirm_ok_button ){
Toast.makeText(this,"go go go", 400).show();
}
} }
@Override @Override