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

Commit 7322c050 authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Adjust header to spec

- factor out attributes to themes
- use themeing to change ambient header to larger text and icon size

Bug: 30876804
Test: receive notification on ambient screen, observe that header text is slightly larger
Change-Id: I70f79400e2ce47b862b3b501421aa71187866e61
parent 7d062c45
Loading
Loading
Loading
Loading
+8 −11
Original line number Original line Diff line number Diff line
@@ -17,27 +17,24 @@


<NotificationHeaderView
<NotificationHeaderView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:theme="@style/Theme.Material.Notification"
    android:id="@+id/notification_header"
    android:id="@+id/notification_header"
    android:orientation="horizontal"
    android:orientation="horizontal"
    android:layout_width="wrap_content"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/notification_header_height"
    android:layout_height="@dimen/notification_header_height"
    android:clipChildren="false"
    android:clipChildren="false"
    android:paddingTop="@dimen/notification_header_padding_top"
    style="?attr/notificationHeaderStyle">
    android:paddingBottom="@dimen/notification_header_padding_bottom"
    android:layout_marginBottom="5dp"
    android:paddingStart="@dimen/notification_content_margin_start"
    android:paddingEnd="16dp">
    <com.android.internal.widget.CachingIconView
    <com.android.internal.widget.CachingIconView
        android:id="@+id/icon"
        android:id="@+id/icon"
        android:layout_width="@dimen/notification_header_icon_size"
        android:layout_width="?attr/notificationHeaderIconSize"
        android:layout_height="@dimen/notification_header_icon_size"
        android:layout_height="?attr/notificationHeaderIconSize"
        android:layout_marginEnd="3dp"
        android:layout_marginEnd="3dp"
        />
        />
    <TextView
    <TextView
        android:id="@+id/app_name_text"
        android:id="@+id/app_name_text"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="@style/TextAppearance.Material.Notification.Info"
        android:textAppearance="?attr/notificationHeaderTextAppearance"
        android:layout_marginStart="3dp"
        android:layout_marginStart="3dp"
        android:layout_marginEnd="2dp"
        android:layout_marginEnd="2dp"
        android:singleLine="true"
        android:singleLine="true"
@@ -46,7 +43,7 @@
        android:id="@+id/header_text_divider"
        android:id="@+id/header_text_divider"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="@style/TextAppearance.Material.Notification.Info"
        android:textAppearance="?attr/notificationHeaderTextAppearance"
        android:layout_marginStart="2dp"
        android:layout_marginStart="2dp"
        android:layout_marginEnd="2dp"
        android:layout_marginEnd="2dp"
        android:text="@string/notification_header_divider_symbol"
        android:text="@string/notification_header_divider_symbol"
@@ -55,7 +52,7 @@
        android:id="@+id/header_text"
        android:id="@+id/header_text"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="@style/TextAppearance.Material.Notification.Info"
        android:textAppearance="?attr/notificationHeaderTextAppearance"
        android:layout_marginStart="2dp"
        android:layout_marginStart="2dp"
        android:layout_marginEnd="2dp"
        android:layout_marginEnd="2dp"
        android:visibility="gone"
        android:visibility="gone"
@@ -64,7 +61,7 @@
        android:id="@+id/time_divider"
        android:id="@+id/time_divider"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="@style/TextAppearance.Material.Notification.Info"
        android:textAppearance="?attr/notificationHeaderTextAppearance"
        android:layout_marginStart="2dp"
        android:layout_marginStart="2dp"
        android:layout_marginEnd="2dp"
        android:layout_marginEnd="2dp"
        android:text="@string/notification_header_divider_symbol"
        android:text="@string/notification_header_divider_symbol"
+2 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,8 @@
    android:paddingStart="@dimen/notification_extra_margin_ambient"
    android:paddingStart="@dimen/notification_extra_margin_ambient"
    android:paddingEnd="@dimen/notification_extra_margin_ambient"
    android:paddingEnd="@dimen/notification_extra_margin_ambient"
    >
    >
    <include layout="@layout/notification_template_header" />
    <include layout="@layout/notification_template_header"
        android:theme="@style/Theme.Material.Notification.Ambient" />


    <LinearLayout
    <LinearLayout
            android:id="@+id/notification_action_list_margin_target"
            android:id="@+id/notification_action_list_margin_target"
+7 −0
Original line number Original line Diff line number Diff line
@@ -8630,5 +8630,12 @@
        <attr name="stackFromEnd" format="boolean" />
        <attr name="stackFromEnd" format="boolean" />
    </declare-styleable>
    </declare-styleable>


    <!-- @hide -->
    <declare-styleable name="NotificationTheme">
        <attr name="notificationHeaderStyle" format="reference" />
        <attr name="notificationHeaderTextAppearance" format="reference" />
        <attr name="notificationHeaderIconSize" format="dimension" />
    </declare-styleable>

    <attr name="lockPatternStyle" format="reference" />
    <attr name="lockPatternStyle" format="reference" />
</resources>
</resources>
+3 −0
Original line number Original line Diff line number Diff line
@@ -191,6 +191,9 @@
    <!-- size (width and height) of the icon in the notification header -->
    <!-- size (width and height) of the icon in the notification header -->
    <dimen name="notification_header_icon_size">18dp</dimen>
    <dimen name="notification_header_icon_size">18dp</dimen>


    <!-- size (width and height) of the icon in the notification header -->
    <dimen name="notification_header_icon_size_ambient">20dp</dimen>

    <!-- Height of a small notification in the status bar -->
    <!-- Height of a small notification in the status bar -->
    <dimen name="notification_min_height">92dp</dimen>
    <dimen name="notification_min_height">92dp</dimen>


+12 −0
Original line number Original line Diff line number Diff line
@@ -488,6 +488,10 @@ please see styles_device_defaults.xml.


    <style name="TextAppearance.Material.Notification.Time" parent="TextAppearance.Material.Notification.Info" />
    <style name="TextAppearance.Material.Notification.Time" parent="TextAppearance.Material.Notification.Info" />


    <style name="TextAppearance.Material.Notification.Info.Ambient">
        <item name="textSize">@dimen/notification_text_size</item>
    </style>

    <style name="TextAppearance.Material.Notification.Emphasis">
    <style name="TextAppearance.Material.Notification.Emphasis">
        <item name="textColor">#66000000</item>
        <item name="textColor">#66000000</item>
    </style>
    </style>
@@ -1283,4 +1287,12 @@ please see styles_device_defaults.xml.


    <style name="DialogWindowTitle.Material.Light" />
    <style name="DialogWindowTitle.Material.Light" />


    <style name="Notification.Header" parent="">
        <item name="paddingTop">@dimen/notification_header_padding_top</item>
        <item name="paddingBottom">@dimen/notification_header_padding_bottom</item>
        <item name="layout_marginBottom">5dp</item>
        <item name="paddingStart">@dimen/notification_content_margin_start</item>
        <item name="paddingEnd">16dp</item>
    </style>

</resources>
</resources>
Loading