Skip to content
Snippets Groups Projects
Commit 1f2e080f authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "Disallow loading icon from content URI to PipMenu" into sc-dev

parents 0a11e8a7 4bf71d74
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,7 @@ import android.content.Intent;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
......@@ -462,13 +463,19 @@ public class PipMenuView extends FrameLayout {
final PipMenuActionView actionView =
(PipMenuActionView) mActionsGroup.getChildAt(i);
// TODO: Check if the action drawable has changed before we reload it
action.getIcon().loadDrawableAsync(mContext, d -> {
if (d != null) {
d.setTint(Color.WHITE);
actionView.setImageDrawable(d);
}
}, mMainHandler);
final int iconType = action.getIcon().getType();
if (iconType == Icon.TYPE_URI || iconType == Icon.TYPE_URI_ADAPTIVE_BITMAP) {
// Disallow loading icon from content URI
actionView.setImageDrawable(null);
} else {
// TODO: Check if the action drawable has changed before we reload it
action.getIcon().loadDrawableAsync(mContext, d -> {
if (d != null) {
d.setTint(Color.WHITE);
actionView.setImageDrawable(d);
}
}, mMainHandler);
}
actionView.setContentDescription(action.getContentDescription());
if (action.isEnabled()) {
actionView.setOnClickListener(v -> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment