Combine settings suggestion and condition.
- Add a flag in dashboard feature provider to specify whether to use the combined UI for suggestions and conditions. - Move Conditions below Suggestions. - Add dashboard entity for condition and suggestion container, and wrap the condition and suggestion list inside the container. The container itself will be a single dashboard item, and within it will be the list of suggestion or condition. - Add suggestion/condition header that will show the combined info for the conditions and suggestion data, and have the expand button to control expanding both the suggestion and condition list. - Change the individual condition card to be always expanded, and remove the logic to collapse/expand individual condition card. - Remove the divider between the action button and condition detail within each condition card. - Add suggestion/condition footer for collapsing the whole suggestion and condition list. Bug: 37645754 Test: make RunSettingsRoboTests Change-Id: I86df75f7e4551778f79d730851c03121fd0dcbdf
This commit is contained in:
@@ -196,13 +196,16 @@ public class DashboardSummary extends InstrumentedFragment
|
||||
mDashboard.addItemDecoration(new DashboardDecorator(getContext()));
|
||||
mDashboard.setListener(this);
|
||||
Log.d(TAG, "adapter created");
|
||||
mAdapter = new DashboardAdapter(getContext(), bundle, mConditionManager.getConditions());
|
||||
mAdapter = new DashboardAdapter(getContext(), bundle, mConditionManager.getConditions(),
|
||||
mSuggestionParser, this /* SuggestionDismissController.Callback */);
|
||||
mDashboard.setAdapter(mAdapter);
|
||||
mSuggestionDismissHandler = new SuggestionDismissController(
|
||||
if (!mDashboardFeatureProvider.combineSuggestionAndCondition()) {
|
||||
mSuggestionDismissHandler = new SuggestionDismissController(
|
||||
getContext(), mDashboard, mSuggestionParser, this);
|
||||
ConditionAdapterUtils.addDismiss(mDashboard);
|
||||
}
|
||||
mDashboard.setItemAnimator(new DashboardItemAnimator());
|
||||
mSummaryLoader.setSummaryConsumer(mAdapter);
|
||||
ConditionAdapterUtils.addDismiss(mDashboard);
|
||||
if (DEBUG_TIMING) {
|
||||
Log.d(TAG, "onViewCreated took "
|
||||
+ (System.currentTimeMillis() - startTime) + " ms");
|
||||
@@ -242,7 +245,7 @@ public class DashboardSummary extends InstrumentedFragment
|
||||
|
||||
@Override
|
||||
public Tile getSuggestionForPosition(int position) {
|
||||
return (Tile) mAdapter.getItem(mAdapter.getItemId(position));
|
||||
return mAdapter.getSuggestion(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user