Device provisioning

Closes #4553
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2015-11-19 10:21:19 -08:00
parent 02c37e815c
commit 7c0bf0c871
38 changed files with 1047 additions and 246 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<org.thoughtcrime.securesms.components.camera.CameraView
android:id="@+id/scanner"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:camera="0"/>
<LinearLayout android:id="@+id/overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
<org.thoughtcrime.securesms.components.ShapeScrim
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:background="@color/gray5"
android:gravity="center">
<ImageView android:id="@+id/devices"
android:src="@drawable/ic_devices_white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="@color/gray27"
android:transitionName="devices"
android:layout_marginBottom="16dp"/>
<TextView android:text="@string/device_add_fragment__scan_the_qr_code_displayed_on_the_device_to_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_devices_white"
android:transitionName="devices"
android:tint="@color/gray27"
android:layout_marginBottom="25dp"
android:contentDescription="@string/device_link_fragment__link_device"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textStyle="bold"
android:text="@string/DeviceProvisioningActivity_link_this_device"
android:textSize="16sp"/>
<View android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#1E000000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="@string/DeviceProvisioningActivity_content_intro"
android:textSize="14sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="@string/DeviceProvisioningActivity_content_bullets"
android:textSize="14sp"/>
<View android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#1E000000"/>
<LinearLayout android:id="@+id/link_device"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:gravity="center_vertical"
android:clickable="true">
<ImageView android:id="@+id/check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:src="@drawable/ic_check_white_24dp"
android:tint="@color/blue_400"
android:clickable="false"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/blue_400"
android:text="@string/device_link_fragment__link_device"
android:clickable="false"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

View File

@@ -2,9 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="16dip"
android:paddingRight="16dip">
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<LinearLayout android:id="@+id/progress_container"
android:layout_width="fill_parent"
@@ -27,13 +27,32 @@
android:gravity="center|center_vertical"
android:textSize="20sp"
android:visibility="gone"
android:text="@string/device_list_fragment__no_devices_linked"/>
android:text="@string/device_list_fragment__no_devices_linked"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:layout_weight="1"
tools:visibility="visible"/>
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawSelectorOnTop="false"/>
android:drawSelectorOnTop="false"
android:paddingLeft="16dip"
android:paddingRight="16dip"
tools:visibility="gone"/>
<com.melnykov.fab.FloatingActionButton
android:id="@+id/add_device"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="16dp"
android:src="@drawable/ic_add_white_original_24dp"
android:focusable="true"
android:contentDescription="@string/device_list_fragment__link_new_device"
fab:fab_colorNormal="?fab_color"
fab:fab_colorPressed="@color/textsecure_primary_dark"
fab:fab_colorRipple="@color/textsecure_primary_dark" />
</LinearLayout>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<changeTransform />
<changeBounds />
</transitionSet>

View File

@@ -147,4 +147,13 @@
<attr name="circleColor" format="color"/>
</declare-styleable>
<declare-styleable name="ShapeScrim">
<attr name="shape" format="string"/>
<attr name="radius" format="float"/>
</declare-styleable>
<declare-styleable name="CameraView">
<attr name="camera" format="integer"/>
</declare-styleable>
</resources>

View File

@@ -345,12 +345,12 @@
<string name="DeviceProvisioningActivity_title">Link this device?</string>
<string name="DeviceProvisioningActivity_content_intro">It will be able to</string>
<string name="DeviceProvisioningActivity_content_bullets">
- Read all your messages
\n- Send messages in your name
Read all your messages
\n Send messages in your name
</string>
<string name="DeviceProvisioningActivity_content_progress_title">Linking device</string>
<string name="DeviceProvisioningActivity_content_progress_content">Linking new device...</string>
<string name="DeviceProvisioningActivity_content_progress_success">Device linked!</string>
<string name="DeviceProvisioningActivity_content_progress_success">Device approved!</string>
<string name="DeviceProvisioningActivity_content_progress_no_device">No device found.</string>
<string name="DeviceProvisioningActivity_content_progress_network_error">Network error.</string>
<string name="DeviceProvisioningActivity_content_progress_key_error">Invalid QR code.</string>
@@ -1128,6 +1128,9 @@
<!-- transport_selection_list_item -->
<string name="transport_selection_list_item__transport_icon">Transport icon</string>
<string name="device_add_fragment__scan_the_qr_code_displayed_on_the_device_to_link">Scan the QR code displayed on the device to link</string>
<string name="device_link_fragment__link_device">Link device</string>
<string name="device_list_fragment__link_new_device">Link new device</string>
<!-- EOF -->

View File

@@ -188,7 +188,7 @@
<item name="pref_ic_app_protection">@drawable/ic_app_protection_black</item>
<item name="pref_ic_appearance">@drawable/ic_brightness_6_black</item>
<item name="pref_ic_chats">@drawable/ic_forum_black_32dp</item>
<item name="pref_ic_devices">@drawable/ic_devices_black_48dp</item>
<item name="pref_ic_devices">@drawable/ic_laptop_black_32dp</item>
<item name="pref_ic_advanced">@drawable/ic_advanced_black</item>
<item name="app_protect_timeout_picker_color">@style/BetterPickersDialogFragment.Light</item>
@@ -301,7 +301,7 @@
<item name="pref_ic_app_protection">@drawable/ic_app_protection_gray</item>
<item name="pref_ic_appearance">@drawable/ic_brightness_6_gray</item>
<item name="pref_ic_chats">@drawable/ic_forum_grey_32dp</item>
<item name="pref_ic_devices">@drawable/ic_devices_grey600_48dp</item>
<item name="pref_ic_devices">@drawable/ic_laptop_light_32dp</item>
<item name="pref_ic_advanced">@drawable/ic_advanced_gray</item>
<item name="app_protect_timeout_picker_color">@style/BetterPickersDialogFragment</item>

View File

@@ -21,11 +21,9 @@
android:title="@string/preferences__chats"
android:icon="?pref_ic_chats"/>
<!--<Preference android:key="preference_category_devices"-->
<!--android:title="Devices"-->
<!--android:icon="?pref_ic_devices">-->
<!--</Preference>-->
<Preference android:key="preference_category_devices"
android:title="Devices"
android:icon="?pref_ic_devices"/>
<Preference android:key="preference_category_advanced"
android:title="@string/preferences__advanced"