This commit is contained in:
Niels Andriesse 2020-01-15 16:13:28 +11:00
parent bfb6435d72
commit 8aa214bd7d
29 changed files with 169 additions and 93 deletions

View File

@ -307,7 +307,8 @@
<activity <activity
android:name="org.thoughtcrime.securesms.MessageDetailsActivity" android:name="org.thoughtcrime.securesms.MessageDetailsActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:label="@string/AndroidManifest__message_details" android:label="Message Details"
android:theme="@style/Session.DarkTheme"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden" /> android:windowSoftInputMode="stateHidden" />
<activity <activity
@ -414,13 +415,14 @@
android:name="org.thoughtcrime.securesms.MediaPreviewActivity" android:name="org.thoughtcrime.securesms.MediaPreviewActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:label="@string/AndroidManifest__media_preview" android:label="@string/AndroidManifest__media_preview"
android:theme="@style/Session.DarkTheme.SubtitleActionBar"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden" /> android:windowSoftInputMode="stateHidden" />
<activity <activity
android:name="org.thoughtcrime.securesms.MediaOverviewActivity" android:name="org.thoughtcrime.securesms.MediaOverviewActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:launchMode="singleTask" android:launchMode="singleTask"
android:theme="@style/TextSecure.LightNoActionBar" android:theme="@style/Session.DarkTheme.NoActionBar"
android:windowSoftInputMode="stateHidden" /> android:windowSoftInputMode="stateHidden" />
<activity <activity
android:name="org.thoughtcrime.securesms.DummyActivity" android:name="org.thoughtcrime.securesms.DummyActivity"

View File

@ -12,20 +12,17 @@
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="8dp"> android:paddingEnd="8dp">
<org.thoughtcrime.securesms.components.AvatarImageView <org.thoughtcrime.securesms.loki.redesign.views.ProfilePictureView
android:id="@+id/contact_photo_image" android:id="@+id/profilePictureView"
android:layout_width="40dp" android:layout_width="@dimen/medium_profile_picture_size"
android:layout_height="40dp" android:layout_height="@dimen/medium_profile_picture_size" />
android:foreground="@drawable/contact_photo_background"
android:cropToPadding="true"
tools:src="@color/blue_600"
android:contentDescription="@string/SingleContactSelectionActivity_contact_photo" />
<LinearLayout android:layout_width="0dp" <LinearLayout android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView <org.thoughtcrime.securesms.components.emoji.EmojiTextView
@ -35,14 +32,16 @@
android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:singleLine="true" android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="@dimen/medium_font_size"
android:textSize="16sp" android:textColor="@color/text"
android:textStyle="bold"
tools:text="Frieeeeeeedrich Nieeeeeeeeeetzsche" /> tools:text="Frieeeeeeedrich Nieeeeeeeeeetzsche" />
<LinearLayout android:id="@+id/number_container" <LinearLayout android:id="@+id/number_container"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:visibility="gone">
<TextView android:id="@+id/number" <TextView android:id="@+id/number"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -6,7 +6,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="24dp" android:paddingTop="24dp"
android:paddingBottom="20dp"> android:paddingBottom="18dp">
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -18,7 +18,6 @@
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/conversation_individual_right_gutter"
android:paddingStart="@dimen/large_spacing" android:paddingStart="@dimen/large_spacing"
android:clipToPadding="false" android:clipToPadding="false"
android:clipChildren="false"> android:clipChildren="false">
@ -58,7 +57,7 @@
android:id="@+id/body_bubble" android:id="@+id/body_bubble"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/message_bubble_edge_margin" android:layout_marginEnd="@dimen/massive_spacing"
android:layout_marginStart="@dimen/large_spacing" android:layout_marginStart="@dimen/large_spacing"
android:paddingTop="@dimen/medium_spacing" android:paddingTop="@dimen/medium_spacing"
android:paddingBottom="@dimen/medium_spacing" android:paddingBottom="@dimen/medium_spacing"
@ -163,7 +162,7 @@
android:layout="@layout/conversation_item_received_document" android:layout="@layout/conversation_item_received_document"
android:layout_width="210dp" android:layout_width="210dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/medium_spacing" android:layout_marginBottom="4dp"
android:layout_marginStart="@dimen/message_bubble_horizontal_padding" android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" /> android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />

