Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 109d3dc7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add application name to expanded conversation view" into rvc-dev am:...

Merge "Add application name to expanded conversation view" into rvc-dev am: eb0d8bff am: 815f7632

Change-Id: I1cf83f316d54cb453c9690bc901aa6461b1b89ea
parents 36998bb2 815f7632
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -133,6 +133,7 @@ public class ConversationLayout extends FrameLayout
    private boolean mExpandable = true;
    private boolean mExpandable = true;
    private int mContentMarginEnd;
    private int mContentMarginEnd;
    private Rect mMessagingClipRect;
    private Rect mMessagingClipRect;
    private TextView mAppName;


    public ConversationLayout(@NonNull Context context) {
    public ConversationLayout(@NonNull Context context) {
        super(context);
        super(context);
@@ -202,6 +203,7 @@ public class ConversationLayout extends FrameLayout
                R.string.conversation_title_fallback_one_to_one);
                R.string.conversation_title_fallback_one_to_one);
        mFallbackGroupChatName = getResources().getString(
        mFallbackGroupChatName = getResources().getString(
                R.string.conversation_title_fallback_group_chat);
                R.string.conversation_title_fallback_group_chat);
        mAppName = findViewById(R.id.app_name_text);
    }
    }


    @RemotableViewMethod
    @RemotableViewMethod
@@ -384,6 +386,7 @@ public class ConversationLayout extends FrameLayout
        }
        }
        updateIconPositionAndSize();
        updateIconPositionAndSize();
        updateImageMessages();
        updateImageMessages();
        updateAppName();
    }
    }


    private void updateImageMessages() {
    private void updateImageMessages() {
@@ -462,6 +465,10 @@ public class ConversationLayout extends FrameLayout
        topView.setImageIcon(secondLastIcon);
        topView.setImageIcon(secondLastIcon);
    }
    }


    private void updateAppName() {
        mAppName.setVisibility(mIsCollapsed ? GONE : VISIBLE);
    }

    /**
    /**
     * update the icon position and sizing
     * update the icon position and sizing
     */
     */
+11 −0
Original line number Original line Diff line number Diff line
@@ -174,6 +174,17 @@
                    />
                    />
                </LinearLayout>
                </LinearLayout>


                <!-- App Name -->
                <TextView
                    android:id="@+id/app_name_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/conversation_content_start"
                    android:paddingBottom="16dp"
                    android:textSize="12sp"
                    android:textAppearance="@style/TextAppearance.DeviceDefault.Notification"
                />

                <!-- Messages -->
                <!-- Messages -->
                <com.android.internal.widget.MessagingLinearLayout
                <com.android.internal.widget.MessagingLinearLayout
                    android:id="@+id/notification_messaging"
                    android:id="@+id/notification_messaging"
+13 −19
Original line number Original line Diff line number Diff line
@@ -52,28 +52,22 @@ class NotificationConversationTemplateViewWrapper constructor(
    private lateinit var imageMessageContainer: ViewGroup
    private lateinit var imageMessageContainer: ViewGroup
    private lateinit var messagingLinearLayout: MessagingLinearLayout
    private lateinit var messagingLinearLayout: MessagingLinearLayout
    private lateinit var importanceRing: View
    private lateinit var importanceRing: View
    private lateinit var appName: View


    private fun resolveViews() {
    private fun resolveViews() {
        messagingLinearLayout = conversationLayout.messagingLinearLayout
        messagingLinearLayout = conversationLayout.messagingLinearLayout
        imageMessageContainer = conversationLayout.imageMessageContainer
        imageMessageContainer = conversationLayout.imageMessageContainer
        conversationIcon = conversationLayout.requireViewById(
        with(conversationLayout) {
                com.android.internal.R.id.conversation_icon
            conversationIcon = requireViewById(com.android.internal.R.id.conversation_icon)
        )
            conversationBadge = requireViewById(com.android.internal.R.id.conversation_icon_badge)
        conversationBadge = conversationLayout.requireViewById(
            conversationBadgeBg =
                com.android.internal.R.id.conversation_icon_badge
                    requireViewById(com.android.internal.R.id.conversation_icon_badge_bg)
        )
            expandButton = requireViewById(com.android.internal.R.id.expand_button)
        conversationBadgeBg = conversationLayout.requireViewById(
            expandButtonContainer =
                com.android.internal.R.id.conversation_icon_badge_bg
                    requireViewById(com.android.internal.R.id.expand_button_container)
        )
            importanceRing = requireViewById(com.android.internal.R.id.conversation_icon_badge_ring)
        expandButton = conversationLayout.requireViewById(
            appName = requireViewById(com.android.internal.R.id.app_name_text)
                com.android.internal.R.id.expand_button
        }
        )
        expandButtonContainer = conversationLayout.requireViewById(
                com.android.internal.R.id.expand_button_container
        )
        importanceRing = conversationLayout.requireViewById(
                com.android.internal.R.id.conversation_icon_badge_ring
        )
    }
    }


    override fun onContentUpdated(row: ExpandableNotificationRow) {
    override fun onContentUpdated(row: ExpandableNotificationRow) {
@@ -87,7 +81,7 @@ class NotificationConversationTemplateViewWrapper constructor(
        // This also clears the existing types
        // This also clears the existing types
        super.updateTransformedTypes()
        super.updateTransformedTypes()


        addTransformedViews(messagingLinearLayout)
        addTransformedViews(messagingLinearLayout, appName)


        // Let's ignore the image message container since that is transforming as part of the
        // Let's ignore the image message container since that is transforming as part of the
        // messages already
        // messages already