mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Moving apps search related logic into a custom layout file
This will allow derivative projects to easily change the search behavior by simply overriding the xml file Bug: 37616877 Change-Id: Ib8d6a2dab06819a52611e9a3d97c70c5a49bbf97
This commit is contained in:
@@ -30,9 +30,11 @@ import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.launcher3.AppInfo;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.compat.LauncherAppsCompat;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -149,4 +151,20 @@ public class PackageManagerHelper {
|
||||
.appendQueryParameter("id", packageName)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new market search intent.
|
||||
*/
|
||||
public static Intent getMarketSearchIntent(Context context, String query) {
|
||||
try {
|
||||
Intent intent = Intent.parseUri(context.getString(R.string.market_search_intent), 0);
|
||||
if (!TextUtils.isEmpty(query)) {
|
||||
intent.setData(
|
||||
intent.getData().buildUpon().appendQueryParameter("q", query).build());
|
||||
}
|
||||
return intent;
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user