View File

@ -36,7 +36,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:layout_marginStart="@dimen/message_bubble_edge_margin" android:layout_marginStart="@dimen/massive_spacing"
android:paddingTop="@dimen/medium_spacing" android:paddingTop="@dimen/medium_spacing"
android:paddingBottom="@dimen/medium_spacing" android:paddingBottom="@dimen/medium_spacing"
android:layout_gravity="end" android:layout_gravity="end"
@ -99,7 +99,7 @@
android:layout_width="210dp" android:layout_width="210dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/message_bubble_horizontal_padding" android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
android:layout_marginBottom="@dimen/medium_spacing" android:layout_marginBottom="4dp"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" /> android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
<org.thoughtcrime.securesms.components.emoji.EmojiTextView <org.thoughtcrime.securesms.components.emoji.EmojiTextView

View File

@ -4,9 +4,9 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="8dp" android:paddingStart="@dimen/large_spacing"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingTop="2dp" android:paddingBottom="@dimen/small_spacing"
android:gravity="center_vertical"> android:gravity="center_vertical">
<org.thoughtcrime.securesms.components.AvatarImageView <org.thoughtcrime.securesms.components.AvatarImageView
@ -21,7 +21,6 @@
android:id="@+id/typing_bubble" android:id="@+id/typing_bubble"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:padding="12dp" android:padding="12dp"
android:background="@drawable/message_bubble_background"> android:background="@drawable/message_bubble_background">

View File

@ -82,7 +82,7 @@
<LinearLayout android:layout_width="match_parent" <LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="2dp" android:layout_marginStart="6dp"
android:orientation="vertical" android:orientation="vertical"
android:focusable="false" android:focusable="false"
android:clickable="false"> android:clickable="false">
@ -91,6 +91,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/Signal.Text.Body" style="@style/Signal.Text.Body"
android:textSize="@dimen/medium_font_size"
android:singleLine="true" android:singleLine="true"
android:maxLines="1" android:maxLines="1"
android:clickable="false" android:clickable="false"

View File

@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@drawable/default_session_background"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
@ -14,8 +15,7 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize" android:layout_height="?android:attr/actionBarSize"
android:background="?attr/media_overview_toolbar_background" style="@style/Session.DarkActionBar"
android:titleTextColor="?attr/media_overview_toolbar_foreground"
app:layout_scrollFlags="scroll|enterAlways"/> app:layout_scrollFlags="scroll|enterAlways"/>
<org.thoughtcrime.securesms.components.ControllableTabLayout <org.thoughtcrime.securesms.components.ControllableTabLayout
@ -23,6 +23,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
style="@style/Session.DarkTabLayout"
android:background="?attr/media_overview_toolbar_background" android:background="?attr/media_overview_toolbar_background"
app:tabBackground="?attr/media_overview_toolbar_background" app:tabBackground="?attr/media_overview_toolbar_background"
app:tabIndicatorColor="@color/textsecure_primary" app:tabIndicatorColor="@color/textsecure_primary"

View File

@ -11,8 +11,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical" android:layout_gravity="start|center_vertical"
android:textColor="?attr/media_overview_header_foreground" android:textColor="?attr/media_overview_header_foreground"
android:textSize="14sp" android:textSize="@dimen/small_font_size"
android:textStyle="bold"
android:textAllCaps="true"
tools:text="March 1, 2015" /> tools:text="March 1, 2015" />
</FrameLayout> </FrameLayout>

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/media_overview_toolbar_background"> android:background="@drawable/default_session_background">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/media_overview_toolbar_background"> android:background="@drawable/default_session_background">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/media_grid" android:id="@+id/media_grid"

