Add conversation media photo rail to recipient preferences

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-09-20 18:14:28 -07:00
parent a1c276f70b
commit 4828a8a274
14 changed files with 375 additions and 108 deletions

View File

@@ -4,6 +4,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="@color/transparent"
xmlns:tools="http://schemas.android.com/tools">
@@ -58,14 +60,39 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:descendantFocusability="blocksDescendants"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<FrameLayout android:id="@+id/preference_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/rail_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:text="Shared media"
android:visibility="gone"
android:textColor="?attr/colorPrimary"/>
<org.thoughtcrime.securesms.components.ThreadPhotoRailView
android:id="@+id/recent_photos"
android:layout_width="match_parent"
android:layout_height="90dp"
android:visibility="visible"
android:layout_marginBottom="16dp"/>
<include layout="@layout/preference_divider"/>
<FrameLayout android:id="@+id/preference_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.v7.widget.RecyclerView
android:id="@+id/photo_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingStart="16dp"
android:clipToPadding="false"
android:nestedScrollingEnabled="true"
android:scrollbars="none"/>
</merge>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.components.SquareFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="2dp"
app:square_height="true">
<org.thoughtcrime.securesms.components.ThumbnailView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
</org.thoughtcrime.securesms.components.SquareFrameLayout>

View File

@@ -998,6 +998,8 @@
<string name="recipient_preferences__color">Color</string>
<string name="recipient_preferences__color_for_this_contact">Color for this contact</string>
<string name="recipient_preferences__view_safety_number">View safety number</string>
<string name="recipient_preferences__chat_settings">Chat settings</string>
<string name="recipient_preferences__privacy">Privacy</string>
<!--- redphone_call_controls -->
<string name="redphone_call_card__signal_call">Signal Call</string>

View File

@@ -2,48 +2,55 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_recipient_mute"
android:title="@string/recipient_preferences__mute_conversation"
android:defaultValue="false"
android:disableDependentsState="true"
android:persistent="false" />
<PreferenceCategory android:key="notification_settings" android:title="@string/recipient_preferences__chat_settings">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_recipient_mute"
android:title="@string/recipient_preferences__mute_conversation"
android:defaultValue="false"
android:disableDependentsState="true"
android:persistent="false" />
<org.thoughtcrime.securesms.preferences.SignalRingtonePreference
android:dependency="pref_key_recipient_mute"
android:key="pref_key_recipient_ringtone"
android:title="@string/recipient_preferences__notification_sound"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
android:persistent="false"/>
<org.thoughtcrime.securesms.preferences.SignalRingtonePreference
android:dependency="pref_key_recipient_mute"
android:key="pref_key_recipient_ringtone"
android:title="@string/recipient_preferences__notification_sound"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
android:persistent="false"/>
<org.thoughtcrime.securesms.preferences.SignalListPreference
android:dependency="pref_key_recipient_mute"
android:key="pref_key_recipient_vibrate"
android:title="@string/recipient_preferences__vibrate"
android:entries="@array/recipient_vibrate_entries"
android:entryValues="@array/recipient_vibrate_values"
android:defaultValue="0"
android:persistent="false"/>
<org.thoughtcrime.securesms.preferences.ColorPreference
android:key="pref_key_recipient_color"
android:title="@string/recipient_preferences__color"
android:defaultValue="@android:color/black"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:persistent="false"
app:numColumns="5" />
<Preference android:key="pref_key_recipient_identity"
android:title="@string/recipient_preferences__view_safety_number"
android:persistent="false"
android:enabled="false"/>
<Preference android:key="pref_key_recipient_block"
android:title="@string/recipient_preferences__block"
<org.thoughtcrime.securesms.preferences.SignalListPreference
android:dependency="pref_key_recipient_mute"
android:key="pref_key_recipient_vibrate"
android:title="@string/recipient_preferences__vibrate"
android:entries="@array/recipient_vibrate_entries"
android:entryValues="@array/recipient_vibrate_values"
android:defaultValue="0"
android:persistent="false"/>
<org.thoughtcrime.securesms.preferences.ColorPickerPreference
android:key="pref_key_recipient_color"
android:title="@string/recipient_preferences__color"
android:defaultValue="@android:color/black"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:persistent="false"
app:numColumns="5" />
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider"/>
<PreferenceCategory android:key="privacy_settings" android:title="@string/recipient_preferences__privacy">
<Preference android:key="pref_key_recipient_identity"
android:title="@string/recipient_preferences__view_safety_number"
android:persistent="false"
android:enabled="false"/>
<Preference android:key="pref_key_recipient_block"
android:title="@string/recipient_preferences__block"
android:persistent="false"/>
</PreferenceCategory>
</PreferenceScreen>