Loading core/java/com/android/internal/widget/NotificationRowIconView.java 0 → 100644 +60 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.widget; import android.app.Flags; import android.content.Context; import android.util.AttributeSet; import android.widget.RemoteViews; import androidx.annotation.Nullable; /** * An image view that holds the icon displayed on the left side of a notification row. */ @RemoteViews.RemoteView public class NotificationRowIconView extends CachingIconView { public NotificationRowIconView(Context context) { super(context); } public NotificationRowIconView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } public NotificationRowIconView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public NotificationRowIconView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @Override protected void onFinishInflate() { // If showing the app icon, we don't need background or padding. if (Flags.notificationsUseAppIcon()) { setPadding(0, 0, 0, 0); setBackground(null); } super.onFinishInflate(); } } core/res/res/layout/notification_template_header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ android:visibility="gone" /> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading core/res/res/layout/notification_template_material_base.xml +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ android:visibility="gone" /> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading core/res/res/layout/notification_template_material_compact_heads_up_base.xml +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ android:gravity="center_vertical" android:theme="@style/Theme.DeviceDefault.Notification" android:importantForAccessibility="no"> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading core/res/res/layout/notification_template_material_media.xml +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ android:visibility="gone" /> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading Loading
core/java/com/android/internal/widget/NotificationRowIconView.java 0 → 100644 +60 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.widget; import android.app.Flags; import android.content.Context; import android.util.AttributeSet; import android.widget.RemoteViews; import androidx.annotation.Nullable; /** * An image view that holds the icon displayed on the left side of a notification row. */ @RemoteViews.RemoteView public class NotificationRowIconView extends CachingIconView { public NotificationRowIconView(Context context) { super(context); } public NotificationRowIconView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } public NotificationRowIconView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } public NotificationRowIconView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @Override protected void onFinishInflate() { // If showing the app icon, we don't need background or padding. if (Flags.notificationsUseAppIcon()) { setPadding(0, 0, 0, 0); setBackground(null); } super.onFinishInflate(); } }
core/res/res/layout/notification_template_header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ android:visibility="gone" /> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading
core/res/res/layout/notification_template_material_base.xml +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ android:visibility="gone" /> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading
core/res/res/layout/notification_template_material_compact_heads_up_base.xml +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ android:gravity="center_vertical" android:theme="@style/Theme.DeviceDefault.Notification" android:importantForAccessibility="no"> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading
core/res/res/layout/notification_template_material_media.xml +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ android:visibility="gone" /> <com.android.internal.widget.CachingIconView <com.android.internal.widget.NotificationRowIconView android:id="@+id/icon" android:layout_width="@dimen/notification_icon_circle_size" android:layout_height="@dimen/notification_icon_circle_size" Loading