Loading searchuilib/src/com/android/app/search/LayoutType.java +16 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,14 @@ public class LayoutType { public static final String SMALL_ICON_HORIZONTAL_TEXT = "short_icon_row"; public static final String SMALL_ICON_HORIZONTAL_TEXT_THUMBNAIL = "short_icon_row_thumbnail"; // This layout contains a series of thumbnails (currently up to 3 per row) // This layout contains a series of icon results (currently up to 4 per row). // The container does not support stretching for its children, and can only contain // {@link #ICON_SINGLE_VERTICAL_TEXT} layout types. public static final String ICON_CONTAINER = "icon_container"; // This layout contains a series of thumbnails (currently up to 3 per row). // The container supports stretching for its children, and can only contain {@link #THUMBNAIL} // layout types. public static final String THUMBNAIL_CONTAINER = "thumbnail_container"; // This layout creates a container for people grouping Loading Loading @@ -92,4 +99,12 @@ public class LayoutType { // Layout for a quick settings tile public static final String QS_TILE = "qs_tile"; // Placeholder for web suggest. public static final String PLACEHOLDER = "placeholder"; // Placeholder for rich answer cards. // Only available on or above version code 3. public static final String RICHANSWER_PLACEHOLDER = "richanswer_placeholder"; } searchuilib/src/com/android/app/search/QueryExtras.java +3 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.app.search; import android.app.search.Query; import android.os.Bundle; /** * Utility class used to define implicit contract between aiai and launcher regarding Loading @@ -37,4 +36,7 @@ public class QueryExtras { // This value overrides the timeout that is defined inside {@link SearchContext#getTimeout} public static final String EXTRAS_KEY_TIMEOUT_OVERRIDE = "timeout"; // Used to know which target is deleted. public static final String EXTRAS_BUNDLE_DELETED_TARGET_ID = "deleted_target_id"; } searchuilib/src/com/android/app/search/SearchActionExtras.java +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ public class SearchActionExtras { public static final String BUNDLE_EXTRA_IS_SEARCH_IN_APP = "is_search_in_app"; public static final String BUNDLE_EXTRA_BADGE_WITH_COMPONENT_NAME = "badge_with_component_name"; public static final String BUNDLE_EXTRA_ICON_CACHE_KEY = "icon_cache_key"; public static final String BUNDLE_EXTRA_ICON_TOKEN_INTEGER = "icon_integer"; public static final String BUNDLE_EXTRA_SHOULD_START = "should_start"; public static final String BUNDLE_EXTRA_SHOULD_START_FOR_RESULT = "should_start_for_result"; public static final String BUNDLE_EXTRA_SUGGESTION_ACTION_TEXT = "suggestion_action_text"; Loading searchuilib/src/com/android/app/search/SearchTargetConverter.java +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static com.android.app.search.SearchActionExtras.BUNDLE_EXTRA_HIDE_SUBTIT import static com.android.app.search.SearchTargetExtras.BUNDLE_EXTRA_CLASS; import static com.android.app.search.SearchTargetExtras.BUNDLE_EXTRA_SUBTITLE_OVERRIDE; import static com.android.app.search.SearchTargetExtras.BUNDLE_EXTRA_SUPPORT_QUERY_BUILDER; import static com.android.app.search.SearchTargetExtras.EXTRAS_RECENT_BLOCK_TARGET; import android.app.search.SearchAction; import android.app.search.SearchTarget; Loading Loading @@ -49,6 +50,7 @@ public class SearchTargetConverter { searchTargetBundle.putBoolean(BUNDLE_EXTRA_HIDE_SUBTITLE, false); searchTargetBundle.putString(BUNDLE_EXTRA_SUBTITLE_OVERRIDE, subtitle); searchTargetBundle.putBoolean(BUNDLE_EXTRA_HIDE_ICON, false); searchTargetBundle.putBoolean(EXTRAS_RECENT_BLOCK_TARGET, true); SearchTarget.Builder builder = new SearchTarget.Builder(resultType, SMALL_ICON_HORIZONTAL_TEXT, searchTarget.getId()) Loading searchuilib/src/com/android/app/search/SearchTargetExtras.java +15 −4 Original line number Diff line number Diff line Loading @@ -32,15 +32,15 @@ import androidx.annotation.Nullable; public class SearchTargetExtras { /** on device data related extras and helper methods */ // Used to extra component name // Used to extra component name. public static final String BUNDLE_EXTRA_CLASS = "class"; // Used for UI treatment. Labels whether search target should support quick launch // Used for UI treatment. Labels whether search target should support quick launch. public static final String BUNDLE_EXTRA_QUICK_LAUNCH = "quick_launch"; // Used for UI treatment. Targets grouped with same group id are decorated together. public static final String BUNDLE_EXTRA_GROUP_ID = "group_id"; public static final String BUNDLE_EXTRA_GROUP_DECORATE_TOGETHER = "decorate_together"; // Used if slice title should be rendered else where outside of slice (e.g., edit text) // Used if slice title should be rendered else where outside of slice (e.g., edit text). public static final String BUNDLE_EXTRA_SLICE_TITLE = "slice_title"; // Used if slice view should be rendered using full height mode. public static final String BUNDLE_EXTRA_USE_FULL_HEIGHT = "use_full_height"; Loading @@ -56,12 +56,15 @@ public class SearchTargetExtras { public static final String BUNDLE_EXTRA_RESULT_MATCH_USER_TYPED = "result_match_user_typed"; // Used for logging. Returns the timestamp when system service received the data. public static final String BUNDLE_EXTRA_START_TIMESTAMP = "start_timestamp"; // Indicates the search result app location column // Indicates the search result app location column. public static final String BUNDLE_EXTRA_RESULT_APP_GRIDX = "app_gridx"; // Used for thumbnail loading. Contains handle to retrieve Blobstore asset. public static final String BUNDLE_EXTRA_BLOBSTORE_HANDLE = "blobstore_handle_key"; // Used to denote this searchTarget is for recent block in 0-state. public static final String EXTRAS_RECENT_BLOCK_TARGET = "recent_block_target"; public static final int GROUPING = 1 << 1; @Nullable Loading Loading @@ -90,6 +93,14 @@ public class SearchTargetExtras { BUNDLE_EXTRA_BLOBSTORE_HANDLE) instanceof BlobHandle; } /** Check if SearchTarget contains information to tell if this target is from recent block. */ public static boolean isSearchTargetRecentItem(@Nullable SearchTarget target) { if (isTargetOrExtrasNull(target)) { return false; } return target.getExtras().getBoolean(EXTRAS_RECENT_BLOCK_TARGET, false); } private static boolean isTargetOrExtrasNull(@Nullable SearchTarget target) { return target == null || target.getExtras() == null; } Loading Loading
searchuilib/src/com/android/app/search/LayoutType.java +16 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,14 @@ public class LayoutType { public static final String SMALL_ICON_HORIZONTAL_TEXT = "short_icon_row"; public static final String SMALL_ICON_HORIZONTAL_TEXT_THUMBNAIL = "short_icon_row_thumbnail"; // This layout contains a series of thumbnails (currently up to 3 per row) // This layout contains a series of icon results (currently up to 4 per row). // The container does not support stretching for its children, and can only contain // {@link #ICON_SINGLE_VERTICAL_TEXT} layout types. public static final String ICON_CONTAINER = "icon_container"; // This layout contains a series of thumbnails (currently up to 3 per row). // The container supports stretching for its children, and can only contain {@link #THUMBNAIL} // layout types. public static final String THUMBNAIL_CONTAINER = "thumbnail_container"; // This layout creates a container for people grouping Loading Loading @@ -92,4 +99,12 @@ public class LayoutType { // Layout for a quick settings tile public static final String QS_TILE = "qs_tile"; // Placeholder for web suggest. public static final String PLACEHOLDER = "placeholder"; // Placeholder for rich answer cards. // Only available on or above version code 3. public static final String RICHANSWER_PLACEHOLDER = "richanswer_placeholder"; }
searchuilib/src/com/android/app/search/QueryExtras.java +3 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.app.search; import android.app.search.Query; import android.os.Bundle; /** * Utility class used to define implicit contract between aiai and launcher regarding Loading @@ -37,4 +36,7 @@ public class QueryExtras { // This value overrides the timeout that is defined inside {@link SearchContext#getTimeout} public static final String EXTRAS_KEY_TIMEOUT_OVERRIDE = "timeout"; // Used to know which target is deleted. public static final String EXTRAS_BUNDLE_DELETED_TARGET_ID = "deleted_target_id"; }
searchuilib/src/com/android/app/search/SearchActionExtras.java +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ public class SearchActionExtras { public static final String BUNDLE_EXTRA_IS_SEARCH_IN_APP = "is_search_in_app"; public static final String BUNDLE_EXTRA_BADGE_WITH_COMPONENT_NAME = "badge_with_component_name"; public static final String BUNDLE_EXTRA_ICON_CACHE_KEY = "icon_cache_key"; public static final String BUNDLE_EXTRA_ICON_TOKEN_INTEGER = "icon_integer"; public static final String BUNDLE_EXTRA_SHOULD_START = "should_start"; public static final String BUNDLE_EXTRA_SHOULD_START_FOR_RESULT = "should_start_for_result"; public static final String BUNDLE_EXTRA_SUGGESTION_ACTION_TEXT = "suggestion_action_text"; Loading
searchuilib/src/com/android/app/search/SearchTargetConverter.java +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static com.android.app.search.SearchActionExtras.BUNDLE_EXTRA_HIDE_SUBTIT import static com.android.app.search.SearchTargetExtras.BUNDLE_EXTRA_CLASS; import static com.android.app.search.SearchTargetExtras.BUNDLE_EXTRA_SUBTITLE_OVERRIDE; import static com.android.app.search.SearchTargetExtras.BUNDLE_EXTRA_SUPPORT_QUERY_BUILDER; import static com.android.app.search.SearchTargetExtras.EXTRAS_RECENT_BLOCK_TARGET; import android.app.search.SearchAction; import android.app.search.SearchTarget; Loading Loading @@ -49,6 +50,7 @@ public class SearchTargetConverter { searchTargetBundle.putBoolean(BUNDLE_EXTRA_HIDE_SUBTITLE, false); searchTargetBundle.putString(BUNDLE_EXTRA_SUBTITLE_OVERRIDE, subtitle); searchTargetBundle.putBoolean(BUNDLE_EXTRA_HIDE_ICON, false); searchTargetBundle.putBoolean(EXTRAS_RECENT_BLOCK_TARGET, true); SearchTarget.Builder builder = new SearchTarget.Builder(resultType, SMALL_ICON_HORIZONTAL_TEXT, searchTarget.getId()) Loading
searchuilib/src/com/android/app/search/SearchTargetExtras.java +15 −4 Original line number Diff line number Diff line Loading @@ -32,15 +32,15 @@ import androidx.annotation.Nullable; public class SearchTargetExtras { /** on device data related extras and helper methods */ // Used to extra component name // Used to extra component name. public static final String BUNDLE_EXTRA_CLASS = "class"; // Used for UI treatment. Labels whether search target should support quick launch // Used for UI treatment. Labels whether search target should support quick launch. public static final String BUNDLE_EXTRA_QUICK_LAUNCH = "quick_launch"; // Used for UI treatment. Targets grouped with same group id are decorated together. public static final String BUNDLE_EXTRA_GROUP_ID = "group_id"; public static final String BUNDLE_EXTRA_GROUP_DECORATE_TOGETHER = "decorate_together"; // Used if slice title should be rendered else where outside of slice (e.g., edit text) // Used if slice title should be rendered else where outside of slice (e.g., edit text). public static final String BUNDLE_EXTRA_SLICE_TITLE = "slice_title"; // Used if slice view should be rendered using full height mode. public static final String BUNDLE_EXTRA_USE_FULL_HEIGHT = "use_full_height"; Loading @@ -56,12 +56,15 @@ public class SearchTargetExtras { public static final String BUNDLE_EXTRA_RESULT_MATCH_USER_TYPED = "result_match_user_typed"; // Used for logging. Returns the timestamp when system service received the data. public static final String BUNDLE_EXTRA_START_TIMESTAMP = "start_timestamp"; // Indicates the search result app location column // Indicates the search result app location column. public static final String BUNDLE_EXTRA_RESULT_APP_GRIDX = "app_gridx"; // Used for thumbnail loading. Contains handle to retrieve Blobstore asset. public static final String BUNDLE_EXTRA_BLOBSTORE_HANDLE = "blobstore_handle_key"; // Used to denote this searchTarget is for recent block in 0-state. public static final String EXTRAS_RECENT_BLOCK_TARGET = "recent_block_target"; public static final int GROUPING = 1 << 1; @Nullable Loading Loading @@ -90,6 +93,14 @@ public class SearchTargetExtras { BUNDLE_EXTRA_BLOBSTORE_HANDLE) instanceof BlobHandle; } /** Check if SearchTarget contains information to tell if this target is from recent block. */ public static boolean isSearchTargetRecentItem(@Nullable SearchTarget target) { if (isTargetOrExtrasNull(target)) { return false; } return target.getExtras().getBoolean(EXTRAS_RECENT_BLOCK_TARGET, false); } private static boolean isTargetOrExtrasNull(@Nullable SearchTarget target) { return target == null || target.getExtras() == null; } Loading