View File

@ -11,8 +11,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical" android:layout_gravity="start|center_vertical"
android:textColor="?attr/media_overview_header_foreground" android:textColor="?attr/media_overview_header_foreground"
android:textSize="14sp" android:textSize="@dimen/small_font_size"
android:textStyle="bold"
android:textAllCaps="true"
tools:text="March 1, 2015" /> tools:text="March 1, 2015" />
</FrameLayout> </FrameLayout>

View File

@ -6,7 +6,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray95"> android:background="@drawable/default_session_background">
<org.thoughtcrime.securesms.components.viewpager.HackyViewPager <org.thoughtcrime.securesms.components.viewpager.HackyViewPager
android:id="@+id/media_pager" android:id="@+id/media_pager"

View File

@ -4,5 +4,7 @@
android:layout_width="@dimen/media_bubble_remove_button_size" android:layout_width="@dimen/media_bubble_remove_button_size"
android:layout_height="@dimen/media_bubble_remove_button_size" android:layout_height="@dimen/media_bubble_remove_button_size"
android:layout_gravity="top|end" android:layout_gravity="top|end"
android:src="@drawable/conversation_attachment_close_circle" android:background="@drawable/circle_alpha"
android:src="@drawable/ic_close_white_18dp"
android:tint="#99FFFFFF"
android:visibility="gone"/> android:visibility="gone"/>

View File

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container" android:id="@+id/container"
android:background="@drawable/default_session_background"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View File

@ -3,22 +3,23 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:orientation="vertical"
android:background="@drawable/default_session_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<FrameLayout android:id="@+id/item_container" <FrameLayout android:id="@+id/item_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="15dp" android:paddingTop="@dimen/medium_spacing"
android:paddingBottom="15dp" android:paddingBottom="@dimen/medium_spacing"
android:elevation="2dp" /> android:elevation="10dp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingStart="10dp" android:paddingStart="@dimen/medium_spacing"
android:paddingEnd="10dp"> android:paddingEnd="@dimen/medium_spacing">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -30,10 +31,10 @@
android:layout_weight="1" android:layout_weight="1"
android:visibility="gone" android:visibility="gone"
android:textSize="16sp" android:textSize="16sp"
android:padding="5dp" android:drawablePadding="12dp"
tools:visibility="visible" tools:visibility="visible"
android:text="@string/message_details_header__issues_need_your_attention" android:text="@string/message_details_header__issues_need_your_attention"
android:drawableStart="@drawable/ic_info_outline_light" android:drawableStart="@drawable/ic_error"
android:gravity="center_vertical" /> android:gravity="center_vertical" />
<Button <Button

View File

@ -10,10 +10,6 @@
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/search_toolbar_background"/> android:background="@color/action_bar_background"/>
<View android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@drawable/search_toolbar_shadow"/>
</merge> </merge>

View File

@ -5,7 +5,8 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@drawable/default_session_background">
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
@ -13,9 +14,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="@color/action_bar_background"
android:elevation="4dp" android:elevation="0dp"
android:theme="?attr/actionBarStyle"> android:theme="@style/Session.DarkActionBar">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -23,9 +24,10 @@
<TextView android:layout_width="wrap_content" <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/ShareActivity_share_with" android:text="Share"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" android:fontFamily="sans-serif-medium"
android:textSize="@dimen/very_large_font_size"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toStartOf="@+id/search_action"/> android:layout_toStartOf="@+id/search_action"/>
@ -34,6 +36,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_search_white_24dp" android:src="@drawable/ic_search_white_24dp"
android:visibility="gone"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/> android:layout_centerVertical="true"/>

View File

