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

Commit 92a86c4c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix get user profile icon issue"

parents c0de09d2 4598822b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm6.36 14.83c-1.43-1.74-4.9-2.33-6.36-2.33s-4.93.59-6.36 2.33C4.62 15.49 4 13.82 4 12c0-4.41 3.59-8 8-8s8 3.59 8 8c0 1.82-.62 3.49-1.64 4.83zM12 6c-1.94 0-3.5 1.56-3.5 3.5S10.06 13 12 13s3.5-1.56 3.5-3.5S13.94 6 12 6z"
        android:fillColor="#4285F4"/>
</vector>
 No newline at end of file
+7 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.documentsui.sidebar;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
@@ -54,6 +53,12 @@ public class AppItem extends Item {
        return component;
    }

    protected void bindIcon(ImageView icon) {
        final PackageManager pm = icon.getContext().getPackageManager();
        icon.setImageDrawable(info.loadIcon(pm));
    }


    protected void bindActionIcon(View actionIconArea, ImageView actionIcon) {
        actionIconArea.setVisibility(View.VISIBLE);
        actionIconArea.setFocusable(false);
@@ -77,11 +82,9 @@ public class AppItem extends Item {
        final View actionIconArea = convertView.findViewById(R.id.action_icon_area);
        final ImageView actionIcon = (ImageView) convertView.findViewById(R.id.action_icon);

        final Context context = convertView.getContext();
        final PackageManager pm = context.getPackageManager();
        icon.setImageDrawable(info.loadIcon(pm));
        titleView.setText(title);

        bindIcon(icon);
        bindActionIcon(actionIconArea, actionIcon);

        // TODO: match existing summary behavior from disambig dialog
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,11 @@ class ProfileItem extends AppItem {
        super(info, title, actionHandler);
    }

    @Override
    protected void bindIcon(ImageView icon) {
        icon.setImageResource(com.android.documentsui.R.drawable.ic_user_profile);
    }

    @Override
    protected void bindActionIcon(View actionIconArea, ImageView actionIcon) {
        actionIconArea.setVisibility(View.GONE);