Merge pull request #677 from hjubb/ux_improvements

Small UI/UX Improvements
This commit is contained in:
Niels Andriesse 2021-07-26 15:49:26 +10:00 committed by GitHub
commit 49d0d13a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 14 additions and 16 deletions

View File

@ -14,11 +14,11 @@ import org.session.libsession.avatars.ProfileContactPhoto
import org.session.libsession.messaging.contacts.Contact import org.session.libsession.messaging.contacts.Contact
import org.session.libsession.messaging.mentions.MentionsManager import org.session.libsession.messaging.mentions.MentionsManager
import org.session.libsession.utilities.Address import org.session.libsession.utilities.Address
import org.session.libsession.utilities.recipients.Recipient
import org.session.libsession.utilities.TextSecurePreferences import org.session.libsession.utilities.TextSecurePreferences
import org.session.libsession.utilities.recipients.Recipient
import org.thoughtcrime.securesms.database.DatabaseFactory import org.thoughtcrime.securesms.database.DatabaseFactory
import org.thoughtcrime.securesms.util.AvatarPlaceholderGenerator
import org.thoughtcrime.securesms.mms.GlideRequests import org.thoughtcrime.securesms.mms.GlideRequests
import org.thoughtcrime.securesms.util.AvatarPlaceholderGenerator
class ProfilePictureView : RelativeLayout { class ProfilePictureView : RelativeLayout {
lateinit var glide: GlideRequests lateinit var glide: GlideRequests

View File

@ -92,6 +92,7 @@ object ConversationMenuHelper {
inflater.inflate(R.menu.menu_conversation_muted, menu) inflater.inflate(R.menu.menu_conversation_muted, menu)
} else { } else {
inflater.inflate(R.menu.menu_conversation_unmuted, menu) inflater.inflate(R.menu.menu_conversation_unmuted, menu)
inflater.inflate(R.menu.menu_conversation_notification_settings, menu)
} }
// Search // Search

View File

@ -94,7 +94,7 @@ class VisibleMessageView : LinearLayout {
profilePictureContainer.visibility = if (isEndOfMessageCluster) View.VISIBLE else View.INVISIBLE profilePictureContainer.visibility = if (isEndOfMessageCluster) View.VISIBLE else View.INVISIBLE
profilePictureView.publicKey = senderSessionID profilePictureView.publicKey = senderSessionID
profilePictureView.glide = glide profilePictureView.glide = glide
profilePictureView.update() profilePictureView.update(message.individualRecipient, threadID)
profilePictureView.setOnClickListener { showUserDetails(message.recipient.address.toString()) } profilePictureView.setOnClickListener { showUserDetails(message.recipient.address.toString()) }
if (thread.isOpenGroupRecipient) { if (thread.isOpenGroupRecipient) {
val openGroup = DatabaseFactory.getLokiThreadDatabase(context).getOpenGroupChat(threadID) ?: return val openGroup = DatabaseFactory.getLokiThreadDatabase(context).getOpenGroupChat(threadID) ?: return

View File

@ -237,6 +237,7 @@ public class RecipientDatabase extends Database {
values.put(NOTIFY_TYPE, notifyType); values.put(NOTIFY_TYPE, notifyType);
updateOrInsert(recipient.getAddress(), values); updateOrInsert(recipient.getAddress(), values);
recipient.resolve().setNotifyType(notifyType); recipient.resolve().setNotifyType(notifyType);
notifyConversationListListeners();
} }
public void setExpireMessages(@NonNull Recipient recipient, int expiration) { public void setExpireMessages(@NonNull Recipient recipient, int expiration) {

View File

@ -59,7 +59,7 @@ public class ConversationOptionsBottomSheet : BottomSheetDialogFragment(), View.
muteNotificationsTextView.isVisible = !recipient.isMuted && !recipient.isLocalNumber muteNotificationsTextView.isVisible = !recipient.isMuted && !recipient.isLocalNumber
unMuteNotificationsTextView.setOnClickListener(this) unMuteNotificationsTextView.setOnClickListener(this)
muteNotificationsTextView.setOnClickListener(this) muteNotificationsTextView.setOnClickListener(this)
notificationsTextView.isVisible = recipient.isGroupRecipient notificationsTextView.isVisible = recipient.isGroupRecipient && !recipient.isMuted
notificationsTextView.setOnClickListener(this) notificationsTextView.setOnClickListener(this)
deleteTextView.setOnClickListener(this) deleteTextView.setOnClickListener(this)
} }

View File

@ -5,13 +5,13 @@ import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.Toast import android.widget.Toast
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.synthetic.main.fragment_user_details_bottom_sheet.* import kotlinx.android.synthetic.main.fragment_user_details_bottom_sheet.*
import network.loki.messenger.R import network.loki.messenger.R
import org.session.libsession.messaging.contacts.Contact import org.session.libsession.messaging.contacts.Contact
@ -34,7 +34,7 @@ class UserDetailsBottomSheet : BottomSheetDialogFragment() {
profilePictureView.publicKey = publicKey profilePictureView.publicKey = publicKey
profilePictureView.glide = GlideApp.with(this) profilePictureView.glide = GlideApp.with(this)
profilePictureView.isLarge = true profilePictureView.isLarge = true
profilePictureView.update() profilePictureView.update(recipient, -1)
nameTextViewContainer.visibility = View.VISIBLE nameTextViewContainer.visibility = View.VISIBLE
nameTextViewContainer.setOnClickListener { nameTextViewContainer.setOnClickListener {
nameTextViewContainer.visibility = View.INVISIBLE nameTextViewContainer.visibility = View.INVISIBLE

View File

@ -13,8 +13,4 @@
android:title="@string/conversation__menu_leave_group" android:title="@string/conversation__menu_leave_group"
app:showAsAction="collapseActionView"/> app:showAsAction="collapseActionView"/>
<item
android:title="@string/RecipientPreferenceActivity_notification_settings"
android:id="@+id/menu_notification_settings"/>
</menu> </menu>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:title="@string/RecipientPreferenceActivity_notification_settings"
android:id="@+id/menu_notification_settings"/>
</menu>

View File

@ -6,8 +6,4 @@
android:title="@string/ConversationActivity_invite_to_open_group" android:title="@string/ConversationActivity_invite_to_open_group"
android:id="@+id/menu_invite_to_open_group" /> android:id="@+id/menu_invite_to_open_group" />
<item
android:title="@string/RecipientPreferenceActivity_notification_settings"
android:id="@+id/menu_notification_settings"/>
</menu> </menu>

View File

@ -247,7 +247,6 @@
<string-array name="notify_types"> <string-array name="notify_types">
<item>@string/notify_type_all</item> <item>@string/notify_type_all</item>
<item>@string/notify_type_mentions</item> <item>@string/notify_type_mentions</item>
<item>@string/notify_type_none</item>
</string-array> </string-array>
</resources> </resources>

View File

@ -893,5 +893,4 @@
<string name="dialog_send_seed_send_button_title">Send</string> <string name="dialog_send_seed_send_button_title">Send</string>
<string name="notify_type_all">All</string> <string name="notify_type_all">All</string>
<string name="notify_type_mentions">Mentions</string> <string name="notify_type_mentions">Mentions</string>
<string name="notify_type_none">None</string>
</resources> </resources>