Merge "Make Thumbnail search result launch intents" into sc-dev am: e3884455fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13426116 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ia78c0a79ed5a1273940528ab58978af28b754030
This commit is contained in:
commit
59933c92b2
2 files changed
+13
No files matched your search
@@ -23,6 +23,7 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.core.graphics.drawable.RoundedBitmapDrawable;
|
||||
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
|
||||
@@ -55,6 +56,14 @@ public class SearchResultThumbnailView extends androidx.appcompat.widget.AppComp
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
setOnFocusChangeListener(Launcher.getLauncher(getContext()).getFocusHandler());
|
||||
setOnClickListener(this);
|
||||
setOnLongClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(SearchTarget parentTarget, List<SearchTarget> children) {
|
||||
mSearchTarget = parentTarget;
|
||||
@@ -65,6 +74,9 @@ public class SearchResultThumbnailView extends androidx.appcompat.widget.AppComp
|
||||
parentTarget.getPackageName(),
|
||||
parentTarget.getUserHandle(),
|
||||
parentTarget.getSearchAction().getTitle());
|
||||
itemInfo.setIntent(parentTarget.getSearchAction().getIntent());
|
||||
itemInfo.setPendingIntent(parentTarget.getSearchAction().getPendingIntent());
|
||||
|
||||
bitmap = ((BitmapDrawable) itemInfo.getIcon()
|
||||
.loadDrawable(getContext())).getBitmap();
|
||||
// crop
|
||||
|
||||
@@ -112,6 +112,7 @@ public class SearchTargetUtil {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW)
|
||||
.setData(Uri.parse("uri blah blah"))
|
||||
.setType("image/*")
|
||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
Bitmap bitmap = Bitmap.createBitmap(1000, 500, Bitmap.Config.ARGB_8888);
|
||||
|
||||
Reference in new issue
Block a user