Update registration UI.
@ -298,9 +298,15 @@
|
||||
</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"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
@ -398,7 +404,7 @@
|
||||
<activity android:name="com.soundcloud.android.crop.CropImageActivity" />
|
||||
|
||||
<activity android:name=".CreateProfileActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateVisible"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
|
BIN
res/drawable-hdpi/empty_inbox_1.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
res/drawable-hdpi/empty_inbox_2.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
res/drawable-hdpi/empty_inbox_3.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
res/drawable-hdpi/empty_inbox_4.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
res/drawable-hdpi/empty_inbox_5.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
res/drawable-hdpi/ic_profile_camera.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
res/drawable-hdpi/welcome.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
res/drawable-mdpi/empty_inbox_1.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
res/drawable-mdpi/empty_inbox_2.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
res/drawable-mdpi/empty_inbox_3.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
res/drawable-mdpi/empty_inbox_4.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
res/drawable-mdpi/empty_inbox_5.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
res/drawable-mdpi/ic_profile_camera.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
res/drawable-mdpi/welcome.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
res/drawable-xhdpi/empty_inbox_1.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
res/drawable-xhdpi/empty_inbox_2.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
res/drawable-xhdpi/empty_inbox_3.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
res/drawable-xhdpi/empty_inbox_4.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
res/drawable-xhdpi/empty_inbox_5.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
res/drawable-xhdpi/ic_profile_camera.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
res/drawable-xhdpi/welcome.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
res/drawable-xxhdpi/empty_inbox_1.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
res/drawable-xxhdpi/empty_inbox_2.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
res/drawable-xxhdpi/empty_inbox_3.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
res/drawable-xxhdpi/empty_inbox_4.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
res/drawable-xxhdpi/empty_inbox_5.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
res/drawable-xxhdpi/ic_profile_camera.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
res/drawable-xxhdpi/welcome.png
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
res/drawable-xxxhdpi/empty_inbox_1.png
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
res/drawable-xxxhdpi/empty_inbox_2.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
res/drawable-xxxhdpi/empty_inbox_3.png
Normal file
After Width: | Height: | Size: 73 KiB |
BIN
res/drawable-xxxhdpi/empty_inbox_4.png
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
res/drawable-xxxhdpi/empty_inbox_5.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
res/drawable-xxxhdpi/ic_profile_camera.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
res/drawable-xxxhdpi/welcome.png
Normal file
After Width: | Height: | Size: 147 KiB |
13
res/drawable/labeled_edit_text_background_active.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="4dp" />
|
||||
|
||||
<stroke
|
||||
android:color="@color/signal_primary"
|
||||
android:width="2dp" />
|
||||
|
||||
</shape>
|
13
res/drawable/labeled_edit_text_background_inactive.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="4dp" />
|
||||
|
||||
<stroke
|
||||
android:color="@color/core_grey_25"
|
||||
android:width="1dp" />
|
||||
|
||||
</shape>
|
@ -28,20 +28,21 @@
|
||||
|
||||
|
||||
<ImageView android:id="@+id/empty"
|
||||
android:src="@drawable/conversation_list_empty_state"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
tools:src="@drawable/conversation_list_empty_state" />
|
||||
|
||||
|
||||
<TextView android:text="@string/conversation_list_fragment__give_your_inbox_something_to_write_home_about_get_started_by_messaging_a_friend"
|
||||
android:textSize="20sp"
|
||||
android:padding="16dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingMultiplier="1.3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:text="@string/conversation_list_fragment__give_your_inbox_something_to_write_home_about_get_started_by_messaging_a_friend"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
|
33
res/layout/country_code_text.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="11dp"
|
||||
android:paddingRight="11dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:src="@drawable/ic_add_white_original_24dp"
|
||||
android:tint="@color/core_grey_60"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@color/transparent"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:maxLength="3"
|
||||
android:digits="1234567890"
|
||||
tools:text="123" />
|
||||
|
||||
</LinearLayout>
|
37
res/layout/labeled_edit_text.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<merge
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/border"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="9dp"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/text_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingRight="4dp"
|
||||
android:background="@color/white"
|
||||
android:textColor="@color/signal_primary"
|
||||
style="@style/Signal.Text.Caption"
|
||||
tools:text="Profile Name"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</merge>
|
11
res/layout/labeled_edit_text_default.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@color/transparent"
|
||||
android:singleLine="true"
|
||||
tools:text="Peter Parker"/>
|
15
res/layout/phone_text.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<EditText
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@color/transparent"
|
||||
android:singleLine="true"
|
||||
android:inputType="phone"
|
||||
tools:text="867-5309" />
|
@ -1,127 +1,195 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<FrameLayout android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<FrameLayout 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">
|
||||
|
||||
<org.thoughtcrime.securesms.components.InputAwareLayout
|
||||
<org.thoughtcrime.securesms.components.InputAwareLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="horizontal">
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView android:id="@+id/avatar"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:transitionName="avatar"/>
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/Signal.Text.Headline.Registration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/CreateProfileActivity_set_up_your_profile"
|
||||
app:layout_constraintBottom_toTopOf="@+id/name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:layout_constraintVertical_chainStyle="spread_inside" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
android:id="@+id/name"
|
||||
android:hint="@string/profile_create_activity__your_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:inputType="textCapWords"/>
|
||||
<ImageView
|
||||
android:id="@+id/avatar_background"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:src="@drawable/circle_tintable"
|
||||
android:tint="@color/core_grey_05"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/name" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar_placeholder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:src="@drawable/ic_profile_default"
|
||||
android:tint="@color/core_grey_60"
|
||||
android:transitionName="avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar_background"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar_background"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar_background"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar_background"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar_background"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar_background"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/camera_icon"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="35dp"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:cropToPadding="false"
|
||||
android:src="@drawable/ic_profile_camera"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar_background"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar_background" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.LabeledEditText
|
||||
android:id="@+id/name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/profile_create_activity__your_name"
|
||||
app:labeledEditText_background="?attr/conversation_background"
|
||||
app:labeledEditText_label="@string/CreateProfileActivity_profile_name"
|
||||
app:labeledEditText_textLayout="@layout/profile_name_text"
|
||||
app:layout_constraintBottom_toTopOf="@+id/description_text"
|
||||
app:layout_constraintEnd_toStartOf="@+id/emoji_toggle"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar_background"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiToggle
|
||||
android:id="@+id/emoji_toggle"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="37dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/touch_highlight_background"
|
||||
android:contentDescription="@string/conversation_activity__emoji_toggle_description" />
|
||||
android:id="@+id/emoji_toggle"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="37dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="9dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:background="@drawable/touch_highlight_background"
|
||||
android:contentDescription="@string/conversation_activity__emoji_toggle_description"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/name" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/information_link_container"
|
||||
android:clickable="true"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dip"
|
||||
android:gravity="center_horizontal|center_vertical">
|
||||
|
||||
<ImageView android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_info_white_18dp"
|
||||
android:tint="#73B7F0"/>
|
||||
|
||||
<TextView style="@style/Registration.Description"
|
||||
android:id="@+id/information_label"
|
||||
android:clickable="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="#73B7F0"
|
||||
android:text="@string/profile_create_activity__who_can_see_this_information"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="bottom"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
<TextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/CreateProfileActivity_signal_profiles_are_end_to_end_encrypted"
|
||||
android:textColor="@color/core_grey_60"
|
||||
app:layout_constraintBottom_toTopOf="@+id/finish_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/name"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/finish_button"
|
||||
app:cpb_textIdle="@string/profile_create_activity__finish"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="50dp"
|
||||
android:textAllCaps="true"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
android:id="@+id/finish_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="4dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/profile_create_activity__finish"
|
||||
app:layout_constraintBottom_toTopOf="@+id/skip_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView android:id="@+id/skip_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textColor="@color/gray50"
|
||||
android:text="@string/profile_create_activity__set_later"/>
|
||||
<Button
|
||||
android:id="@+id/skip_button"
|
||||
style="@style/Button.Borderless.Registration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/profile_create_activity__set_later"
|
||||
android:textColor="@color/gray50"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiDrawer
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/emoji_drawer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiDrawer xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/emoji_drawer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
</org.thoughtcrime.securesms.components.InputAwareLayout>
|
||||
</org.thoughtcrime.securesms.components.InputAwareLayout>
|
||||
|
||||
<View android:id="@+id/reveal"
|
||||
android:background="@color/textsecure_primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="invisible"/>
|
||||
<View
|
||||
android:id="@+id/reveal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/textsecure_primary"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
12
res/layout/profile_name_text.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiEditText
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@color/transparent"
|
||||
android:singleLine="true"
|
||||
android:inputType="textCapWords"
|
||||
tools:text="Peter Parker"/>
|
@ -1,335 +1,333 @@
|
||||
<?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="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:fillViewport="true"
|
||||
android:background="@color/white"
|
||||
tools:context=".RegistrationActivity">
|
||||
<ScrollView
|
||||
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="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/white"
|
||||
android:fillViewport="true"
|
||||
tools:context=".RegistrationActivity">
|
||||
|
||||
<RelativeLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/signal_primary"
|
||||
android:padding="16dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView android:id="@+id/verify_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/registration_activity__verify_your_number"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:id="@+id/verify_header"
|
||||
style="@style/Signal.Text.Headline.Registration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/RegistrationActivity_enter_your_phone_number_to_get_started" />
|
||||
|
||||
<TextView android:id="@+id/verify_subheader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="25dp"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/registration_activity__please_enter_your_mobile_number_to_receive_a_verification_code_carrier_rates_may_apply"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:id="@+id/verify_subheader"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="25dp"
|
||||
android:text="@string/RegistrationActivity_you_will_receive_a_verification_code" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
app:fabSize="normal"
|
||||
app:backgroundTint="@color/white"
|
||||
app:elevation="1dp"
|
||||
android:id="@+id/fab"
|
||||
android:transitionName="icon"
|
||||
android:src="@drawable/ic_action_name"
|
||||
android:tint="@color/grey_700"
|
||||
android:rotation="15"
|
||||
<LinearLayout
|
||||
android:id="@+id/restore_container"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="0dp"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/backup_created_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/header"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="-32dp"/>
|
||||
tools:text="Backup created: 1 min ago" />
|
||||
|
||||
<LinearLayout android:id="@+id/restore_container"
|
||||
android:padding="16dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="invisible">
|
||||
<TextView
|
||||
android:id="@+id/backup_size_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
tools:text="Backup size: 899 KB" />
|
||||
|
||||
<TextView android:id="@+id/backup_created_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Backup created: 1 min ago"/>
|
||||
|
||||
<TextView android:id="@+id/backup_size_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
tools:text="Backup size: 899 KB"/>
|
||||
|
||||
<TextView android:id="@+id/backup_progress_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
tools:text="100 messages so far..."/>
|
||||
<TextView
|
||||
android:id="@+id/backup_progress_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="16dp"
|
||||
tools:text="100 messages so far..." />
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/restore_button"
|
||||
app:cpb_textIdle="@string/registration_activity__restore_backup"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="50dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
android:id="@+id/restore_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="4dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/registration_activity__restore_backup" />
|
||||
|
||||
<TextView android:id="@+id/skip_restore_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13dp"
|
||||
android:textColor="@color/gray50"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="@string/registration_activity__skip"/>
|
||||
<Button
|
||||
android:id="@+id/skip_restore_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="13dp"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="30dp"
|
||||
android:paddingBottom="10dp"
|
||||
style="@style/Button.Borderless.Registration"
|
||||
android:text="@string/registration_activity__skip" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/registration_container"
|
||||
android:padding="16dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
tools:visibility="invisible">
|
||||
<LinearLayout
|
||||
android:id="@+id/registration_container"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false"
|
||||
tools:visibility="gone">
|
||||
|
||||
<Spinner android:id="@+id/country_spinner"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dip" />
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:layoutDirection="ltr"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<Spinner
|
||||
android:id="@+id/country_spinner"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp" />
|
||||
|
||||
<TextView android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
style="@style/Registration.Constant"
|
||||
android:text="+" />
|
||||
</FrameLayout>
|
||||
|
||||
<EditText android:id="@+id/country_code"
|
||||
android:layout_width="55dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"
|
||||
android:inputType="phone"
|
||||
android:digits="0123456789"
|
||||
android:maxLength="3" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layoutDirection="ltr"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText android:id="@+id/number"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:inputType="phone"
|
||||
android:hint="@string/registration_activity__phone_number"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"/>
|
||||
<org.thoughtcrime.securesms.components.LabeledEditText
|
||||
android:id="@+id/country_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
app:labeledEditText_background="@color/white"
|
||||
app:labeledEditText_textLayout="@layout/country_code_text" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.LabeledEditText
|
||||
android:id="@+id/number"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
app:labeledEditText_background="@color/white"
|
||||
app:labeledEditText_label="Phone Number"
|
||||
app:labeledEditText_textLayout="@layout/phone_text"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/registerButton"
|
||||
app:cpb_textIdle="@string/registration_activity__register"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="50dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
android:id="@+id/registerButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="4dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/RegistrationActivity_next" />
|
||||
|
||||
<TextView android:id="@+id/skip_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:textColor="@color/gray50"
|
||||
android:text="@android:string/cancel"/>
|
||||
|
||||
<TextView style="@style/Registration.Description"
|
||||
android:id="@+id/terms_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="#73B7F0"
|
||||
android:text="@string/RegistrationActivity_terms_and_privacy"/>
|
||||
|
||||
<TextView style="@style/Registration.Description"
|
||||
android:id="@+id/registration_information"
|
||||
android:layout_width="fill_parent"
|
||||
android:gravity="start"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/registration_activity__registration_will_transmit_some_contact_information_to_the_server_temporariliy"/>
|
||||
|
||||
<TextView style="@style/Registration.Description"
|
||||
android:id="@+id/information_label"
|
||||
android:clickable="false"
|
||||
<TextView
|
||||
android:id="@+id/skip_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="#73B7F0"
|
||||
android:text="@string/RegistrationActivity_more_information"/>
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@android:string/cancel"
|
||||
android:textColor="@color/core_grey_60" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout android:id="@+id/verification_container"
|
||||
android:visibility="invisible"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:visibility="visible">
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:id="@+id/verification_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/header"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible">
|
||||
|
||||
<org.thoughtcrime.securesms.components.registration.VerificationCodeView
|
||||
android:id="@+id/code"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:vcv_inputWidth="30dp"
|
||||
app:vcv_spacing="10dp"
|
||||
app:vcv_textColor="@color/signal_primary"
|
||||
app:vcv_inputColor="@color/grey_600"/>
|
||||
android:id="@+id/code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:vcv_inputColor="@color/core_black"
|
||||
app:vcv_inputWidth="30dp"
|
||||
app:vcv_spacing="10dp"
|
||||
app:vcv_textColor="@color/core_black" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.registration.CallMeCountDownView
|
||||
android:id="@+id/call_me_count_down"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/code"
|
||||
android:layout_marginTop="30dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"/>
|
||||
android:id="@+id/call_me_count_down"
|
||||
style="@style/Button.Borderless.Registration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/code"
|
||||
app:layout_constraintTop_toTopOf="@+id/wrong_number"
|
||||
app:layout_constraintStart_toStartOf="@+id/code" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/wrong_number"
|
||||
style="@style/Button.Borderless.Registration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_toEndOf="@id/call_me_count_down"
|
||||
android:layout_toRightOf="@id/call_me_count_down"
|
||||
android:text="@string/RegistrationActivity_wrong_number"
|
||||
app:layout_constraintEnd_toEndOf="@+id/code"
|
||||
app:layout_constraintTop_toBottomOf="@+id/code" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.registration.VerificationPinKeyboard
|
||||
android:id="@+id/keyboard"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/keyboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pin_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/header"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="30dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/pin_clarification_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/clarification_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout android:id="@+id/pin_container"
|
||||
android:paddingTop="30dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="invisible">
|
||||
|
||||
<LinearLayout android:id="@+id/pin_clarification_container"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView android:id="@+id/clarification_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="#73B7F0"
|
||||
android:text="@string/registration_activity__the_registration_lock_pin_is_not_the_same_as_the_sms_verification_code_you_just_received_please_enter_the_pin_you_previously_configured_in_the_application"/>
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/registration_activity__the_registration_lock_pin_is_not_the_same_as_the_sms_verification_code_you_just_received_please_enter_the_pin_you_previously_configured_in_the_application"
|
||||
android:textColor="#73B7F0" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="100dp"
|
||||
android:paddingRight="100dp">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:paddingLeft="100dp"
|
||||
android:paddingRight="100dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/pin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberPassword"
|
||||
android:imeOptions="actionDone"
|
||||
android:hint="@string/registration_activity__registration_lock_pin"/>
|
||||
android:id="@+id/pin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/registration_activity__registration_lock_pin"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberPassword" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/pinButton"
|
||||
app:cpb_textIdle="@string/RegistrationActivity_continue"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="50dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
android:id="@+id/pinButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="4dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/RegistrationActivity_continue" />
|
||||
|
||||
|
||||
<TextView android:id="@+id/forgot_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:padding="15dp"
|
||||
android:textColor="@color/blue_400"
|
||||
android:text="@string/registration_activity__forgot_pin"/>
|
||||
<TextView
|
||||
android:id="@+id/forgot_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:padding="15dp"
|
||||
android:text="@string/registration_activity__forgot_pin"
|
||||
android:textColor="@color/blue_400" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:parentTag="android.widget.RelativeLayout">
|
||||
|
||||
<ImageView android:id="@+id/phone_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/ic_phone_grey600_32dp"/>
|
||||
|
||||
<TextView android:id="@+id/call_me_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/phone_icon"
|
||||
android:layout_toEndOf="@id/phone_icon"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/RegistrationActivity_call_me_instead"/>
|
||||
|
||||
<TextView android:id="@+id/available_in_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toLeftOf="@+id/countdown"
|
||||
android:layout_toStartOf="@+id/countdown"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/RegistrationActivity_available_in"/>
|
||||
|
||||
<TextView android:id="@+id/countdown"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textSize="16sp"
|
||||
tools:text="1:04"/>
|
||||
|
||||
</merge>
|
69
res/layout/registration_welcome_activity.xml
Normal file
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.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">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:src="@drawable/welcome"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
style="@style/Signal.Text.Headline.Registration"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/RegistrationActivity_take_privacy_with_you_be_yourself_in_every_message"
|
||||
app:layout_constraintBottom_toTopOf="@+id/welcome_terms_button"
|
||||
app:layout_constraintEnd_toEndOf="@+id/welcome_continue_button"
|
||||
app:layout_constraintStart_toStartOf="@+id/welcome_continue_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/welcome_terms_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:text="@string/RegistrationActivity_terms_and_privacy"
|
||||
android:textColor="@color/signal_primary"
|
||||
app:layout_constraintBottom_toTopOf="@+id/welcome_continue_button"
|
||||
app:layout_constraintEnd_toEndOf="@+id/welcome_continue_button"
|
||||
app:layout_constraintStart_toStartOf="@+id/welcome_continue_button" />
|
||||
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/welcome_continue_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:layout_marginBottom="54dp"
|
||||
android:background="@color/signal_primary"
|
||||
android:textColor="@color/white"
|
||||
android:elevation="4dp"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="@color/textsecure_primary"
|
||||
app:cpb_cornerRadius="4dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/RegistrationActivity_continue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@ -1,153 +1,134 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<LinearLayout android:id="@+id/container_zero"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/container_zero"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<TextView android:id="@+id/code_zero"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="1"/>
|
||||
|
||||
<View android:id="@+id/space_zero"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"/>
|
||||
<TextView
|
||||
android:id="@+id/code_zero"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="28dp"
|
||||
tools:text="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/container_one"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginLeft="5dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/container_one"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<TextView android:id="@+id/code_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="2"/>
|
||||
|
||||
<View android:id="@+id/space_one"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"/>
|
||||
<TextView
|
||||
android:id="@+id/code_one"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="28dp"
|
||||
tools:text="2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/container_two"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginLeft="5dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/container_two"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<TextView android:id="@+id/code_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="2"/>
|
||||
|
||||
<View android:id="@+id/space_two"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"/>
|
||||
<TextView
|
||||
android:id="@+id/code_two"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="28dp"
|
||||
tools:text="2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/separator_container"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginLeft="5dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/separator_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView android:id="@+id/separator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
android:text="-"/>
|
||||
|
||||
<View
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"/>
|
||||
<TextView
|
||||
android:id="@+id/separator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textSize="28dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/container_three"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginLeft="5dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/container_three"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<TextView android:id="@+id/code_three"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="2"/>
|
||||
|
||||
<View android:id="@+id/space_three"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"/>
|
||||
<TextView
|
||||
android:id="@+id/code_three"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="28dp"
|
||||
tools:text="2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout android:id="@+id/container_four"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginLeft="5dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/container_four"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<TextView android:id="@+id/code_four"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="2"/>
|
||||
|
||||
<View android:id="@+id/space_four"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"/>
|
||||
<TextView
|
||||
android:id="@+id/code_four"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="28dp"
|
||||
tools:text="2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/container_five"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginLeft="5dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/container_five"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/labeled_edit_text_background_inactive">
|
||||
|
||||
<TextView android:id="@+id/code_five"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="2"/>
|
||||
|
||||
<View android:id="@+id/space_five"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/black"/>
|
||||
<TextView
|
||||
android:id="@+id/code_five"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="28dp"
|
||||
android:gravity="center"
|
||||
tools:text="2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
12
res/values-v23/themes.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="TextSecure.LightRegistrationTheme" parent="TextSecure.LightNoActionBar">
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:statusBarColor">@color/core_grey_02</item>
|
||||
</style>
|
||||
|
||||
<style name="TextSecure.DarkRegistrationTheme" parent="TextSecure.DarkNoActionBar">
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:statusBarColor">@color/core_black</item>
|
||||
</style>
|
||||
</resources>
|
@ -319,4 +319,9 @@
|
||||
<attr name="scrollView_maxHeight" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="LabeledEditText">
|
||||
<attr name="labeledEditText_label" format="string" />
|
||||
<attr name="labeledEditText_background" format="color" />
|
||||
<attr name="labeledEditText_textLayout" format="reference" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
|
@ -264,6 +264,9 @@
|
||||
<string name="CreateProfileActivity_problem_setting_profile">Problem setting profile</string>
|
||||
<string name="CreateProfileActivity_profile_photo">Profile photo</string>
|
||||
<string name="CreateProfileActivity_too_long">Too long</string>
|
||||
<string name="CreateProfileActivity_profile_name">Profile Name</string>
|
||||
<string name="CreateProfileActivity_set_up_your_profile">Set up your profile</string>
|
||||
<string name="CreateProfileActivity_signal_profiles_are_end_to_end_encrypted">Signal profiles are end-to-end encrypted, and the Signal service never has access to this information.</string>
|
||||
|
||||
<!-- CustomDefaultPreference -->
|
||||
<string name="CustomDefaultPreference_using_custom">Using custom: %s</string>
|
||||
@ -599,6 +602,13 @@
|
||||
</plurals>
|
||||
<string name="RegistrationActivity_we_need_to_verify_that_youre_human">We need to verify that you\'re human.</string>
|
||||
<string name="RegistrationActivity_failed_to_verify_the_captcha">Failed to verify the CAPTCHA</string>
|
||||
<string name="RegistrationActivity_next">Next</string>
|
||||
<string name="RegistrationActivity_continue">Continue</string>
|
||||
<string name="RegistrationActivity_take_privacy_with_you_be_yourself_in_every_message">Take privacy with you.\nBe yourself in every message.</string>
|
||||
<string name="RegistrationActivity_enter_your_phone_number_to_get_started">Enter your phone number to get started</string>
|
||||
<string name="RegistrationActivity_you_will_receive_a_verification_code">You will receive a verification code. Carrier rates may apply.</string>
|
||||
<string name="RegistrationActivity_enter_the_code_we_sent_to_s">Enter the code we sent to %s</string>
|
||||
<string name="RegistrationActivity_call">Call</string>
|
||||
|
||||
<!-- ScribbleActivity -->
|
||||
<string name="ScribbleActivity_save_failure">Failed to save image changes</string>
|
||||
@ -1447,11 +1457,9 @@
|
||||
<string name="ChatsPreferenceFragment_in_progress">In progress</string>
|
||||
<string name="LocalBackupJob_creating_backup">Creating backup...</string>
|
||||
<string name="ProgressPreference_d_messages_so_far">%d messages so far</string>
|
||||
<string name="RegistrationActivity_verify_s">Verify %s</string>
|
||||
<string name="RegistrationActivity_please_enter_the_verification_code_sent_to_s">Please enter the verification code sent to %s.</string>
|
||||
<string name="RegistrationActivity_wrong_number">Wrong number?</string>
|
||||
<string name="RegistrationActivity_call_me_instead">Call me instead</string>
|
||||
<string name="RegistrationActivity_available_in">Available in:\u0020</string>
|
||||
<string name="RegistrationActivity_wrong_number">Wrong number</string>
|
||||
<string name="RegistrationActivity_call_me_instead_available_in">Call me instead \n (Available in %02d:%02d)</string>
|
||||
<string name="BackupUtil_never">Never</string>
|
||||
<string name="BackupUtil_unknown">Unknown</string>
|
||||
<string name="preferences_app_protection__screen_lock">Screen lock</string>
|
||||
@ -1489,7 +1497,6 @@
|
||||
<string name="RegistrationLockDialog_error_connecting_to_the_service">Error connecting to the service</string>
|
||||
<string name="RegistrationLockDialog_disable_registration_lock_pin">Disable Registration Lock PIN?</string>
|
||||
<string name="RegistrationLockDialog_disable">Disable</string>
|
||||
<string name="RegistrationActivity_continue">Continue</string>
|
||||
<string name="preferences_chats__backups">Backups</string>
|
||||
<string name="prompt_passphrase_activity__signal_is_locked">Signal is locked</string>
|
||||
<string name="prompt_passphrase_activity__tap_to_unlock">TAP TO UNLOCK</string>
|
||||
|
@ -197,6 +197,10 @@
|
||||
<item name="android:textColor">@color/signal_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="Button.Borderless.Registration" parent="Base.Widget.AppCompat.Button.Borderless">
|
||||
<item name="android:textColor">@color/core_grey_60</item>
|
||||
</style>
|
||||
|
||||
<!-- RedPhone -->
|
||||
|
||||
<!-- Buttons in the main "button row" of the in-call onscreen touch UI. -->
|
||||
|
@ -5,7 +5,10 @@
|
||||
<item name="android:lineSpacingExtra">3sp</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<!-- TODO: Get proper letterSpacing -->
|
||||
</style>
|
||||
|
||||
<style name="Signal.Text.Headline.Registration" parent="Signal.Text.Headline">
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
</style>
|
||||
|
||||
<style name="Signal.Text.Body" parent="Base.TextAppearance.AppCompat.Body1">
|
||||
|
@ -437,4 +437,10 @@
|
||||
<item name="android:background">@color/core_grey_95</item>
|
||||
</style>
|
||||
|
||||
<style name="TextSecure.LightRegistrationTheme" parent="TextSecure.LightNoActionBar">
|
||||
</style>
|
||||
|
||||
<style name="TextSecure.DarkRegistrationTheme" parent="TextSecure.DarkNoActionBar">
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
@ -51,6 +51,7 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@ -101,10 +102,17 @@ public class ConversationListFragment extends Fragment
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = ConversationListFragment.class.getSimpleName();
|
||||
|
||||
private static final int[] EMPTY_IMAGES = new int[] { R.drawable.empty_inbox_1,
|
||||
R.drawable.empty_inbox_2,
|
||||
R.drawable.empty_inbox_3,
|
||||
R.drawable.empty_inbox_4,
|
||||
R.drawable.empty_inbox_5 };
|
||||
|
||||
private ActionMode actionMode;
|
||||
private RecyclerView list;
|
||||
private ReminderView reminderView;
|
||||
private View emptyState;
|
||||
private ImageView emptyImage;
|
||||
private TextView emptySearch;
|
||||
private PulsingFloatingActionButton fab;
|
||||
private Locale locale;
|
||||
@ -126,6 +134,7 @@ public class ConversationListFragment extends Fragment
|
||||
list = ViewUtil.findById(view, R.id.list);
|
||||
fab = ViewUtil.findById(view, R.id.fab);
|
||||
emptyState = ViewUtil.findById(view, R.id.empty_state);
|
||||
emptyImage = ViewUtil.findById(view, R.id.empty);
|
||||
emptySearch = ViewUtil.findById(view, R.id.empty_search);
|
||||
|
||||
if (archive) fab.setVisibility(View.GONE);
|
||||
@ -357,6 +366,7 @@ public class ConversationListFragment extends Fragment
|
||||
list.setVisibility(View.INVISIBLE);
|
||||
emptyState.setVisibility(View.VISIBLE);
|
||||
emptySearch.setVisibility(View.INVISIBLE);
|
||||
emptyImage.setImageResource(EMPTY_IMAGES[(int) (Math.random() * EMPTY_IMAGES.length)]);
|
||||
fab.startPulse(3 * 1000);
|
||||
} else if ((cursor == null || cursor.getCount() <= 0) && !TextUtils.isEmpty(queryFilter)) {
|
||||
list.setVisibility(View.INVISIBLE);
|
||||
|
@ -19,6 +19,8 @@ import android.support.annotation.RequiresApi;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
|
||||
import org.thoughtcrime.securesms.components.LabeledEditText;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@ -49,6 +51,7 @@ import org.thoughtcrime.securesms.profiles.SystemProfileUtil;
|
||||
import org.thoughtcrime.securesms.util.BitmapDecodingException;
|
||||
import org.thoughtcrime.securesms.util.BitmapUtil;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicRegistrationTheme;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.FileProviderUtil;
|
||||
import org.thoughtcrime.securesms.util.IntentUtils;
|
||||
@ -82,7 +85,7 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
|
||||
private static final int REQUEST_CODE_AVATAR = 1;
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
private final DynamicTheme dynamicTheme = new DynamicRegistrationTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
|
||||
@Inject SignalServiceAccountManager accountManager;
|
||||
@ -90,7 +93,7 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
private InputAwareLayout container;
|
||||
private ImageView avatar;
|
||||
private CircularProgressButton finishButton;
|
||||
private EditText name;
|
||||
private LabeledEditText name;
|
||||
private EmojiToggle emojiToggle;
|
||||
private EmojiDrawer emojiDrawer;
|
||||
private View reveal;
|
||||
@ -109,7 +112,6 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
setContentView(R.layout.profile_create_activity);
|
||||
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
getSupportActionBar().setTitle(R.string.CreateProfileActivity_your_profile_info);
|
||||
|
||||
initializeResources();
|
||||
initializeEmojiInput();
|
||||
@ -128,7 +130,7 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (container.isInputOpen()) container.hideCurrentInput(name);
|
||||
if (container.isInputOpen()) container.hideCurrentInput(name.getInput());
|
||||
else super.onBackPressed();
|
||||
}
|
||||
|
||||
@ -205,7 +207,6 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
|
||||
private void initializeResources() {
|
||||
TextView skipButton = ViewUtil.findById(this, R.id.skip_button);
|
||||
TextView informationLabel = ViewUtil.findById(this, R.id.information_label);
|
||||
|
||||
this.avatar = ViewUtil.findById(this, R.id.avatar);
|
||||
this.name = ViewUtil.findById(this, R.id.name);
|
||||
@ -216,15 +217,13 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
this.reveal = ViewUtil.findById(this, R.id.reveal);
|
||||
this.nextIntent = getIntent().getParcelableExtra(NEXT_INTENT);
|
||||
|
||||
this.avatar.setImageDrawable(new ResourceContactPhoto(R.drawable.ic_camera_alt_white_24dp).asDrawable(this, getResources().getColor(R.color.grey_400)));
|
||||
|
||||
this.avatar.setOnClickListener(view -> Permissions.with(this)
|
||||
.request(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
.ifNecessary()
|
||||
.onAnyResult(this::handleAvatarSelectionWithPermissions)
|
||||
.execute());
|
||||
|
||||
this.name.addTextChangedListener(new TextWatcher() {
|
||||
this.name.getInput().addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
@Override
|
||||
@ -232,10 +231,10 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (s.toString().getBytes().length > ProfileCipher.NAME_PADDED_LENGTH) {
|
||||
name.setError(getString(R.string.CreateProfileActivity_too_long));
|
||||
name.getInput().setError(getString(R.string.CreateProfileActivity_too_long));
|
||||
finishButton.setEnabled(false);
|
||||
} else if (name.getError() != null || !finishButton.isEnabled()) {
|
||||
name.setError(null);
|
||||
} else if (name.getInput().getError() != null || !finishButton.isEnabled()) {
|
||||
name.getInput().setError(null);
|
||||
finishButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
@ -251,15 +250,6 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
if (nextIntent != null) startActivity(nextIntent);
|
||||
finish();
|
||||
});
|
||||
|
||||
informationLabel.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://support.signal.org/hc/en-us/articles/115001434171"));
|
||||
|
||||
if (getPackageManager().queryIntentActivities(intent, 0).size() > 0) {
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeProfileName(boolean excludeSystem) {
|
||||
@ -267,14 +257,14 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
String profileName = TextSecurePreferences.getProfileName(this);
|
||||
|
||||
name.setText(profileName);
|
||||
name.setSelection(profileName.length(), profileName.length());
|
||||
name.getInput().setSelection(profileName.length(), profileName.length());
|
||||
} else if (!excludeSystem) {
|
||||
SystemProfileUtil.getSystemProfileName(this).addListener(new ListenableFuture.Listener<String>() {
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
if (!TextUtils.isEmpty(result)) {
|
||||
name.setText(result);
|
||||
name.setSelection(result.length(), result.length());
|
||||
name.getInput().setSelection(result.length(), result.length());
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,9 +328,9 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
|
||||
this.emojiToggle.setOnClickListener(v -> {
|
||||
if (container.getCurrentInput() == emojiDrawer) {
|
||||
container.showSoftkey(name);
|
||||
container.showSoftkey(name.getInput());
|
||||
} else {
|
||||
container.show(name, emojiDrawer);
|
||||
container.show(name.getInput(), emojiDrawer);
|
||||
}
|
||||
});
|
||||
|
||||
@ -352,16 +342,16 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
|
||||
|
||||
@Override
|
||||
public void onEmojiSelected(String emoji) {
|
||||
final int start = name.getSelectionStart();
|
||||
final int end = name.getSelectionEnd();
|
||||
final int start = name.getInput().getSelectionStart();
|
||||
final int end = name.getInput().getSelectionEnd();
|
||||
|
||||
name.getText().replace(Math.min(start, end), Math.max(start, end), emoji);
|
||||
name.setSelection(start + emoji.length());
|
||||
name.getInput().setSelection(start + emoji.length());
|
||||
}
|
||||
});
|
||||
|
||||
this.container.addOnKeyboardShownListener(() -> emojiToggle.setToEmoji());
|
||||
this.name.setOnClickListener(v -> container.showSoftkey(name));
|
||||
this.name.setOnClickListener(v -> container.showSoftkey(name.getInput()));
|
||||
}
|
||||
|
||||
private Intent createAvatarSelectionIntent(@Nullable File captureFile, boolean includeClear, boolean includeCamera) {
|
||||
|
@ -70,6 +70,7 @@ public class PassphraseCreateActivity extends PassphraseActivity {
|
||||
TextSecurePreferences.setPasswordDisabled(PassphraseCreateActivity.this, true);
|
||||
TextSecurePreferences.setReadReceiptsEnabled(PassphraseCreateActivity.this, true);
|
||||
TextSecurePreferences.setTypingIndicatorsEnabled(PassphraseCreateActivity.this, true);
|
||||
TextSecurePreferences.setHasSeenWelcomeScreen(PassphraseCreateActivity.this, false);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
|
||||
import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob;
|
||||
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
|
||||
import org.thoughtcrime.securesms.registration.WelcomeActivity;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
@ -31,6 +32,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
||||
private static final int STATE_UPGRADE_DATABASE = 3;
|
||||
private static final int STATE_PROMPT_PUSH_REGISTRATION = 4;
|
||||
private static final int STATE_EXPERIENCE_UPGRADE = 5;
|
||||
private static final int STATE_WELCOME_SCREEN = 6;
|
||||
|
||||
private SignalServiceNetworkAccess networkAccess;
|
||||
private BroadcastReceiver clearKeyReceiver;
|
||||
@ -132,6 +134,7 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
||||
case STATE_CREATE_PASSPHRASE: return getCreatePassphraseIntent();
|
||||
case STATE_PROMPT_PASSPHRASE: return getPromptPassphraseIntent();
|
||||
case STATE_UPGRADE_DATABASE: return getUpgradeDatabaseIntent();
|
||||
case STATE_WELCOME_SCREEN: return getWelcomeIntent();
|
||||
case STATE_PROMPT_PUSH_REGISTRATION: return getPushRegistrationIntent();
|
||||
case STATE_EXPERIENCE_UPGRADE: return getExperienceUpgradeIntent();
|
||||
default: return null;
|
||||
@ -145,6 +148,8 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
||||
return STATE_PROMPT_PASSPHRASE;
|
||||
} else if (DatabaseUpgradeActivity.isUpdate(this)) {
|
||||
return STATE_UPGRADE_DATABASE;
|
||||
} else if (!TextSecurePreferences.hasSeenWelcomeScreen(this)) {
|
||||
return STATE_WELCOME_SCREEN;
|
||||
} else if (!TextSecurePreferences.hasPromptedPushRegistration(this)) {
|
||||
return STATE_PROMPT_PUSH_REGISTRATION;
|
||||
} else if (ExperienceUpgradeActivity.isUpdate(this)) {
|
||||
@ -173,6 +178,10 @@ public abstract class PassphraseRequiredActionBarActivity extends BaseActionBarA
|
||||
return getRoutedIntent(ExperienceUpgradeActivity.class, getIntent());
|
||||
}
|
||||
|
||||
private Intent getWelcomeIntent() {
|
||||
return getRoutedIntent(WelcomeActivity.class, getPushRegistrationIntent());
|
||||
}
|
||||
|
||||
private Intent getPushRegistrationIntent() {
|
||||
return getRoutedIntent(RegistrationActivity.class, getCreateProfileIntent());
|
||||
}
|
||||
|
@ -3,28 +3,18 @@ package org.thoughtcrime.securesms;
|
||||
import android.Manifest;
|
||||
import android.animation.Animator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.util.Pair;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
@ -47,6 +37,7 @@ import com.google.android.gms.common.api.CommonStatusCodes;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.i18n.phonenumbers.AsYouTypeFormatter;
|
||||
import com.google.i18n.phonenumbers.NumberParseException;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
import com.google.i18n.phonenumbers.Phonenumber;
|
||||
|
||||
@ -58,6 +49,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
|
||||
import org.thoughtcrime.securesms.backup.FullBackupBase;
|
||||
import org.thoughtcrime.securesms.backup.FullBackupImporter;
|
||||
import org.thoughtcrime.securesms.components.LabeledEditText;
|
||||
import org.thoughtcrime.securesms.components.registration.CallMeCountDownView;
|
||||
import org.thoughtcrime.securesms.components.registration.VerificationCodeView;
|
||||
import org.thoughtcrime.securesms.components.registration.VerificationPinKeyboard;
|
||||
@ -99,6 +91,7 @@ import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.CaptchaRequiredException;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.RateLimitException;
|
||||
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
||||
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
|
||||
import org.whispersystems.signalservice.internal.push.LockedException;
|
||||
|
||||
@ -130,16 +123,13 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
private AsYouTypeFormatter countryFormatter;
|
||||
private ArrayAdapter<String> countrySpinnerAdapter;
|
||||
private Spinner countrySpinner;
|
||||
private TextView countryCode;
|
||||
private TextView number;
|
||||
private LabeledEditText countryCode;
|
||||
private LabeledEditText number;
|
||||
private CircularProgressButton createButton;
|
||||
private TextView informationView;
|
||||
private TextView informationToggleText;
|
||||
private TextView title;
|
||||
private TextView subtitle;
|
||||
private View registrationContainer;
|
||||
private View verificationContainer;
|
||||
private FloatingActionButton fab;
|
||||
|
||||
private View restoreContainer;
|
||||
private TextView restoreBackupTime;
|
||||
@ -154,6 +144,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
private View pinClarificationContainer;
|
||||
|
||||
private CallMeCountDownView callMeCountDownView;
|
||||
private View wrongNumberButton;
|
||||
private VerificationPinKeyboard keyboard;
|
||||
private VerificationCodeView verificationCodeView;
|
||||
private RegistrationState registrationState;
|
||||
@ -169,8 +160,8 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
|
||||
initializeResources();
|
||||
initializeSpinner();
|
||||
initializePermissions();
|
||||
initializeNumber();
|
||||
initializeBackupDetection();
|
||||
initializeChallengeListener();
|
||||
}
|
||||
|
||||
@ -203,31 +194,23 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
|
||||
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
private void initializeResources() {
|
||||
TextView skipButton = findViewById(R.id.skip_button);
|
||||
TextView restoreSkipButton = findViewById(R.id.skip_restore_button);
|
||||
View termsLinkView = findViewById(R.id.terms_label);
|
||||
|
||||
this.countrySpinner = findViewById(R.id.country_spinner);
|
||||
this.countryCode = findViewById(R.id.country_code);
|
||||
this.number = findViewById(R.id.number);
|
||||
this.createButton = findViewById(R.id.registerButton);
|
||||
this.informationView = findViewById(R.id.registration_information);
|
||||
this.informationToggleText = findViewById(R.id.information_label);
|
||||
this.title = findViewById(R.id.verify_header);
|
||||
this.subtitle = findViewById(R.id.verify_subheader);
|
||||
this.registrationContainer = findViewById(R.id.registration_container);
|
||||
this.verificationContainer = findViewById(R.id.verification_container);
|
||||
this.fab = findViewById(R.id.fab);
|
||||
|
||||
this.verificationCodeView = findViewById(R.id.code);
|
||||
this.keyboard = findViewById(R.id.keyboard);
|
||||
this.callMeCountDownView = findViewById(R.id.call_me_count_down);
|
||||
this.wrongNumberButton = findViewById(R.id.wrong_number);
|
||||
|
||||
this.restoreContainer = findViewById(R.id.restore_container);
|
||||
this.restoreBackupSize = findViewById(R.id.backup_size_text);
|
||||
@ -243,14 +226,12 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
|
||||
this.registrationState = new RegistrationState(RegistrationState.State.INITIAL, null, null, Optional.absent(), Optional.absent());
|
||||
|
||||
this.countryCode.addTextChangedListener(new CountryCodeChangedListener());
|
||||
this.number.addTextChangedListener(new NumberChangedListener());
|
||||
this.countryCode.getInput().addTextChangedListener(new CountryCodeChangedListener());
|
||||
this.number.getInput().addTextChangedListener(new NumberChangedListener());
|
||||
this.createButton.setOnClickListener(v -> handleRegister());
|
||||
this.callMeCountDownView.setOnClickListener(v -> handlePhoneCallRequest());
|
||||
|
||||
skipButton.setOnClickListener(v -> handleCancel());
|
||||
informationToggleText.setOnClickListener(new InformationToggleListener());
|
||||
termsLinkView.setOnClickListener(this::onTermsLinkClicked);
|
||||
restoreSkipButton.setOnClickListener(v -> displayInitialView(true));
|
||||
|
||||
if (getIntent().getBooleanExtra(RE_REGISTRATION_EXTRA, false)) {
|
||||
@ -264,9 +245,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
else verificationCodeView.delete();
|
||||
});
|
||||
|
||||
fab.setOnClickListener(this::onDebugClick);
|
||||
fab.setRippleColor(Color.TRANSPARENT);
|
||||
|
||||
this.verificationCodeView.setOnCompleteListener(this);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
@ -327,29 +305,13 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("InlinedApi")
|
||||
private void initializePermissions() {
|
||||
Permissions.with(RegistrationActivity.this)
|
||||
.request(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_PHONE_STATE)
|
||||
.ifNecessary()
|
||||
.withRationaleDialog(getString(R.string.RegistrationActivity_signal_needs_access_to_your_contacts_and_media_in_order_to_connect_with_friends),
|
||||
R.drawable.ic_contacts_white_48dp, R.drawable.ic_folder_white_48dp)
|
||||
.onSomeGranted(permissions -> {
|
||||
if (permissions.contains(Manifest.permission.READ_PHONE_STATE)) {
|
||||
initializeNumber();
|
||||
}
|
||||
|
||||
if (permissions.contains(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
initializeBackupDetection();
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private void initializeBackupDetection() {
|
||||
if (!Permissions.hasAll(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
Log.i(TAG, "Skipping backup detection. We don't have the permission.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (getIntent().getBooleanExtra(RE_REGISTRATION_EXTRA, false)) return;
|
||||
|
||||
new AsyncTask<Void, Void, BackupUtil.BackupInfo>() {
|
||||
@ -822,16 +784,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
restoreContainer.animate().translationX(0).setDuration(SCENE_TRANSITION_DURATION).setListener(null).setInterpolator(new OvershootInterpolator()).start();
|
||||
}
|
||||
}).start();
|
||||
|
||||
fab.animate().rotationBy(375f).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
fab.clearAnimation();
|
||||
fab.setImageResource(R.drawable.ic_restore_white_24dp);
|
||||
fab.animate().rotationBy(360f).setDuration(SCENE_TRANSITION_DURATION).setListener(null).start();
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
private void displayInitialView(boolean forwards) {
|
||||
@ -877,15 +829,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
registrationContainer.animate().translationX(0).setDuration(SCENE_TRANSITION_DURATION).setListener(null).setInterpolator(new OvershootInterpolator()).start();
|
||||
}
|
||||
}).start();
|
||||
|
||||
fab.animate().rotationBy(startDirectionMultiplier * 360f).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
fab.clearAnimation();
|
||||
fab.setImageResource(R.drawable.ic_action_name);
|
||||
fab.animate().rotationBy(startDirectionMultiplier * 375f).setDuration(SCENE_TRANSITION_DURATION).setListener(null).start();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void displayVerificationView(@NonNull String e164number, int callCountdown) {
|
||||
@ -898,42 +841,14 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
title.animate().translationX(-1 * title.getWidth()).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
title.setText(getString(R.string.RegistrationActivity_verify_s, e164number));
|
||||
title.setText(getString(R.string.RegistrationActivity_enter_the_code_we_sent_to_s, formatNumber(e164number)));
|
||||
title.clearAnimation();
|
||||
title.setTranslationX(title.getWidth());
|
||||
title.animate().translationX(0).setListener(null).setInterpolator(new OvershootInterpolator()).setDuration(SCENE_TRANSITION_DURATION).start();
|
||||
}
|
||||
}).start();
|
||||
|
||||
subtitle.animate().translationX(-1 * subtitle.getWidth()).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
SpannableString subtitleDescription = new SpannableString(getString(R.string.RegistrationActivity_please_enter_the_verification_code_sent_to_s, e164number));
|
||||
SpannableString wrongNumber = new SpannableString(getString(R.string.RegistrationActivity_wrong_number));
|
||||
|
||||
ClickableSpan clickableSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
displayInitialView(false);
|
||||
registrationState = new RegistrationState(RegistrationState.State.INITIAL, null, null, Optional.absent(), Optional.absent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDrawState(TextPaint paint) {
|
||||
paint.setColor(Color.WHITE);
|
||||
paint.setUnderlineText(true);
|
||||
}
|
||||
};
|
||||
|
||||
wrongNumber.setSpan(clickableSpan, 0, wrongNumber.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
subtitle.setText(new SpannableStringBuilder(subtitleDescription).append(" ").append(wrongNumber));
|
||||
subtitle.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
subtitle.clearAnimation();
|
||||
subtitle.setTranslationX(subtitle.getWidth());
|
||||
subtitle.animate().translationX(0).setListener(null).setInterpolator(new OvershootInterpolator()).setDuration(SCENE_TRANSITION_DURATION).start();
|
||||
}
|
||||
}).start();
|
||||
subtitle.setText("");
|
||||
|
||||
registrationContainer.animate().translationX(-1 * registrationContainer.getWidth()).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
@ -948,16 +863,9 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
}
|
||||
}).start();
|
||||
|
||||
fab.animate().rotationBy(-360f).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
fab.clearAnimation();
|
||||
fab.setImageResource(R.drawable.ic_textsms_24dp);
|
||||
fab.animate().rotationBy(-375f).setDuration(SCENE_TRANSITION_DURATION).setListener(null).start();
|
||||
}
|
||||
}).start();
|
||||
|
||||
this.callMeCountDownView.startCountDown(callCountdown);
|
||||
|
||||
this.wrongNumberButton.setOnClickListener(v -> onWrongNumberClicked());
|
||||
}
|
||||
|
||||
private void displayPinView(String code, long lockedUntil) {
|
||||
@ -994,15 +902,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
}
|
||||
}).start();
|
||||
|
||||
fab.animate().rotationBy(-360f).setDuration(SCENE_TRANSITION_DURATION).setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
fab.clearAnimation();
|
||||
fab.setImageResource(R.drawable.ic_lock_white_24dp);
|
||||
fab.animate().rotationBy(-360f).setDuration(SCENE_TRANSITION_DURATION).setListener(null).start();
|
||||
}
|
||||
}).start();
|
||||
|
||||
pinButton.setOnClickListener(v -> handleVerifyWithPinClicked(code, pin.getText().toString()));
|
||||
pinForgotButton.setOnClickListener(v -> handleForgottenPin(lockedUntil));
|
||||
pin.addTextChangedListener(new TextWatcher() {
|
||||
@ -1060,15 +959,20 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
}
|
||||
}
|
||||
|
||||
private void onTermsLinkClicked(View v) {
|
||||
private String formatNumber(@NonNull String e164Number) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://signal.org/legal"));
|
||||
startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(this, R.string.RegistrationActivity_no_browser, Toast.LENGTH_SHORT).show();
|
||||
Phonenumber.PhoneNumber number = PhoneNumberUtil.getInstance().parse(e164Number, null);
|
||||
return PhoneNumberUtil.getInstance().format(number, PhoneNumberUtil.PhoneNumberFormat.INTERNATIONAL);
|
||||
} catch (NumberParseException e) {
|
||||
return e164Number;
|
||||
}
|
||||
}
|
||||
|
||||
private void onWrongNumberClicked() {
|
||||
displayInitialView(false);
|
||||
registrationState = new RegistrationState(RegistrationState.State.INITIAL, null, null, Optional.absent(), Optional.absent());
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(FullBackupBase.BackupEvent event) {
|
||||
if (event.getCount() == 0) restoreBackupProgress.setText(R.string.RegistrationActivity_checking);
|
||||
@ -1167,19 +1071,6 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
|
||||
}
|
||||
}
|
||||
|
||||
private class InformationToggleListener implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (informationView.getVisibility() == View.VISIBLE) {
|
||||
informationView.setVisibility(View.GONE);
|
||||
informationToggleText.setText(R.string.RegistrationActivity_more_information);
|
||||
} else {
|
||||
informationView.setVisibility(View.VISIBLE);
|
||||
informationToggleText.setText(R.string.RegistrationActivity_less_information);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class VerificationRequestResult {
|
||||
private final String password;
|
||||
private final Optional<String> fcmToken;
|
||||
|
@ -0,0 +1,89 @@
|
||||
package org.thoughtcrime.securesms.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
public class LabeledEditText extends FrameLayout implements View.OnFocusChangeListener {
|
||||
|
||||
private TextView label;
|
||||
private EditText input;
|
||||
private View border;
|
||||
private ViewGroup textContainer;
|
||||
|
||||
public LabeledEditText(@NonNull Context context) {
|
||||
super(context);
|
||||
init(null);
|
||||
}
|
||||
|
||||
public LabeledEditText(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(attrs);
|
||||
}
|
||||
|
||||
private void init(@Nullable AttributeSet attrs) {
|
||||
inflate(getContext(), R.layout.labeled_edit_text, this);
|
||||
|
||||
String labelText = "";
|
||||
int backgroundColor = Color.BLACK;
|
||||
int textLayout = R.layout.labeled_edit_text_default;
|
||||
|
||||
if (attrs != null) {
|
||||
TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.LabeledEditText, 0, 0);
|
||||
|
||||
labelText = typedArray.getString(R.styleable.LabeledEditText_labeledEditText_label);
|
||||
backgroundColor = typedArray.getColor(R.styleable.LabeledEditText_labeledEditText_background, Color.BLACK);
|
||||
textLayout = typedArray.getResourceId(R.styleable.LabeledEditText_labeledEditText_textLayout, R.layout.labeled_edit_text_default);
|
||||
|
||||
typedArray.recycle();
|
||||
}
|
||||
|
||||
label = findViewById(R.id.label);
|
||||
border = findViewById(R.id.border);
|
||||
textContainer = findViewById(R.id.text_container);
|
||||
|
||||
inflate(getContext(), textLayout, textContainer);
|
||||
input = findViewById(R.id.input);
|
||||
|
||||
label.setText(labelText);
|
||||
label.setBackgroundColor(backgroundColor);
|
||||
|
||||
if (TextUtils.isEmpty(labelText)) {
|
||||
label.setVisibility(INVISIBLE);
|
||||
}
|
||||
|
||||
input.setOnFocusChangeListener(this);
|
||||
}
|
||||
|
||||
public EditText getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
input.setText(text);
|
||||
}
|
||||
|
||||
public Editable getText() {
|
||||
return input.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
border.setBackgroundResource(hasFocus ? R.drawable.labeled_edit_text_background_active
|
||||
: R.drawable.labeled_edit_text_background_inactive);
|
||||
}
|
||||
}
|
@ -9,99 +9,54 @@ import android.support.annotation.Nullable;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
public class CallMeCountDownView extends RelativeLayout {
|
||||
public class CallMeCountDownView extends android.support.v7.widget.AppCompatButton {
|
||||
|
||||
private ImageView phone;
|
||||
private TextView callMeText;
|
||||
private TextView availableInText;
|
||||
private TextView countDownText;
|
||||
|
||||
private int countDown;
|
||||
private OnClickListener listener;
|
||||
private int countDown;
|
||||
|
||||
public CallMeCountDownView(Context context) {
|
||||
super(context);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public CallMeCountDownView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public CallMeCountDownView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initialize();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public CallMeCountDownView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
initialize();
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
inflate(getContext(), R.layout.registration_call_me_view, this);
|
||||
|
||||
this.phone = findViewById(R.id.phone_icon);
|
||||
this.callMeText = findViewById(R.id.call_me_text);
|
||||
this.availableInText = findViewById(R.id.available_in_text);
|
||||
this.countDownText = findViewById(R.id.countdown);
|
||||
}
|
||||
|
||||
public void setOnClickListener(@Nullable OnClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public void startCountDown(int countDown) {
|
||||
setVisibility(View.VISIBLE);
|
||||
this.phone.setColorFilter(null);
|
||||
this.phone.setOnClickListener(null);
|
||||
|
||||
this.callMeText.setTextColor(getResources().getColor(R.color.grey_700));
|
||||
this.callMeText.setOnClickListener(null);
|
||||
|
||||
this.availableInText.setVisibility(View.VISIBLE);
|
||||
this.countDownText.setVisibility(View.VISIBLE);
|
||||
|
||||
this.countDown = countDown;
|
||||
updateCountDown();
|
||||
}
|
||||
|
||||
public void setCallEnabled() {
|
||||
setVisibility(View.VISIBLE);
|
||||
this.phone.setColorFilter(new PorterDuffColorFilter(getResources().getColor(R.color.signal_primary), PorterDuff.Mode.SRC_IN));
|
||||
this.callMeText.setTextColor(getResources().getColor(R.color.signal_primary));
|
||||
|
||||
this.availableInText.setVisibility(View.GONE);
|
||||
this.countDownText.setVisibility(View.GONE);
|
||||
|
||||
this.phone.setOnClickListener(v -> handlePhoneCallRequest());
|
||||
this.callMeText.setOnClickListener(v -> handlePhoneCallRequest());
|
||||
setText(R.string.RegistrationActivity_call);
|
||||
setEnabled(true);
|
||||
setAlpha(1.0f);
|
||||
}
|
||||
|
||||
private void updateCountDown() {
|
||||
if (countDown > 0) {
|
||||
setEnabled(false);
|
||||
setAlpha(0.5f);
|
||||
|
||||
countDown--;
|
||||
|
||||
int minutesRemaining = countDown / 60;
|
||||
int secondsRemaining = countDown - (minutesRemaining * 60);
|
||||
|
||||
countDownText.setText(String.format("%02d:%02d", minutesRemaining, secondsRemaining));
|
||||
countDownText.postDelayed(this::updateCountDown, 1000);
|
||||
setText(getResources().getString(R.string.RegistrationActivity_call_me_instead_available_in, minutesRemaining, secondsRemaining));
|
||||
postDelayed(this::updateCountDown, 1000);
|
||||
} else if (countDown == 0) {
|
||||
setCallEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
private void handlePhoneCallRequest() {
|
||||
if (listener != null) listener.onClick(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,23 +18,20 @@ import android.view.animation.AnimationSet;
|
||||
import android.view.animation.OvershootInterpolator;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class VerificationCodeView extends FrameLayout {
|
||||
|
||||
private final List<View> spaces = new ArrayList<>(6);
|
||||
private final List<TextView> codes = new ArrayList<>(6);
|
||||
private final List<View> containers = new ArrayList<>(7);
|
||||
private final List<View> containers = new ArrayList<>(6);
|
||||
|
||||
private OnCodeEnteredListener listener;
|
||||
private int index = 0;
|
||||
@ -68,13 +65,6 @@ public class VerificationCodeView extends FrameLayout {
|
||||
try {
|
||||
TextView separator = findViewById(R.id.separator);
|
||||
|
||||
this.spaces.add(findViewById(R.id.space_zero));
|
||||
this.spaces.add(findViewById(R.id.space_one));
|
||||
this.spaces.add(findViewById(R.id.space_two));
|
||||
this.spaces.add(findViewById(R.id.space_three));
|
||||
this.spaces.add(findViewById(R.id.space_four));
|
||||
this.spaces.add(findViewById(R.id.space_five));
|
||||
|
||||
this.codes.add(findViewById(R.id.code_zero));
|
||||
this.codes.add(findViewById(R.id.code_one));
|
||||
this.codes.add(findViewById(R.id.code_two));
|
||||
@ -85,25 +75,16 @@ public class VerificationCodeView extends FrameLayout {
|
||||
this.containers.add(findViewById(R.id.container_zero));
|
||||
this.containers.add(findViewById(R.id.container_one));
|
||||
this.containers.add(findViewById(R.id.container_two));
|
||||
this.containers.add(findViewById(R.id.separator_container));
|
||||
this.containers.add(findViewById(R.id.container_three));
|
||||
this.containers.add(findViewById(R.id.container_four));
|
||||
this.containers.add(findViewById(R.id.container_five));
|
||||
|
||||
Stream.of(spaces).forEach(view -> view.setBackgroundColor(typedArray.getColor(R.styleable.VerificationCodeView_vcv_inputColor, Color.BLACK)));
|
||||
Stream.of(spaces).forEach(view -> view.setLayoutParams(new LinearLayout.LayoutParams(typedArray.getDimensionPixelSize(R.styleable.VerificationCodeView_vcv_inputWidth, ViewUtil.dpToPx(context, 20)),
|
||||
typedArray.getDimensionPixelSize(R.styleable.VerificationCodeView_vcv_inputHeight, ViewUtil.dpToPx(context, 1)))));
|
||||
Stream.of(codes).forEach(textView -> textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, typedArray.getDimension(R.styleable.VerificationCodeView_vcv_textSize, 30)));
|
||||
Stream.of(codes).forEach(textView -> textView.setTextColor(typedArray.getColor(R.styleable.VerificationCodeView_vcv_textColor, Color.GRAY)));
|
||||
|
||||
Stream.of(containers).forEach(view -> {
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)view.getLayoutParams();
|
||||
params.setMargins(typedArray.getDimensionPixelSize(R.styleable.VerificationCodeView_vcv_spacing, ViewUtil.dpToPx(context, 5)),
|
||||
params.topMargin, params.rightMargin, params.bottomMargin);
|
||||
view.setLayoutParams(params);
|
||||
});
|
||||
|
||||
separator.setTextSize(TypedValue.COMPLEX_UNIT_SP, typedArray.getDimension(R.styleable.VerificationCodeView_vcv_textSize, 30));
|
||||
separator.setTextColor(typedArray.getColor(R.styleable.VerificationCodeView_vcv_textColor, Color.GRAY));
|
||||
|
||||
} finally {
|
||||
if (typedArray != null) typedArray.recycle();
|
||||
}
|
||||
@ -118,6 +99,9 @@ public class VerificationCodeView extends FrameLayout {
|
||||
public void append(int value) {
|
||||
if (index >= codes.size()) return;
|
||||
|
||||
setInactive(containers);
|
||||
setActive(containers.get(index));
|
||||
|
||||
TextView codeView = codes.get(index++);
|
||||
|
||||
Animation translateIn = new TranslateAnimation(0, 0, codeView.getHeight(), 0);
|
||||
@ -146,6 +130,8 @@ public class VerificationCodeView extends FrameLayout {
|
||||
public void delete() {
|
||||
if (index <= 0) return;
|
||||
codes.get(--index).setText("");
|
||||
setInactive(containers);
|
||||
setActive(containers.get(index));
|
||||
}
|
||||
|
||||
@MainThread
|
||||
@ -154,6 +140,15 @@ public class VerificationCodeView extends FrameLayout {
|
||||
Stream.of(codes).forEach(code -> code.setText(""));
|
||||
index = 0;
|
||||
}
|
||||
setInactive(containers);
|
||||
}
|
||||
|
||||
private void setInactive(List<View> views) {
|
||||
Stream.of(views).forEach(c -> c.setBackgroundResource(R.drawable.labeled_edit_text_background_inactive));
|
||||
}
|
||||
|
||||
private void setActive(@NonNull View container) {
|
||||
container.setBackgroundResource(R.drawable.labeled_edit_text_background_active);
|
||||
}
|
||||
|
||||
public interface OnCodeEnteredListener {
|
||||
|
@ -6,6 +6,18 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.TextUtils;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebResourceResponse;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
|
@ -0,0 +1,57 @@
|
||||
package org.thoughtcrime.securesms.registration;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.BaseActionBarActivity;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.util.CommunicationActions;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
public class WelcomeActivity extends BaseActionBarActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.registration_welcome_activity);
|
||||
findViewById(R.id.welcome_terms_button).setOnClickListener(v -> onTermsClicked());
|
||||
findViewById(R.id.welcome_continue_button).setOnClickListener(v -> onContinueClicked());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
private void onTermsClicked() {
|
||||
CommunicationActions.openBrowserLink(this, "https://signal.org/legal");
|
||||
}
|
||||
|
||||
private void onContinueClicked() {
|
||||
Permissions.with(this)
|
||||
.request(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_PHONE_STATE)
|
||||
.ifNecessary()
|
||||
.withRationaleDialog(getString(R.string.RegistrationActivity_signal_needs_access_to_your_contacts_and_media_in_order_to_connect_with_friends),
|
||||
R.drawable.ic_contacts_white_48dp, R.drawable.ic_folder_white_48dp)
|
||||
.onAnyResult(() -> {
|
||||
TextSecurePreferences.setHasSeenWelcomeScreen(WelcomeActivity.this, true);
|
||||
|
||||
Intent nextIntent = getIntent().getParcelableExtra("next_intent");
|
||||
|
||||
if (nextIntent == null) {
|
||||
throw new IllegalStateException("Was not supplied a next_intent.");
|
||||
}
|
||||
|
||||
startActivity(nextIntent);
|
||||
overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
|
||||
finish();
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
public class DynamicRegistrationTheme extends DynamicTheme {
|
||||
@Override
|
||||
protected int getSelectedTheme(Activity activity) {
|
||||
String theme = TextSecurePreferences.getTheme(activity);
|
||||
|
||||
if (theme.equals("dark")) return R.style.TextSecure_DarkRegistrationTheme;
|
||||
|
||||
return R.style.TextSecure_LightRegistrationTheme;
|
||||
}
|
||||
}
|
@ -74,6 +74,7 @@ public class TextSecurePreferences {
|
||||
private static final String VERIFYING_STATE_PREF = "pref_verifying";
|
||||
public static final String REGISTERED_GCM_PREF = "pref_gcm_registered";
|
||||
private static final String GCM_PASSWORD_PREF = "pref_gcm_password";
|
||||
private static final String SEEN_WELCOME_SCREEN_PREF = "pref_seen_welcome_screen";
|
||||
private static final String PROMPTED_PUSH_REGISTRATION_PREF = "pref_prompted_push_registration";
|
||||
private static final String PROMPTED_DEFAULT_SMS_PREF = "pref_prompted_default_sms";
|
||||
private static final String PROMPTED_OPTIMIZE_DOZE_PREF = "pref_prompted_optimize_doze";
|
||||
@ -842,6 +843,14 @@ public class TextSecurePreferences {
|
||||
return getBooleanPreference(context, SMS_DELIVERY_REPORT_PREF, false);
|
||||
}
|
||||
|
||||
public static boolean hasSeenWelcomeScreen(Context context) {
|
||||
return getBooleanPreference(context, SEEN_WELCOME_SCREEN_PREF, true);
|
||||
}
|
||||
|
||||
public static void setHasSeenWelcomeScreen(Context context, boolean value) {
|
||||
setBooleanPreference(context, SEEN_WELCOME_SCREEN_PREF, value);
|
||||
}
|
||||
|
||||
public static boolean hasPromptedPushRegistration(Context context) {
|
||||
return getBooleanPreference(context, PROMPTED_PUSH_REGISTRATION_PREF, false);
|
||||
}
|
||||
|