Skip to content

Commit

Permalink
Improve passphrase and onboarding UI. Abstract out routing.
Browse files Browse the repository at this point in the history
1) Update the create, prompt, and change passphrase activities.
   They are no longer dialog themed, and should look a little
   less ugly.

2) Update the import DB activity to be less ugly and more robust.

3) Abstract all of the state handling stuff out of
   ConversationListActivity.  This is now handled by RoutingActivity,
   which all launch intents move through.
  • Loading branch information
moxie0 committed Feb 17, 2013
1 parent 9e3da08 commit 5eb0432
Show file tree
Hide file tree
Showing 30 changed files with 1,166 additions and 707 deletions.
28 changes: 19 additions & 9 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light.DarkActionBar">

<activity android:name=".ConversationListActivity"
android:label="@string/app_name"
<activity android:name=".RoutingActivity"
android:theme="@style/NoAnimation.Theme.Sherlock.Light.DarkActionBar"
android:launchMode="singleTask"
android:uiOptions="splitActionBarWhenNarrow"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">

<intent-filter>
Expand All @@ -62,22 +61,34 @@
</intent-filter>

</activity>

<activity android:name=".ConversationListActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:uiOptions="splitActionBarWhenNarrow"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".ConversationActivity"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".DatabaseMigrationActivity"
android:theme="@style/NoAnimation.Theme.Sherlock.Light.DarkActionBar"
android:launchMode="singleTask"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".PassphraseCreateActivity"
android:theme="@style/Theme.Sherlock.Light.Dialog"
android:label="@string/AndroidManifest__create_passphrase"
android:launchMode="singleInstance"
android:windowSoftInputMode="stateUnchanged"
android:theme="@style/NoAnimation.Theme.Sherlock.Light.DarkActionBar"
android:launchMode="singleTop"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".PassphrasePromptActivity"
android:theme="@style/Theme.Sherlock.Light.Dialog"
android:label="@string/AndroidManifest__enter_passphrase"
android:launchMode="singleInstance"
android:windowSoftInputMode="stateVisible"
android:launchMode="singleTop"
android:theme="@style/NoAnimation.Theme.Sherlock.Light.DarkActionBar"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".ContactSelectionActivity"
Expand All @@ -95,7 +106,6 @@
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".PassphraseChangeActivity"
android:theme="@style/Theme.Sherlock.Light.Dialog"
android:label="@string/AndroidManifest__change_passphrase"
android:launchMode="singleInstance"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
Expand Down
Binary file added res/drawable-hdpi/import_database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/padlock_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/import_database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/padlock_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/import_database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/padlock_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable/background_pattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/drawable/background_pattern_repeat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/background_pattern" android:tileMode="repeat"
xmlns:android="http://schemas.android.com/apk/res/android" />
143 changes: 67 additions & 76 deletions res/layout/change_passphrase_activity.xml
Original file line number Diff line number Diff line change
@@ -1,90 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:orientation="vertical" >

<TextView
android:padding="3dip"
android:text="@string/change_passphrase_activity__old_passphrase"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

<EditText
android:id="@+id/old_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_marginBottom="5dip" />

<TextView
android:padding="3dip"
android:text="@string/change_passphrase_activity__new_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/new_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_marginBottom="5dip" />

<TextView
android:padding="3dip"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/change_passphrase_activity__repeat_new_passphrase"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:layout_height="fill_parent"
android:fillViewport="true"
android:background="@drawable/background_pattern_repeat">

<EditText
android:id="@+id/repeat_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_marginBottom="5dip" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" >

<LinearLayout android:paddingRight="16dip"
android:paddingLeft="16dip"
android:paddingTop="10dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="visible"
android:orientation="vertical">

<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:textAllCaps="true"
android:text="@string/change_passphrase_activity__old_passphrase" />

<EditText android:id="@+id/old_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_marginBottom="10dip"
android:singleLine="true"/>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dip"
android:gravity="right"
android:orientation="horizontal" >
<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:textAllCaps="true"
android:text="@string/change_passphrase_activity__new_passphrase" />

