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

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

Merge "Animate the priority ring in the onboarding" into rvc-dev am: 675d4a78

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11795077

Change-Id: Id6fad7790eb0a8c70568acf4444af23a62b3f539
parents 56fbd2cb 675d4a78
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3957,6 +3957,13 @@
  <java-symbol type="id" name="conversation_unread_count" />
  <java-symbol type="string" name="unread_convo_overflow" />
  <java-symbol type="style" name="TextAppearance.DeviceDefault.Notification.Conversation.AppName" />
  <java-symbol type="drawable" name="conversation_badge_background" />
  <java-symbol type="drawable" name="conversation_badge_ring" />
  <java-symbol type="color" name="conversation_important_highlight" />
  <java-symbol type="dimen" name="importance_ring_stroke_width" />
  <java-symbol type="dimen" name="importance_ring_anim_max_stroke_width" />
  <java-symbol type="dimen" name="importance_ring_size" />
  <java-symbol type="dimen" name="conversation_icon_size_badged" />

  <!-- Intent resolver and share sheet -->
  <java-symbol type="string" name="resolver_personal_tab" />
+2 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public class ConversationIconFactory extends BaseIconFactory {
    /**
     * Returns the conversation info drawable
     */
    private Drawable getBaseIconDrawable(ShortcutInfo shortcutInfo) {
    public Drawable getBaseIconDrawable(ShortcutInfo shortcutInfo) {
        return mLauncherApps.getShortcutIconDrawable(shortcutInfo, mFillResIconDpi);
    }

@@ -94,7 +94,7 @@ public class ConversationIconFactory extends BaseIconFactory {
     * Get the {@link Drawable} that represents the app icon, badged with the work profile icon
     * if appropriate.
     */
    private Drawable getAppBadge(String packageName, int userId) {
    public Drawable getAppBadge(String packageName, int userId) {
        Drawable badge = null;
        try {
            final ApplicationInfo appInfo = mPackageManager.getApplicationInfoAsUser(
+53 −3
Original line number Diff line number Diff line
@@ -38,11 +38,61 @@
        android:background="@drawable/rounded_bg_full"
        >

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:padding="12dp"
        android:layout_gravity="center_horizontal"
    >

        <!-- Big icon: 52x52, 12dp padding left + top, 16dp padding right -->
        <ImageView
            android:id="@+id/conversation_icon"
            android:layout_width="@dimen/notification_guts_conversation_icon_size"
            android:layout_height="@dimen/notification_guts_conversation_icon_size"
            android:layout_gravity="center_horizontal" />
            android:layout_width="@*android:dimen/conversation_avatar_size"
            android:layout_height="@*android:dimen/conversation_avatar_size"
            android:scaleType="centerCrop"
            android:importantForAccessibility="no"
        />

        <FrameLayout
            android:id="@+id/conversation_icon_badge"
            android:layout_width="@*android:dimen/conversation_icon_size_badged"
            android:layout_height="@*android:dimen/conversation_icon_size_badged"
            android:layout_marginLeft="@*android:dimen/conversation_badge_side_margin"
            android:layout_marginTop="@*android:dimen/conversation_badge_side_margin"
            android:clipChildren="false"
            android:clipToPadding="false"
        >
            <ImageView
                android:id="@+id/conversation_icon_badge_bg"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:src="@*android:drawable/conversation_badge_background"
                android:forceHasOverlappingRendering="false"
            />
            <ImageView
                android:id="@+id/icon"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="4dp"
                android:layout_gravity="center"
                android:forceHasOverlappingRendering="false"
            />
            <ImageView
                android:id="@+id/conversation_icon_badge_ring"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@*android:drawable/conversation_badge_ring"
                android:forceHasOverlappingRendering="false"
                android:clipToPadding="false"
                android:scaleType="center"
            />
        </FrameLayout>
    </FrameLayout>

        <TextView
            android:id="@+id/title"
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public final class Prefs {
        String HAS_SEEN_BUBBLES_MANAGE_EDUCATION = "HasSeenBubblesManageOnboarding";
        String CONTROLS_STRUCTURE_SWIPE_TOOLTIP_COUNT = "ControlsStructureSwipeTooltipCount";
        /** Tracks whether the user has seen the onboarding screen for priority conversations */
        String HAS_SEEN_PRIORITY_ONBOARDING = "HaveShownPriorityOnboarding";
        String HAS_SEEN_PRIORITY_ONBOARDING = "HasUserSeenPriorityOnboarding";
    }

    public static boolean getBoolean(Context context, @Key String key, boolean defaultValue) {
+4 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
@@ -540,7 +541,9 @@ public class NotificationConversationInfo extends LinearLayout implements
                .setView(onboardingView)
                .setIgnoresDnd(ignoreDnd)
                .setShowsAsBubble(showAsBubble)
                .setIcon(((ImageView) findViewById(R.id.conversation_icon)).getDrawable())
                .setIcon(mIconFactory.getBaseIconDrawable(mShortcutInfo))
                .setBadge(mIconFactory.getAppBadge(
                        mPackageName, UserHandle.getUserId(mSbn.getUid())))
                .setOnSettingsClick(mOnConversationSettingsClickListener)
                .build();

Loading