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

Commit 83ff9db6 authored by Jernej Virag's avatar Jernej Virag
Browse files

Size restrict right notification icon size

Right now the right notification icon is always loaded at full resolution. This will downsample the icon to displayed size if the user passes a bitmap that's large.

Bug:218845090
Bug:210690571

Test: Manually on device
Change-Id: Ib66933a8fe92765e069f1571ded990b37f82b05f
parent 104e6492
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@
        android:layout_marginStart="@dimen/notification_icon_circle_start"
        android:background="@drawable/notification_icon_circle"
        android:padding="@dimen/notification_icon_circle_padding"
        android:maxDrawableWidth="@dimen/notification_icon_circle_size"
        android:maxDrawableHeight="@dimen/notification_icon_circle_size"
        />

    <!-- extends ViewGroup -->
+5 −1
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@
        android:layout_marginStart="@dimen/notification_icon_circle_start"
        android:background="@drawable/notification_icon_circle"
        android:padding="@dimen/notification_icon_circle_padding"
        android:maxDrawableWidth="@dimen/notification_icon_circle_size"
        android:maxDrawableHeight="@dimen/notification_icon_circle_size"
        />

    <FrameLayout
@@ -136,7 +138,7 @@

        </LinearLayout>

        <ImageView
        <com.android.internal.widget.CachingIconView
            android:id="@+id/right_icon"
            android:layout_width="@dimen/notification_right_icon_size"
            android:layout_height="@dimen/notification_right_icon_size"
@@ -148,6 +150,8 @@
            android:clipToOutline="true"
            android:importantForAccessibility="no"
            android:scaleType="centerCrop"
            android:maxDrawableWidth="@dimen/notification_right_icon_size"
            android:maxDrawableHeight="@dimen/notification_right_icon_size"
            />

        <FrameLayout
+3 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->
<ImageView
<com.android.internal.widget.CachingIconView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/right_icon"
    android:layout_width="@dimen/notification_right_icon_size"
@@ -25,4 +25,6 @@
    android:clipToOutline="true"
    android:importantForAccessibility="no"
    android:scaleType="centerCrop"
    android:maxDrawableWidth="@dimen/notification_right_icon_size"
    android:maxDrawableHeight="@dimen/notification_right_icon_size"
    />