@ -33,8 +33,8 @@
<color name="loki_darkest_gray">#0a0a0a</color> <color name="loki_darkest_gray">#0a0a0a</color>
<!-- Loki --> <!-- Loki -->
<color name="signal_primary">@color/loki_green</color> <color name="signal_primary">@color/accent</color>
<color name="signal_primary_dark">@color/loki_green</color> <color name="signal_primary_dark">@color/accent</color>
<color name="signal_primary_alpha33">#5578be20</color> <color name="signal_primary_alpha33">#5578be20</color>
<color name="signal_primary_alpha_focus">#882090ea</color> <color name="signal_primary_alpha_focus">#882090ea</color>

View File

@ -11,11 +11,35 @@
<item name="android:elevation">0dp</item> <item name="android:elevation">0dp</item>
</style> </style>
<style name="Session.DarkSubtitleActionBar" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@color/action_bar_background</item>
<item name="android:background">@color/action_bar_background</item>
<item name="titleTextStyle">@style/Session.DarkSubtitleActionBar.TitleTextStyle</item>
<item name="android:titleTextStyle">@style/Session.DarkSubtitleActionBar.TitleTextStyle</item>
<item name="subtitleTextStyle">@style/Session.DarkSubtitleActionBar.SubtitleTextStyle</item>
<item name="android:subtitleTextStyle">@style/Session.DarkSubtitleActionBar.SubtitleTextStyle</item>
<item name="elevation">0dp</item>
<item name="android:elevation">0dp</item>
</style>
<style name="Session.DarkActionBar.TitleTextStyle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title"> <style name="Session.DarkActionBar.TitleTextStyle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/text</item> <item name="android:textColor">@color/text</item>
<item name="android:textSize">@dimen/very_large_font_size</item> <item name="android:textSize">@dimen/very_large_font_size</item>
</style> </style>
<style name="Session.DarkSubtitleActionBar.TitleTextStyle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/text</item>
<item name="android:textSize">@dimen/large_font_size</item>
<item name="android:fontFamily">sans-serif-medium</item>
</style>
<style name="Session.DarkSubtitleActionBar.SubtitleTextStyle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/text</item>
<item name="android:textSize">@dimen/small_font_size</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">normal</item>
</style>
<style name="Session.AlertDialog" parent="ThemeOverlay.AppCompat.Dialog.Alert"> <style name="Session.AlertDialog" parent="ThemeOverlay.AppCompat.Dialog.Alert">
<item name="buttonBarNegativeButtonStyle">@style/Session.AlertDialog.NegativeButtonStyle</item> <item name="buttonBarNegativeButtonStyle">@style/Session.AlertDialog.NegativeButtonStyle</item>
<item name="buttonBarPositiveButtonStyle">@style/Session.AlertDialog.PositiveButtonStyle</item> <item name="buttonBarPositiveButtonStyle">@style/Session.AlertDialog.PositiveButtonStyle</item>

View File

