mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Message details activity styling fixes.
Message details activity is available form the conversation context menu.
This commit is contained in:
parent
2991bd37c7
commit
655d971727
@ -310,7 +310,7 @@
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:label="Message Details"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.Session.DayNight"
|
||||
android:theme="@style/Theme.TextSecure.DayNight"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateHidden" />
|
||||
<activity
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 693 B |
10
res/drawable/ic_baseline_info_24.xml
Normal file
10
res/drawable/ic_baseline_info_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
|
||||
</vector>
|
10
res/drawable/ic_baseline_refresh_24.xml
Normal file
10
res/drawable/ic_baseline_refresh_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
|
||||
</vector>
|
10
res/drawable/ic_outline_info_24.xml
Normal file
10
res/drawable/ic_outline_info_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
</vector>
|
@ -41,13 +41,14 @@
|
||||
android:id="@+id/resend_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="38sp"
|
||||
style="@style/InfoButton"
|
||||
style="@style/Widget.Session.Button.Common.ProminentOutline"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:drawableStart="@drawable/ic_refresh_white_18dp"
|
||||
android:drawableStart="@drawable/ic_baseline_refresh_24"
|
||||
android:drawablePadding="4dp"
|
||||
android:text="@string/message_recipients_list_item__resend"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- <item android:title="@string/conversation_context__menu_message_details"
|
||||
<item android:title="@string/conversation_context__menu_message_details"
|
||||
android:id="@+id/menu_context_details"
|
||||
android:icon="?menu_info_icon"
|
||||
app:showAsAction="always" /> -->
|
||||
app:showAsAction="always" />
|
||||
|
||||
<item android:title="@string/conversation_context__menu_delete_message"
|
||||
android:id="@+id/menu_context_delete_message"
|
||||
|
@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Widget.Session.Button.Common.ProminentOutline">
|
||||
<item name="android:background">@drawable/prominent_outline_button_medium_background</item>
|
||||
<item name="android:textColor">?android:textColorPrimary</item>
|
||||
<item name="android:drawableTint" tools:ignore="NewApi">?android:textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Session.Button.Common.ProminentFilled">
|
||||
<item name="android:background">@drawable/prominent_filled_button_medium_background</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:drawableTint" tools:ignore="NewApi">@android:color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="FakeChatViewMessageBubble.Incoming">
|
||||
|
@ -25,6 +25,8 @@
|
||||
<item name="quick_camera_icon">@drawable/ic_outline_photo_camera_24</item>
|
||||
|
||||
<item name="media_keyboard_button_color">@color/core_grey_60</item>
|
||||
|
||||
<item name="menu_info_icon">@drawable/ic_outline_info_24</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Session.DayNight" parent="Theme.Session.Light">
|
||||
|
@ -113,6 +113,7 @@
|
||||
<attr name="menu_block_icon" format="reference" />
|
||||
<attr name="menu_photo_library_icon" format="reference" />
|
||||
<attr name="menu_delete_icon" format="reference" />
|
||||
<attr name="menu_info_icon" format="reference" />
|
||||
|
||||
<attr name="pref_icon_tint" format="color"/>
|
||||
|
||||
|
@ -74,21 +74,25 @@
|
||||
<style name="Widget.Session.Button.Common.ProminentFilled">
|
||||
<item name="android:background">@drawable/prominent_filled_button_medium_background</item>
|
||||
<item name="android:textColor">?android:textColorPrimary</item>
|
||||
<item name="android:drawableTint" tools:ignore="NewApi">?android:textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Session.Button.Common.ProminentOutline">
|
||||
<item name="android:background">@drawable/prominent_outline_button_medium_background</item>
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
<item name="android:drawableTint" tools:ignore="NewApi">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Session.Button.Common.UnimportantFilled">
|
||||
<item name="android:background">@drawable/unimportant_filled_button_medium_background</item>
|
||||
<item name="android:textColor">?android:textColorPrimary</item>
|
||||
<item name="android:drawableTint" tools:ignore="NewApi">?android:textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Session.Button.Common.UnimportantOutline">
|
||||
<item name="android:background">@drawable/unimportant_outline_button_medium_background</item>
|
||||
<item name="android:textColor">?android:textColorPrimary</item>
|
||||
<item name="android:drawableTint" tools:ignore="NewApi">?android:textColorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Session.Button.Dialog" parent="">
|
||||
|
@ -77,6 +77,7 @@
|
||||
<item name="menu_selectall_icon">@drawable/ic_baseline_select_all_24</item>
|
||||
<item name="menu_split_icon">@drawable/ic_baseline_call_split_24</item>
|
||||
<item name="menu_popup_expand">@drawable/ic_baseline_launch_24</item>
|
||||
<item name="menu_info_icon">@drawable/ic_baseline_info_24</item>
|
||||
|
||||
<item name="conversation_emoji_toggle">@drawable/ic_emoji_filled_keyboard_24</item>
|
||||
<item name="conversation_sticker_toggle">@drawable/ic_sticker_filled_keyboard_24</item>
|
||||
|
@ -24,10 +24,6 @@ import android.database.Cursor;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.loader.app.LoaderManager.LoaderCallbacks;
|
||||
import androidx.loader.content.Loader;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@ -35,6 +31,11 @@ import android.view.ViewGroup;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.loader.app.LoaderManager.LoaderCallbacks;
|
||||
import androidx.loader.content.Loader;
|
||||
|
||||
import org.thoughtcrime.securesms.MessageDetailsRecipientAdapter.RecipientDeliveryStatus;
|
||||
import org.thoughtcrime.securesms.color.MaterialColor;
|
||||
import org.thoughtcrime.securesms.conversation.ConversationItem;
|
||||
@ -55,7 +56,6 @@ import org.thoughtcrime.securesms.recipients.RecipientModifiedListener;
|
||||
import org.thoughtcrime.securesms.sms.MessageSender;
|
||||
import org.thoughtcrime.securesms.util.DateUtils;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.ExpirationUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
@ -100,14 +100,12 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
|
||||
private ListView recipientsList;
|
||||
private LayoutInflater inflater;
|
||||
|
||||
private DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
private DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
|
||||
private boolean running;
|
||||
|
||||
@Override
|
||||
protected void onPreCreate() {
|
||||
dynamicTheme.onCreate(this);
|
||||
dynamicLanguage.onCreate(this);
|
||||
}
|
||||
|
||||
@ -119,14 +117,12 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
initializeResources();
|
||||
initializeActionBar();
|
||||
getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_background));
|
||||
getSupportLoaderManager().initLoader(0, null, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
dynamicTheme.onResume(this);
|
||||
dynamicLanguage.onResume(this);
|
||||
|
||||
assert getSupportActionBar() != null;
|
||||
|
@ -103,8 +103,6 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
initializeResources();
|
||||
initializeSearch();
|
||||
initializeMedia();
|
||||
|
||||
getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_background));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,6 +6,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.provider.ContactsContract;
|
||||
import androidx.annotation.NonNull;
|
||||
@ -21,6 +22,7 @@ import org.thoughtcrime.securesms.contacts.avatars.ContactColors;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto;
|
||||
import org.thoughtcrime.securesms.database.Address;
|
||||
import org.thoughtcrime.securesms.loki.utilities.AvatarPlaceholderGenerator;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
@ -128,17 +130,21 @@ public class AvatarImageView extends AppCompatImageView {
|
||||
requestManager.clear(this);
|
||||
recipientContactPhoto = photo;
|
||||
|
||||
Drawable fallbackContactPhotoDrawable = photo.recipient.getFallbackContactPhotoDrawable(getContext(), inverted);
|
||||
Drawable photoPlaceholderDrawable = AvatarPlaceholderGenerator.generate(
|
||||
getContext(), 128, recipient.getAddress().serialize(), recipient.getName());
|
||||
|
||||
if (photo.contactPhoto != null) {
|
||||
requestManager.load(photo.contactPhoto)
|
||||
.fallback(fallbackContactPhotoDrawable)
|
||||
.error(fallbackContactPhotoDrawable)
|
||||
.fallback(photoPlaceholderDrawable)
|
||||
.error(photoPlaceholderDrawable)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.circleCrop()
|
||||
.into(this);
|
||||
} else {
|
||||
setImageDrawable(fallbackContactPhotoDrawable);
|
||||
requestManager.load(photoPlaceholderDrawable)
|
||||
.circleCrop()
|
||||
.into(this);
|
||||
// setImageDrawable(photoPlaceholderDrawable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -374,12 +374,14 @@ public class ConversationFragment extends Fragment
|
||||
}
|
||||
|
||||
if (messageRecords.size() > 1) {
|
||||
menu.findItem(R.id.menu_context_details).setVisible(false);
|
||||
menu.findItem(R.id.menu_context_reply).setVisible(false);
|
||||
menu.findItem(R.id.menu_context_save_attachment).setVisible(false);
|
||||
menu.findItem(R.id.menu_context_resend).setVisible(false);
|
||||
} else {
|
||||
MessageRecord messageRecord = messageRecords.iterator().next();
|
||||
|
||||
menu.findItem(R.id.menu_context_details).setVisible(true);
|
||||
menu.findItem(R.id.menu_context_resend).setVisible(messageRecord.isFailed());
|
||||
menu.findItem(R.id.menu_context_save_attachment).setVisible(!actionMessage &&
|
||||
messageRecord.isMms() &&
|
||||
@ -1126,16 +1128,14 @@ public class ConversationFragment extends Fragment
|
||||
handleDeleteMessages(getListAdapter().getSelectedItems());
|
||||
actionMode.finish();
|
||||
return true;
|
||||
/*
|
||||
case R.id.menu_context_details:
|
||||
handleDisplayDetails(getSelectedMessageRecord());
|
||||
actionMode.finish();
|
||||
return true;
|
||||
case R.id.menu_context_forward:
|
||||
handleForwardMessage(getSelectedMessageRecord());
|
||||
actionMode.finish();
|
||||
return true;
|
||||
*/
|
||||
// case R.id.menu_context_forward:
|
||||
// handleForwardMessage(getSelectedMessageRecord());
|
||||
// actionMode.finish();
|
||||
// return true;
|
||||
case R.id.menu_context_resend:
|
||||
handleResendMessage(getSelectedMessageRecord());
|
||||
actionMode.finish();
|
||||
|
@ -15,6 +15,7 @@ object AvatarPlaceholderGenerator {
|
||||
|
||||
private const val EMPTY_LABEL = "0";
|
||||
|
||||
@JvmStatic
|
||||
fun generate(context: Context, pixelSize: Int, hashString: String, displayName: String?): BitmapDrawable {
|
||||
//TODO That should be replaced with a proper hash extraction code.
|
||||
val hash: Long
|
||||
|
@ -326,6 +326,6 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
|
||||
? TextSecurePreferences.getMasterHexEncodedPublicKey(context)
|
||||
: publicKey;
|
||||
String displayName = recipient.getName();
|
||||
return AvatarPlaceholderGenerator.INSTANCE.generate(context, 128, hepk, displayName);
|
||||
return AvatarPlaceholderGenerator.generate(context, 128, hepk, displayName);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user