Merge "Use "mid" stable id for condition cards conditionally." into oc-mr1-dev am: a42e9351c5

am: 3f070569a6

Change-Id: I7bf58afdb746d70b2a2728875b83d0f0c547d51e
This commit is contained in:
Fan Zhang
2017-09-16 00:40:43 +00:00
committed by android-build-merger
2 changed files with 52 additions and 15 deletions

View File

@@ -198,15 +198,22 @@ public class DashboardData {
final int hiddenSuggestion =
hasSuggestions ? sizeOf(mSuggestions) - sizeOf(suggestions) : 0;
final boolean hasSuggestionAndCollapsed = hasSuggestions
&& mSuggestionConditionMode == HEADER_MODE_COLLAPSED;
final boolean onlyHasConditionAndCollapsed = !hasSuggestions
&& hasConditions
&& mSuggestionConditionMode != HEADER_MODE_FULLY_EXPANDED;
/* Top suggestion/condition header. This will be present when there is any suggestion
* and the mode is collapsed, or it only has conditions and the mode is not fully
* expanded. */
* and the mode is collapsed */
addToItemList(new SuggestionConditionHeaderData(conditions, hiddenSuggestion),
R.layout.suggestion_condition_header,
STABLE_ID_SUGGESTION_CONDITION_TOP_HEADER,
hasSuggestions && mSuggestionConditionMode == HEADER_MODE_COLLAPSED
|| !hasSuggestions && hasConditions
&& mSuggestionConditionMode != HEADER_MODE_FULLY_EXPANDED);
STABLE_ID_SUGGESTION_CONDITION_TOP_HEADER, hasSuggestionAndCollapsed);
/* Use mid header if there is only condition & it's in collapsed mode */
addToItemList(new SuggestionConditionHeaderData(conditions, hiddenSuggestion),
R.layout.suggestion_condition_header,
STABLE_ID_SUGGESTION_CONDITION_MIDDLE_HEADER, onlyHasConditionAndCollapsed);
/* Suggestion container. This is the card view that contains the list of suggestions.
* This will be added whenever the suggestion list is not empty */