@ -24,6 +24,17 @@
<item name="preferenceTheme">@style/Session.SettingsTheme</item> <item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item> <item name="colorAccent">@color/accent</item>
</style> </style>
<style name="Session.DarkTheme.SubtitleActionBar" parent="@style/Theme.AppCompat">
<item name="actionBarStyle">@style/Session.DarkSubtitleActionBar</item>
<item name="colorPrimary">@color/action_bar_background</item>
<item name="colorPrimaryDark">@color/action_bar_background</item>
<item name="android:navigationBarColor">@color/navigation_bar_background</item>
<item name="alertDialogTheme">@style/Session.AlertDialog</item>
<item name="android:windowBackground">@drawable/default_session_background</item>
<item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item>
</style>
<!-- Session --> <!-- Session -->
<style name="TextSecure.LightNoActionBar" parent="@style/TextSecure.LightTheme"> <style name="TextSecure.LightNoActionBar" parent="@style/TextSecure.LightTheme">
@ -45,9 +56,9 @@
<item name="media_overview_toolbar_background">@color/white</item> <item name="media_overview_toolbar_background">@color/white</item>
<item name="media_overview_toolbar_foreground">@color/gray70</item> <item name="media_overview_toolbar_foreground">@color/gray70</item>
<item name="media_overview_header_foreground">@color/gray50</item> <item name="media_overview_header_foreground">@color/text</item>
<item name="media_overview_document_primary">@color/core_grey_90</item> <item name="media_overview_document_primary">@color/core_grey_90</item>
<item name="media_overview_document_secondary">@color/core_grey_60</item> <item name="media_overview_document_secondary">#99FFFFFF</item>
</style> </style>
<style name="TextSecure.DarkNoActionBar" parent="@style/TextSecure.BaseDarkNoActionBar"> <style name="TextSecure.DarkNoActionBar" parent="@style/TextSecure.BaseDarkNoActionBar">
@ -72,11 +83,11 @@
<item name="contact_selection_lay_user">#afeeeeee</item> <item name="contact_selection_lay_user">#afeeeeee</item>
<item name="contact_selection_header_text">#66eeeeee</item> <item name="contact_selection_header_text">#66eeeeee</item>
<item name="media_overview_toolbar_background">@color/black</item> <item name="media_overview_toolbar_background">@color/transparent</item>
<item name="media_overview_toolbar_foreground">@color/white</item> <item name="media_overview_toolbar_foreground">@color/white</item>
<item name="media_overview_header_foreground">@color/gray10</item> <item name="media_overview_header_foreground">@color/text</item>
<item name="media_overview_document_primary">@color/core_grey_05</item> <item name="media_overview_document_primary">@color/core_grey_05</item>
<item name="media_overview_document_secondary">@color/core_grey_25</item> <item name="media_overview_document_secondary">#99FFFFFF</item>
</style> </style>
<style name="TextSecure.HighlightTheme" parent="@style/TextSecure.LightTheme"> <style name="TextSecure.HighlightTheme" parent="@style/TextSecure.LightTheme">

View File