<EditText android:id="@+id/new_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"/>

<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*"
tools:ignore="UselessParent" >
<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:textAllCaps="true"
android:text="@string/change_passphrase_activity__repeat_new_passphrase" />

<EditText android:id="@+id/repeat_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"/>

<TableRow>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dip">

<Button
<Button style="@android:style/Widget.Button"
android:id="@+id/cancel_button"
android:layout_width="wrap_content"
android:text="@android:string/cancel"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="15dip"
android:text="@android:string/cancel" />

<Button
android:layout_marginRight="7dip"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<Button style="@android:style/Widget.Button"
android:id="@+id/ok_button"
android:layout_width="wrap_content"
android:text="@android:string/ok"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="16dip"
android:text="@android:string/ok" />
</TableRow>
</TableLayout>
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

</FrameLayout>
</ScrollView>
139 changes: 76 additions & 63 deletions res/layout/create_passphrase_activity.xml
Original file line number Diff line number Diff line change
@@ -1,74 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>

<ScrollView android:id="@+id/ScrollView"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
android:fillViewport="true"
android:background="@drawable/background_pattern_repeat">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:orientation="vertical">

<TextView android:text="@string/create_passphrase_activity__please_choose_a_passphrase_that_will_be_used_to_locally_encrypt_your_data_this_should_be_a_strong_passphrase"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:layout_marginBottom="10dip"/>

<TextView android:text="@string/create_passphrase_activity__passphrase"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"/>

<EditText android:id="@+id/passphrase_edit"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:inputType="textPassword"/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/repeat_label"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginBottom="5dip"
android:layout_marginTop="10dip"
android:text="@string/create_passphrase_activity__repeat"/>

<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:inputType="textPassword"
android:id="@+id/passphrase_edit_repeat"/>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" >

<LinearLayout android:id="@+id/create_layout"
android:paddingRight="16dip"
android:paddingLeft="16dip"
android:paddingTop="10dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="visible"
android:orientation="vertical">

<TextView style="@style/Registration.Description"
android:layout_width="fill_parent"
android:layout_marginBottom="16dip"
android:layout_marginTop="16dip"
android:text="@string/create_passphrase_activity__please_choose_a_passphrase_that_will_be_used_to_locally_encrypt_your_data_this_should_be_a_strong_passphrase"/>

<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:textAllCaps="true"
android:text="@string/create_passphrase_activity__passphrase" />

<EditText android:id="@+id/passphrase_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_marginBottom="10dip"
android:singleLine="true"/>

<LinearLayout android:layout_width="fill_parent"
<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:textAllCaps="true"
android:text="@string/create_passphrase_activity__repeat" />

<EditText android:id="@+id/passphrase_edit_repeat"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:singleLine="true"/>

<Button style="@android:style/Widget.Button"
android:id="@+id/ok_button"
android:text="@string/create_passphrase_activity__continue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginTop="20dip"
android:layout_marginBottom="20dip"/>
</LinearLayout>

<LinearLayout android:id="@+id/progress_layout"
android:paddingRight="16dip"
android:paddingLeft="16dip"
android:paddingTop="10dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:visibility="gone"
android:orientation="vertical">

<TextView style="@style/Registration.BigLabel"
android:layout_width="fill_parent"
android:layout_marginBottom="16dip"
android:gravity="right">
android:layout_marginTop="16dip"
android:gravity="center"
android:text="@string/create_passphrase_activity__generating_secrets"/>

<TableLayout android:layout_width="wrap_content"
<ProgressBar android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@android:string/cancel"
android:id="@+id/cancel_button"
android:layout_marginRight="15dip"
android:layout_marginLeft="16dip"/>

<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/ok"
android:id="@+id/ok_button"
android:layout_marginRight="16dip"/>
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>
android:indeterminate="true"
android:layout_gravity="center"/>
</LinearLayout>
</FrameLayout>
</ScrollView>
Loading

0 comments on commit 5eb0432

Please sign in to comment.