Skip to content

Commit

Permalink
Improved registration flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-signal authored and greyson-signal committed Oct 18, 2019
1 parent a135e7e commit 86d088b
Show file tree
Hide file tree
Showing 59 changed files with 3,583 additions and 1,972 deletions.
17 changes: 1 addition & 16 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|fontScale"
android:launchMode="singleTask"/>

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

<activity android:name=".InviteActivity"
android:theme="@style/TextSecure.HighlightTheme"
android:windowSoftInputMode="stateHidden"
Expand Down Expand Up @@ -319,24 +316,12 @@
</intent-filter>
</activity>

<activity android:name=".registration.WelcomeActivity"
android:launchMode="singleTask"
android:theme="@style/TextSecure.LightRegistrationTheme"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".RegistrationActivity"
<activity android:name=".registration.RegistrationNavigationActivity"
android:launchMode="singleTask"
android:theme="@style/TextSecure.LightRegistrationTheme"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".registration.CaptchaActivity"
android:launchMode="singleTask"
android:theme="@style/TextSecure.LightNoActionBar"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".revealable.ViewOnceMessageActivity"
android:launchMode="singleTask"
android:theme="@style/TextSecure.FullScreenMedia"
Expand Down
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.1.0'
}
}

apply plugin: 'com.android.application'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'witness'
apply from: 'witness-verifications.gradle'

Expand Down Expand Up @@ -66,8 +68,11 @@ dependencies {
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.0.0'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0-alpha05'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0'
implementation "androidx.camera:camera-core:1.0.0-alpha04"
implementation "androidx.camera:camera-camera2:1.0.0-alpha04"

Expand Down
21 changes: 21 additions & 0 deletions res/layout/activity_registration_navigation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".registration.RegistrationNavigationActivity">

<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/registration" />

</androidx.constraintlayout.widget.ConstraintLayout>
37 changes: 0 additions & 37 deletions res/layout/captcha_activity.xml

This file was deleted.

6 changes: 5 additions & 1 deletion res/layout/country_code_text.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:src="@drawable/ic_add_white_original_24dp"
android:tint="@color/core_grey_60"/>
android:tint="@color/core_grey_60"
android:contentDescription="+"
tools:ignore="HardcodedText" />

<EditText
android:id="@+id/input"
Expand All @@ -28,6 +30,8 @@
android:inputType="number"
android:maxLength="3"
android:digits="1234567890"
android:saveEnabled="false"
android:hint="@string/RegistrationActivity_country_code_description"
tools:text="123" />

</LinearLayout>
47 changes: 24 additions & 23 deletions res/layout/country_list_item.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp">

<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dip"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/country_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:textAlignment="viewStart"
android:textColor="@color/core_black"
android:textSize="18sp"
tools:text="Canada" />

<TextView android:id="@+id/country_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:textSize="18sp"
android:textStyle="bold" />

<TextView android:id="@+id/country_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18.0sp"
android:textStyle="bold"
android:textColor="#7b7b7b"
android:gravity="right|center"
android:layout_marginStart="4dp"
android:layout_marginEnd="5dp"
android:layout_gravity="right|center"/>
<TextView
android:id="@+id/country_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="5dp"
android:textColor="@color/core_black"
android:textSize="18sp"
tools:text="+1" />

</LinearLayout>

10 changes: 0 additions & 10 deletions res/layout/country_selection.xml

This file was deleted.

26 changes: 15 additions & 11 deletions res/layout/enter_backup_passphrase_dialog.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/restore_passphrase_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/enter_backup_passphrase_dialog__backup_passphrase"
android:imeOptions="actionDone"
android:inputType="number" />
android:id="@+id/restore_passphrase_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:hint="@string/enter_backup_passphrase_dialog__backup_passphrase"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLength="30"
android:textSize="16sp" />

</com.google.android.material.textfield.TextInputLayout>

</FrameLayout>
22 changes: 22 additions & 0 deletions res/layout/fragment_registration_blank.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/signal_primary">

<ImageView
android:id="@+id/watermark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:importantForAccessibility="no"
android:src="@drawable/icon_transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintVertical_bias="0.4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
41 changes: 41 additions & 0 deletions res/layout/fragment_registration_captcha.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp">

<TextView
android:id="@+id/registration_captcha_title"
style="@style/Signal.Text.Headline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:gravity="center"
android:text="@string/RegistrationActivity_we_need_to_verify_that_youre_human"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<WebView
android:id="@+id/registration_captcha_web_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/registration_captcha_title" />

</androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>
27 changes: 27 additions & 0 deletions res/layout/fragment_registration_country_picker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#ffffff">

<EditText android:id="@+id/country_search"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_menu_search_holo_light"
android:hint="@string/country_selection_fragment__search" />

<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="#ffdddddd"
android:dividerHeight="1.0px"
android:choiceMode="singleChoice" />

<TextView android:id="@android:id/empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/country_selection_fragment__loading_countries" />
</LinearLayout>

0 comments on commit 86d088b

Please sign in to comment.