@ -104,6 +104,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
@Override @Override
protected void onCreate(Bundle bundle, boolean ready) { protected void onCreate(Bundle bundle, boolean ready) {
setContentView(R.layout.media_overview_activity); setContentView(R.layout.media_overview_activity);
getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_background));
initializeResources(); initializeResources();
initializeToolbar(); initializeToolbar();
@ -142,7 +143,6 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
private void initializeToolbar() { private void initializeToolbar() {
setSupportActionBar(this.toolbar); setSupportActionBar(this.toolbar);
getSupportActionBar().setTitle(recipient.toShortString()); getSupportActionBar().setTitle(recipient.toShortString());
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
this.recipient.addListener(recipient -> { this.recipient.addListener(recipient -> {
Util.runOnMain(() -> getSupportActionBar().setTitle(recipient.toShortString())); Util.runOnMain(() -> getSupportActionBar().setTitle(recipient.toShortString()));
}); });

View File

@ -47,7 +47,6 @@ import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -120,16 +119,10 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
@SuppressWarnings("ConstantConditions") @SuppressWarnings("ConstantConditions")
@Override @Override
protected void onCreate(Bundle bundle, boolean ready) { protected void onCreate(Bundle bundle, boolean ready) {
this.setTheme(R.style.TextSecure_DarkTheme);
dynamicLanguage.onCreate(this); dynamicLanguage.onCreate(this);
viewModel = ViewModelProviders.of(this).get(MediaPreviewViewModel.class); viewModel = ViewModelProviders.of(this).get(MediaPreviewViewModel.class);
setFullscreenIfPossible();
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.media_preview_activity); setContentView(R.layout.media_preview_activity);
initializeViews(); initializeViews();

View File

@ -114,11 +114,13 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
@Override @Override
public void onCreate(Bundle bundle, boolean ready) { public void onCreate(Bundle bundle, boolean ready) {
super.onCreate(bundle, ready);
setContentView(R.layout.message_details_activity); setContentView(R.layout.message_details_activity);
running = true; running = true;
initializeResources(); initializeResources();
initializeActionBar(); initializeActionBar();
getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_background));
getSupportLoaderManager().initLoader(0, null, this); getSupportLoaderManager().initLoader(0, null, this);
} }
@ -129,7 +131,7 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
dynamicLanguage.onResume(this); dynamicLanguage.onResume(this);
assert getSupportActionBar() != null; assert getSupportActionBar() != null;
getSupportActionBar().setTitle(R.string.AndroidManifest__message_details); getSupportActionBar().setTitle("Message Details");
MessageNotifier.setVisibleThread(threadId); MessageNotifier.setVisibleThread(threadId);
} }
@ -148,12 +150,9 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
private void initializeActionBar() { private void initializeActionBar() {
assert getSupportActionBar() != null; assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Recipient recipient = Recipient.from(this, getIntent().getParcelableExtra(ADDRESS_EXTRA), true); Recipient recipient = Recipient.from(this, getIntent().getParcelableExtra(ADDRESS_EXTRA), true);
recipient.addListener(this); recipient.addListener(this);
setActionBarColor(recipient.getColor());
} }
private void setActionBarColor(MaterialColor color) { private void setActionBarColor(MaterialColor color) {

View File

@ -30,7 +30,6 @@ import android.provider.OpenableColumns;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
@ -112,6 +111,8 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
initializeResources(); initializeResources();
initializeSearch(); initializeSearch();
initializeMedia(); initializeMedia();
getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_background));
} }
@Override @Override
@ -161,12 +162,6 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
private void initializeToolbar() { private void initializeToolbar() {
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
} }
private void initializeResources() { private void initializeResources() {

View File

@ -8,12 +8,13 @@ import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.mms.GlideRequests; import org.thoughtcrime.securesms.mms.GlideRequests;
import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.Recipient;
import java.util.List; import java.util.List;
import network.loki.messenger.R;
public class ConversationTypingView extends LinearLayout { public class ConversationTypingView extends LinearLayout {
private AvatarImageView avatar; private AvatarImageView avatar;
@ -40,7 +41,7 @@ public class ConversationTypingView extends LinearLayout {
} }
Recipient typist = typists.get(0); Recipient typist = typists.get(0);
bubble.getBackground().setColorFilter(typist.getColor().toConversationColor(getContext()), PorterDuff.Mode.MULTIPLY); bubble.getBackground().setColorFilter(getResources().getColor(R.color.received_message_background), PorterDuff.Mode.MULTIPLY);
if (isGroupThread) { if (isGroupThread) {
avatar.setAvatar(glideRequests, typist, false); avatar.setAvatar(glideRequests, typist, false);

View File

@ -56,7 +56,7 @@ public class RemovableEditableMediaView extends FrameLayout {
if (current != null) current.setVisibility(View.GONE); if (current != null) current.setVisibility(View.GONE);
if (view != null) { if (view != null) {
view.setPadding(view.getPaddingLeft(), removeSize / 2, removeSize / 2, view.getPaddingRight()); view.setPadding(view.getPaddingLeft(), removeSize / 2, removeSize / 2, (int)(8 * getResources().getDisplayMetrics().density));
edit.setPadding(0, 0, removeSize / 2, 0); edit.setPadding(0, 0, removeSize / 2, 0);
view.setVisibility(View.VISIBLE); view.setVisibility(View.VISIBLE);

View File

@ -9,22 +9,30 @@ import android.widget.CheckBox;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.components.AvatarImageView;
import org.thoughtcrime.securesms.database.Address; import org.thoughtcrime.securesms.database.Address;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.loki.redesign.views.ProfilePictureView;
import org.thoughtcrime.securesms.mms.GlideRequests; import org.thoughtcrime.securesms.mms.GlideRequests;
import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.recipients.RecipientModifiedListener; import org.thoughtcrime.securesms.recipients.RecipientModifiedListener;
import org.thoughtcrime.securesms.util.GroupUtil; import org.thoughtcrime.securesms.util.GroupUtil;
import org.thoughtcrime.securesms.util.Util; import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.ViewUtil; import org.thoughtcrime.securesms.util.ViewUtil;
import org.whispersystems.signalservice.loki.api.LokiAPI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import network.loki.messenger.R;
public class ContactSelectionListItem extends LinearLayout implements RecipientModifiedListener { public class ContactSelectionListItem extends LinearLayout implements RecipientModifiedListener {
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static final String TAG = ContactSelectionListItem.class.getSimpleName(); private static final String TAG = ContactSelectionListItem.class.getSimpleName();
private AvatarImageView contactPhotoImage; private ProfilePictureView profilePictureView;
private TextView numberView; private TextView numberView;
private TextView nameView; private TextView nameView;
private TextView labelView; private TextView labelView;
@ -33,6 +41,7 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
private String number; private String number;
private Recipient recipient; private Recipient recipient;
private GlideRequests glideRequests; private GlideRequests glideRequests;
private long threadID;
public ContactSelectionListItem(Context context) { public ContactSelectionListItem(Context context) {
super(context); super(context);
@ -45,7 +54,7 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
@Override @Override
protected void onFinishInflate() { protected void onFinishInflate() {
super.onFinishInflate(); super.onFinishInflate();
this.contactPhotoImage = findViewById(R.id.contact_photo_image); this.profilePictureView = findViewById(R.id.profilePictureView);
this.numberView = findViewById(R.id.number); this.numberView = findViewById(R.id.number);
this.labelView = findViewById(R.id.label); this.labelView = findViewById(R.id.label);
this.nameView = findViewById(R.id.name); this.nameView = findViewById(R.id.name);
@ -60,7 +69,6 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
if (type == ContactsDatabase.NEW_TYPE) { if (type == ContactsDatabase.NEW_TYPE) {
this.recipient = null; this.recipient = null;
this.contactPhotoImage.setAvatar(glideRequests, Recipient.from(getContext(), Address.UNKNOWN, true), false);
} else if (!TextUtils.isEmpty(number)) { } else if (!TextUtils.isEmpty(number)) {
Address address = Address.fromExternal(getContext(), number); Address address = Address.fromExternal(getContext(), number);
this.recipient = Recipient.from(getContext(), address, true); this.recipient = Recipient.from(getContext(), address, true);
@ -71,9 +79,10 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
} }
} }
this.nameView.setTextColor(color); threadID = DatabaseFactory.getThreadDatabase(getContext()).getThreadIdFor(recipient);
this.numberView.setTextColor(color); this.numberView.setTextColor(color);
this.contactPhotoImage.setAvatar(glideRequests, recipient, false); updateProfilePicture(glideRequests, name, threadID);
if (!multiSelect && recipient != null && recipient.isLocalNumber()) { if (!multiSelect && recipient != null && recipient.isLocalNumber()) {
name = getContext().getString(R.string.note_to_self); name = getContext().getString(R.string.note_to_self);
@ -94,8 +103,6 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
recipient.removeListener(this); recipient.removeListener(this);
recipient = null; recipient = null;
} }
contactPhotoImage.clear(glideRequests);
} }
private void setText(int type, String name, String number, String label) { private void setText(int type, String name, String number, String label) {
@ -125,9 +132,30 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientM
public void onModified(final Recipient recipient) { public void onModified(final Recipient recipient) {
if (this.recipient == recipient) { if (this.recipient == recipient) {
Util.runOnMain(() -> { Util.runOnMain(() -> {
contactPhotoImage.setAvatar(glideRequests, recipient, false); threadID = DatabaseFactory.getThreadDatabase(getContext()).getThreadIdFor(recipient);
updateProfilePicture(glideRequests, recipient.getName(), threadID);
nameView.setText(recipient.toShortString()); nameView.setText(recipient.toShortString());
}); });
} }
} }
private void updateProfilePicture(GlideRequests glide, String name, long threadID) {
if (this.recipient.isGroupRecipient()) {
Set<String> usersAsSet = LokiAPI.Companion.getUserHexEncodedPublicKeyCache().get(threadID);
if (usersAsSet == null) {
usersAsSet = new HashSet<>();
}
ArrayList<String> users = new ArrayList<>(usersAsSet);
Collections.sort(users); // Sort to provide a level of stability
profilePictureView.setHexEncodedPublicKey(users.size() > 0 ? users.get(0) : "");
profilePictureView.setAdditionalHexEncodedPublicKey(users.size() > 1 ? users.get(1) : "");
profilePictureView.setRSSFeed(name.equals("Loki News") || name.equals("Loki Messenger Updates"));
} else {
profilePictureView.setHexEncodedPublicKey(this.number);
profilePictureView.setAdditionalHexEncodedPublicKey(null);
profilePictureView.setRSSFeed(false);
}
profilePictureView.glide = glide;
profilePictureView.update();
}
} }

View File

@ -267,10 +267,10 @@ public class ConversationItem extends LinearLayout
setGroupAuthorColor(messageRecord); setGroupAuthorColor(messageRecord);
setAuthor(messageRecord, previousMessageRecord, nextMessageRecord, groupThread); setAuthor(messageRecord, previousMessageRecord, nextMessageRecord, groupThread);
setQuote(messageRecord, previousMessageRecord, nextMessageRecord, groupThread); setQuote(messageRecord, previousMessageRecord, nextMessageRecord, groupThread);
adjustMarginsIfNeeded(messageRecord);
setMessageSpacing(context, messageRecord, previousMessageRecord, nextMessageRecord, groupThread); setMessageSpacing(context, messageRecord, previousMessageRecord, nextMessageRecord, groupThread);
setFooter(messageRecord, nextMessageRecord, locale, groupThread); setFooter(messageRecord, nextMessageRecord, locale, groupThread);
setFriendRequestView(messageRecord); setFriendRequestView(messageRecord);
adjustMarginsIfNeeded(messageRecord);
} }
@Override @Override
@ -424,6 +424,16 @@ public class ConversationItem extends LinearLayout
!hasSticker(messageRecord); !hasSticker(messageRecord);
} }
private boolean hasOnlyDocument(MessageRecord messageRecord) {
return messageRecord.getBody().length() == 0 &&
!hasThumbnail(messageRecord) &&
!hasAudio(messageRecord) &&
hasDocument(messageRecord) &&
!hasSharedContact(messageRecord) &&
!hasSticker(messageRecord) &&
!hasQuote(messageRecord);
}
private boolean hasOnlyText(MessageRecord messageRecord) { private boolean hasOnlyText(MessageRecord messageRecord) {
return messageRecord.getBody().length() != 0 && return messageRecord.getBody().length() != 0 &&
!hasThumbnail(messageRecord) && !hasThumbnail(messageRecord) &&
@ -515,6 +525,21 @@ public class ConversationItem extends LinearLayout
senderHolderLayoutParams.bottomMargin = (int)getResources().getDimension(R.dimen.medium_spacing); senderHolderLayoutParams.bottomMargin = (int)getResources().getDimension(R.dimen.medium_spacing);
} }
groupSenderHolder.setLayoutParams(senderHolderLayoutParams); groupSenderHolder.setLayoutParams(senderHolderLayoutParams);
if (documentViewStub.resolved()) {
LinearLayout.LayoutParams documentViewLayoutParams = (LinearLayout.LayoutParams)documentViewStub.get().getLayoutParams();
int bottomMargin = 0;
if (hasOnlyDocument(messageRecord)) {
if (footer.getVisibility() == VISIBLE) {
bottomMargin = (int)(4 * getResources().getDisplayMetrics().density);
} else {
bottomMargin = (int)(-4 * getResources().getDisplayMetrics().density);
}
} else {
bottomMargin = (int)(4 * getResources().getDisplayMetrics().density);
}
documentViewLayoutParams.bottomMargin = bottomMargin;
documentViewStub.get().setLayoutParams(documentViewLayoutParams);
}
} }
private void setMediaAttributes(@NonNull MessageRecord messageRecord, private void setMediaAttributes(@NonNull MessageRecord messageRecord,