mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-23 01:56:30 +00:00
Implement camera-first capture flow.
This allows you to take a photo, then choose the recipients after. This also makes it so we only upload the attachment once.
This commit is contained in:
36
res/layout/camera_contact_contact_item.xml
Normal file
36
res/layout/camera_contact_contact_item.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/camera_contacts_horizontal_margin"
|
||||
android:paddingEnd="@dimen/camera_contacts_horizontal_margin"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="?selectableItemBackground">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/camera_contact_item_avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.FromTextView
|
||||
android:id="@+id/camera_contact_item_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
style="@style/Signal.Text.Body"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/camera_contact_item_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:clickable="false"/>
|
||||
|
||||
</LinearLayout>
|
||||
14
res/layout/camera_contact_header_item.xml
Normal file
14
res/layout/camera_contact_header_item.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/camera_contact_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/camera_contacts_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/camera_contacts_horizontal_margin"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
tools:text="@string/CameraContacts_recent_contacts"/>
|
||||
28
res/layout/camera_contact_invite_item.xml
Normal file
28
res/layout/camera_contact_invite_item.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/camera_contacts_horizontal_margin"
|
||||
android:paddingEnd="@dimen/camera_contacts_horizontal_margin"
|
||||
android:paddingTop="30dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:background="?selectableItemBackground">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:text="@string/CameraContacts_cant_find_who_youre_looking_for"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/camera_contact_invite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
style="@style/Button.Borderless"
|
||||
android:text="@string/CameraContacts_invite_a_contact_to_join_signal" />
|
||||
|
||||
</LinearLayout>
|
||||
123
res/layout/camera_contact_selection_fragment.xml
Normal file
123
res/layout/camera_contact_selection_fragment.xml
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true"
|
||||
android:background="?android:windowBackground">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/camera_contacts_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/conversation_list_toolbar_background"
|
||||
android:elevation="8dp"
|
||||
android:theme="?actionBarStyle"
|
||||
app:title="@string/CameraContacts_select_signal_recipients"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/camera_contacts_empty"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/camera_contacts_toolbar">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/no_contacts"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:text="@string/CameraContacts_no_signal_contacts"
|
||||
android:fontFamily="sans-serif-medium"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_horizontal"
|
||||
style="@style/Signal.Text.Body"
|
||||
android:text="@string/CameraContacts_you_can_only_use_the_camera_button"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/camera_contacts_invite_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_gravity="center"
|
||||
style="@style/Button.Borderless"
|
||||
android:text="@string/CameraContacts_invite_a_contact_to_join_signal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/camera_contacts_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/camera_contacts_footer_barrier"
|
||||
app:layout_constraintTop_toBottomOf="@id/camera_contacts_toolbar" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/compose_divider_background"
|
||||
app:layout_constraintBottom_toTopOf="@id/camera_contacts_footer_barrier" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/camera_contacts_footer_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="top"
|
||||
app:constraint_referenced_ids="camera_contacts_selected_list,camera_contacts_send_button" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/camera_contacts_selected_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingTop="22dp"
|
||||
android:paddingBottom="22dp"
|
||||
android:paddingStart="16dp"
|
||||
android:clipToPadding="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/camera_contacts_send_button"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/camera_contacts_send_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:src="@drawable/ic_send_push_white_24dp"
|
||||
android:background="@drawable/camera_send_button_background"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/camera_contacts_selected_list"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/camera_contacts_selected_list" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/camera_contacts_footer_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="camera_contacts_send_button,camera_contacts_selected_list,view" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
7
res/layout/camera_contact_selection_item.xml
Normal file
7
res/layout/camera_contact_selection_item.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.FromTextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="5sp"
|
||||
style="@style/Signal.Text.Preview"/>
|
||||
@@ -35,6 +35,7 @@
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginBottom="42dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toTopOf="@id/camera_capture_button"
|
||||
app:layout_constraintStart_toStartOf="@id/camera_capture_button"
|
||||
app:layout_constraintEnd_toEndOf="@id/camera_capture_button"
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintTop_toTopOf="@id/camera_capture_button"
|
||||
app:layout_constraintBottom_toBottomOf="@id/camera_capture_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -66,6 +66,17 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/camera_fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="82dp"
|
||||
android:src="@drawable/ic_camera_alt_white_24dp"
|
||||
android:tint="@color/core_grey_60"
|
||||
android:focusable="true"
|
||||
app:backgroundTint="@color/core_white"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.registration.PulsingFloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
||||
@@ -133,6 +133,19 @@
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mediasend_continue_button"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:padding="6dp"
|
||||
android:background="@drawable/media_continue_button_background"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@drawable/ic_continue_24"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
|
||||
Reference in New Issue
Block a user