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

Commit b2b1a951 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Fix group name layout

Group names can be long (account names, like email addresses)
so let them have their own line in notification info

Test: atest, manual
Fixes: 157766238
Change-Id: I5bb33edac18eeefb5d99d7573925e54e91ac0c54
parent 829ac140
Loading
Loading
Loading
Loading
+14 −26
Original line number Diff line number Diff line
@@ -84,34 +84,21 @@
                    android:layout_weight="1"
                    style="@style/TextAppearance.NotificationImportanceChannel"/>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start"
                android:orientation="horizontal">
            <TextView
                android:id="@+id/pkg_name"
                    android:layout_width="wrap_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"
                android:ellipsize="end"
                android:textDirection="locale"
                android:maxLines="1"/>
                <TextView
                    android:id="@+id/group_divider"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    style="@style/TextAppearance.NotificationImportanceHeader"
                    android:layout_marginStart="2dp"
                    android:layout_marginEnd="2dp"
                    android:text="@*android:string/notification_header_divider_symbol" />
            <TextView
                android:id="@+id/group_name"
                    android:layout_width="wrap_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                    android:layout_weight="1"
                android:ellipsize="end"
                android:textDirection="locale"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"/>
            </LinearLayout>
            <TextView
                android:id="@+id/delegate_name"
                android:layout_width="match_parent"
@@ -121,6 +108,7 @@
                android:layout_marginStart="2dp"
                android:layout_marginEnd="2dp"
                android:ellipsize="end"
                android:textDirection="locale"
                android:text="@string/notification_delegate_header"
                android:maxLines="1" />

+14 −27
Original line number Diff line number Diff line
@@ -58,35 +58,21 @@
                android:layout_height="wrap_content"
                android:textDirection="locale"
                style="@style/TextAppearance.NotificationImportanceChannel"/>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start"
                android:orientation="horizontal">
            <TextView
                android:id="@+id/pkg_name"
                    android:layout_width="wrap_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"
                android:ellipsize="end"
                android:textDirection="locale"
                android:maxLines="1"/>
                <TextView
                    android:id="@+id/group_divider"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    style="@style/TextAppearance.NotificationImportanceHeader"
                    android:layout_marginStart="2dp"
                    android:layout_marginEnd="2dp"
                    android:text="@*android:string/notification_header_divider_symbol" />
            <TextView
                android:id="@+id/group_name"
                    android:layout_width="wrap_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                    android:layout_weight="1"
                android:textDirection="locale"
                android:ellipsize="end"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"/>
            </LinearLayout>
            <TextView
                android:id="@+id/delegate_name"
                android:layout_width="match_parent"
@@ -96,6 +82,7 @@
                android:layout_marginStart="2dp"
                android:layout_marginEnd="2dp"
                android:ellipsize="end"
                android:textDirection="locale"
                android:text="@string/notification_delegate_header"
                android:maxLines="1" />

+14 −27
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@
            android:layout_weight="1"
            android:layout_width="0dp"
            android:orientation="vertical"

            android:layout_height="wrap_content"
            android:minHeight="@dimen/notification_guts_conversation_icon_size"
            android:layout_centerVertical="true"
@@ -78,34 +77,21 @@
                    style="@style/TextAppearance.NotificationImportanceChannel"/>

            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start"
                android:orientation="horizontal">
            <TextView
                android:id="@+id/pkg_name"
                    android:layout_width="wrap_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"
                android:ellipsize="end"
                android:textDirection="locale"
                android:maxLines="1"/>
                <TextView
                    android:id="@+id/group_divider"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    style="@style/TextAppearance.NotificationImportanceHeader"
                    android:layout_marginStart="2dp"
                    android:layout_marginEnd="2dp"
                    android:text="@*android:string/notification_header_divider_symbol" />
            <TextView
                android:id="@+id/group_name"
                    android:layout_width="wrap_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                    android:layout_weight="1"
                android:ellipsize="end"
                android:textDirection="locale"
                style="@style/TextAppearance.NotificationImportanceChannelGroup"/>
            </LinearLayout>
            <TextView
                android:id="@+id/delegate_name"
                android:layout_width="match_parent"
@@ -115,6 +101,7 @@
                android:layout_marginStart="2dp"
                android:layout_marginEnd="2dp"
                android:ellipsize="end"
                android:textDirection="locale"
                android:text="@string/notification_delegate_header"
                android:maxLines="1" />

+0 −3
Original line number Diff line number Diff line
@@ -368,14 +368,11 @@ public class NotificationConversationInfo extends LinearLayout implements
            }
        }
        TextView groupNameView = findViewById(R.id.group_name);
        View groupDivider = findViewById(R.id.group_divider);
        if (groupName != null) {
            groupNameView.setText(groupName);
            groupNameView.setVisibility(VISIBLE);
            groupDivider.setVisibility(VISIBLE);
        } else {
            groupNameView.setVisibility(GONE);
            groupDivider.setVisibility(GONE);
        }
    }

+0 −3
Original line number Diff line number Diff line
@@ -375,14 +375,11 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
            }
        }
        TextView groupNameView = findViewById(R.id.group_name);
        View divider = findViewById(R.id.group_divider);
        if (groupName != null) {
            groupNameView.setText(groupName);
            groupNameView.setVisibility(VISIBLE);
            divider.setVisibility(VISIBLE);
        } else {
            groupNameView.setVisibility(GONE);
            divider.setVisibility(GONE);
        }
    }

Loading