mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-27 00:57:42 +00:00
Add support for typing indicators.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:scrollbars="vertical"
|
||||
android:cacheColorHint="?conversation_background"
|
||||
android:clipChildren="false"
|
||||
|
@@ -36,8 +36,8 @@
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/contact_photo"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_width="@dimen/conversation_item_avatar_size"
|
||||
android:layout_height="@dimen/conversation_item_avatar_size"
|
||||
android:cropToPadding="true"
|
||||
android:contentDescription="@string/conversation_item_received__contact_photo_description" />
|
||||
|
||||
|
@@ -88,21 +88,36 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/subject"
|
||||
android:layout_width="match_parent"
|
||||
<FrameLayout
|
||||
android:id="@+id/subject_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="1dp"
|
||||
android:layout_below="@id/from"
|
||||
android:layout_toRightOf="@id/indicators_parent"
|
||||
android:layout_toEndOf="@id/indicators_parent"
|
||||
android:layout_toLeftOf="@+id/status"
|
||||
android:layout_toStartOf="@+id/status">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/subject"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:textColor="?attr/conversation_list_item_subject_color"
|
||||
android:maxLines="1"
|
||||
tools:text="Wheels arrive at 3pm flat. This is a somewhat longer message."
|
||||
android:ellipsize="end" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.TypingIndicatorView
|
||||
android:id="@+id/typing_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/from"
|
||||
android:layout_toRightOf="@id/indicators_parent"
|
||||
android:layout_toEndOf="@id/indicators_parent"
|
||||
android:layout_toLeftOf="@+id/status"
|
||||
android:layout_toStartOf="@+id/status"
|
||||
android:paddingRight="1dp"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:textColor="?attr/conversation_list_item_subject_color"
|
||||
android:maxLines="1"
|
||||
tools:text="Wheels arrive at 3pm flat. This is a somewhat longer message."
|
||||
android:ellipsize="end" />
|
||||
android:layout_marginTop="4dp"
|
||||
android:visibility="gone"
|
||||
app:typingIndicator_tint="?conversation_list_typing_tint"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.ThumbnailView
|
||||
android:id="@+id/thumbnail"
|
||||
|
36
res/layout/conversation_typing_view.xml
Normal file
36
res/layout/conversation_typing_view.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.ConversationTypingView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/typing_avatar"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_width="@dimen/conversation_item_avatar_size"
|
||||
android:layout_height="@dimen/conversation_item_avatar_size"
|
||||
android:cropToPadding="true"
|
||||
android:contentDescription="@string/conversation_item_received__contact_photo_description" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/typing_bubble"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:padding="12dp"
|
||||
android:background="@drawable/message_bubble_background">
|
||||
|
||||
<org.thoughtcrime.securesms.components.TypingIndicatorView
|
||||
android:id="@+id/typing_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</org.thoughtcrime.securesms.components.ConversationTypingView>
|
77
res/layout/experience_upgrade_typing_indicators_fragment.xml
Normal file
77
res/layout/experience_upgrade_typing_indicators_fragment.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:background="#FF2090ea">
|
||||
|
||||
<TextView android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:id="@+id/blurb"
|
||||
android:textSize="@dimen/onboarding_title_size"
|
||||
android:textIsSelectable="false"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="@string/ExperienceUpgradeActivity_introducing_typing_indicators"
|
||||
android:layout_marginTop="20dp"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<FrameLayout android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<ImageView android:layout_width="170dp"
|
||||
android:layout_height="170dp"
|
||||
android:src="@drawable/circle_tintable"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/message_bubble_background"
|
||||
android:tint="@color/signal_primary"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.TypingIndicatorView
|
||||
android:id="@+id/typing_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleX="2.5"
|
||||
android:scaleY="2.5"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/subblurb"
|
||||
android:textSize="@dimen/onboarding_subtitle_size"
|
||||
android:textIsSelectable="false"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="@string/ExperienceUpgradeActivity_now_you_can_optionally_see_and_share_when_messages_are_being_typed"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/preference"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:enabled="true"
|
||||
android:checked="true"
|
||||
android:text="@string/ExperienceUpgradeActivity_enable_typing_indicators"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@android:color/white"
|
||||
app:theme="@style/Color1SwitchStyle"/>
|
||||
|
||||
</LinearLayout>
|
40
res/layout/typing_indicator_view.xml
Normal file
40
res/layout/typing_indicator_view.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="org.thoughtcrime.securesms.components.TypingIndicatorView">
|
||||
|
||||
<View
|
||||
android:id="@+id/typing_dot1"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_margin="2dp"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
android:alpha="0.5"
|
||||
android:background="@drawable/circle_white" />
|
||||
|
||||
<View
|
||||
android:id="@+id/typing_dot2"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_margin="2dp"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
android:alpha="0.5"
|
||||
android:background="@drawable/circle_white" />
|
||||
|
||||
<View
|
||||
android:id="@+id/typing_dot3"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_margin="2dp"
|
||||
android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
android:alpha="0.5"
|
||||
android:background="@drawable/circle_white" />
|
||||
|
||||
</merge>
|
@@ -15,6 +15,7 @@
|
||||
<attr name="conversation_list_item_unread_background" format="reference"/>
|
||||
<attr name="conversation_list_item_divider" format="reference"/>
|
||||
<attr name="conversation_list_toolbar_background" format="reference"/>
|
||||
<attr name="conversation_list_typing_tint" format="color"/>
|
||||
|
||||
<attr name="conversation_sent_card_background" format="reference|color"/>
|
||||
<attr name="conversation_group_member_name" format="reference|color"/>
|
||||
@@ -295,4 +296,8 @@
|
||||
<attr name="conversationThumbnail_maxHeight" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TypingIndicatorView">
|
||||
<attr name="typingIndicator_tint" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
@@ -42,6 +42,8 @@
|
||||
<dimen name="conversation_vertical_message_spacing_default">8dp</dimen>
|
||||
<dimen name="conversation_vertical_message_spacing_collapse">1dp</dimen>
|
||||
|
||||
<dimen name="conversation_item_avatar_size">36dp</dimen>
|
||||
|
||||
<dimen name="quote_corner_radius_large">10dp</dimen>
|
||||
<dimen name="quote_corner_radius_bottom">4dp</dimen>
|
||||
<dimen name="quote_corner_radius_preview">18dp</dimen>
|
||||
|
@@ -314,6 +314,11 @@
|
||||
<string name="ExperienceUpgradeActivity_now_you_can_share_a_profile_photo_and_name_with_friends_on_signal">Now you can share a profile photo and name with friends on Signal</string>
|
||||
<string name="ExperienceUpgradeActivity_signal_profiles_are_here">Signal profiles are here</string>
|
||||
|
||||
<string name="ExperienceUpgradeActivity_introducing_typing_indicators">Introducing typing indicators.</string>
|
||||
<string name="ExperienceUpgradeActivity_now_you_can_optionally_see_and_share_when_messages_are_being_typed">Now you can optionally see and share when messages are being typed</string>
|
||||
<string name="ExperienceUpgradeActivity_typing_ui_title">Typing indicators are here</string>
|
||||
<string name="ExperienceUpgradeActivity_enable_typing_indicators">Enable typing indicators</string>
|
||||
|
||||
<!-- GcmBroadcastReceiver -->
|
||||
<string name="GcmBroadcastReceiver_retrieving_a_message">Retrieving a message...</string>
|
||||
|
||||
@@ -1182,6 +1187,8 @@
|
||||
<string name="preferences__incognito_keyboard">Incognito keyboard</string>
|
||||
<string name="preferences__read_receipts">Read receipts</string>
|
||||
<string name="preferences__if_read_receipts_are_disabled_you_wont_be_able_to_see_read_receipts">If read receipts are disabled, you won\'t be able to see read receipts from others.</string>
|
||||
<string name="preferences__typing_indicators">Typing indicators</string>
|
||||
<string name="preferences__if_typing_indicators_are_disabled_you_wont_be_able_to_see_typing_indicators">If typing indicators are disabled, you won\'t be able to see typing indicators from others.</string>
|
||||
<string name="preferences__request_keyboard_to_disable_personalized_learning">Request keyboard to disable personalized learning</string>
|
||||
<string name="preferences_app_protection__blocked_contacts">Blocked contacts</string>
|
||||
<string name="preferences_chats__when_using_mobile_data">When using mobile data</string>
|
||||
|
@@ -140,6 +140,7 @@
|
||||
<item name="conversation_list_item_unread_background">@drawable/unread_count_background_light</item>
|
||||
<item name="conversation_list_item_divider">@drawable/conversation_list_divider_shape</item>
|
||||
<item name="conversation_list_toolbar_background">@color/core_blue</item>
|
||||
<item name="conversation_list_typing_tint">@color/core_grey_60</item>
|
||||
|
||||
<item name="fab_color">@color/textsecure_primary</item>
|
||||
<item name="lower_right_divet">@drawable/divet_lower_right_dark</item>
|
||||
@@ -290,6 +291,7 @@
|
||||
<item name="conversation_list_item_unread_background">@drawable/unread_count_background_dark</item>
|
||||
<item name="conversation_list_item_divider">@drawable/conversation_list_divider_shape_dark</item>
|
||||
<item name="conversation_list_toolbar_background">@color/core_grey_90</item>
|
||||
<item name="conversation_list_typing_tint">@color/core_white</item>
|
||||
|
||||
<item name="conversation_group_member_name">#99ffffff</item>
|
||||
|
||||
|
@@ -63,6 +63,12 @@
|
||||
android:title="@string/preferences__read_receipts"
|
||||
android:summary="@string/preferences__if_read_receipts_are_disabled_you_wont_be_able_to_see_read_receipts"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="pref_typing_indicators"
|
||||
android:title="@string/preferences__typing_indicators"
|
||||
android:summary="@string/preferences__if_typing_indicators_are_disabled_you_wont_be_able_to_see_typing_indicators"/>
|
||||
|
||||
<Preference android:key="preference_category_blocked"
|
||||
android:title="@string/preferences_app_protection__blocked_contacts" />
|
||||
</PreferenceCategory>
|
||||
|
Reference in New Issue
Block a user