Support contextual suggestion

- add a suggestion layout
- add an interface to get fragment in suggestion feature provider
- remove the first preference category of homepage IA to align its top
  with the bottom of the search box

Bug: 173768418
Test: robotest
Change-Id: I784e3eef29ca474c4c89f07b916c6500fabbf7d4
This commit is contained in:
Jason Chiu
2020-11-20 17:16:41 +08:00
parent 3932b07365
commit bd854ccd10
8 changed files with 148 additions and 40 deletions

View File

@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
/** Interface should be implemented if you have added new suggestions */
public interface SuggestionFeatureProvider {
@@ -42,4 +43,9 @@ public interface SuggestionFeatureProvider {
* Returns the {@link SharedPreferences} that holds metadata for suggestions.
*/
SharedPreferences getSharedPrefs(Context context);
/**
* Returns the class of {@link Fragment} that supports contextual suggestion.
*/
Class<? extends Fragment> getContextualSuggestionFragment();
}