- The SuggestionControllerMixin is needed to dismiss a suggestion.
- When swipe a suggestion, SuggestionControllerMixin is called, which
then calls API in SuggestionService to dismiss a suggestion.
Bug: 65065268
Test: robotests
Change-Id: I6a0c5823d60b995ab4a36b1c91777f5cd31a500d
- Add flag to switch between old/new implementation
- Add SuggestionLoader to load using Loader (instead of AsyncTask)
- Update DashboardAdapater/SuggestionAdapter to take List<Suggestion>
- Marked old getter/setters as @Deprecated and added comment
- Update tests to cover suggestionV2 adapter changes.
TODO:
- Handler for dismissing suggestion not set up yet.
- Suggestion data structure is incomplete (missing icon, remote view, etc)
- Need to extend Suggestion data strcture to support icon and
remote view binding
Bug: 65065268
Test: robotests
Change-Id: I2378ef4c9edee972d5de93c3868068e2cde23f56
In monkey test, the suggestions list can become null. So, add check
for valid suggestions list before trying to iterate through the
suggestions.
Fixes: 64757618
Test: make RunSettingsRoboTests
Change-Id: Ib670808a4f222187b9cd53d7d939e71b5ce8dbae
When the suggestions are in default mode and the number of suggestions
are more than the default count, we set the sublist of the suggestions
list as the suggestion adapter data. In this case, operation on the list
should be done in the sublist instead of the original list to maintain
the list consistency check.
Hence, when dismissing the suggestion, change to remove the suggestion
from the suggestion adapter instead of from the dashboard adapter, so
that any following interaction with the suggestions will not trigger the
concurrent modification exception.
Bug: 64279080
Test: make RunSettingsRoboTests
Change-Id: I970b6af8a1c72bc0c3ee89fef890ae6a669c71d2
- when creating the dashboard data, pass the sublist of suggestions to
cap the total number of suggestions to be shown to 5.
- if user swipe away the suggestion, it will only remove the suggestion
from the suggestion adapater, and will not trigger rebuilding the whole
UI.
Bug: 64072051
Change-Id: I1efabeb2a805c670007c631d3ccb0fdfbde7b55a
Fix: 63309218
Test: make RunSettingsRoboTests
Check for non-empty suggestions instead of non-null suggestions when
trying to determine whether to show conditions or suggestions list.
Change-Id: Icdb8ad485af436f5d84ce0a746081fc59bd613db
Merged-In: Icdb8ad485af436f5d84ce0a746081fc59bd613db
Fix: 63674269
Test: make RunSettingsRoboTests
Adjust the top/bottom padding for the header and footer so that the
content is center-aligned.
Change-Id: I01c0baf770abf3a8767a016a758ee1794403598b
Fix: 63670820
Test: Visual
Check for non-empty suggestions instead of non-null suggestions when
trying to determine whether to show conditions or suggestions list.
Change-Id: Icdb8ad485af436f5d84ce0a746081fc59bd613db
Fix: 63674269
Test: make RunSettingsRoboTests
- changed suggestion/condition and searchbox background color to
#F2F2F2
- changed condition card background color to #F8F8F8
- removed Suggestion header
- reduced space above condition header/footer by 9dp
Bug: 63393599
Test: make RunSettingsRoboTests
Change-Id: I268934e3a573b542480c0b21dbab68b7217295b5
We only ever display a single DashboardCategory in homepaeg, so the
category doesn't need to be a list in DashboardData/Adapter
Change-Id: I57db02bb45cbc511f0fce1bf33043b51ef9db15c
Fix: 33861822
Test: updated robotests
When suggestion loader takes longer time to complete, we will first show
the dashboard with just the categories, and refresh the UI when the
suggestion is ready. However, we only tint the icon when we update both
the categories and suggestions, and hence in some case, some tile
results with icon not being tinted.
Change-Id: I023d50655349731b03c7d7aff153d2cbbd8c63e0
Fix: 37456962
Test: make RunSettingsRoboTests
Change to always use the new UI that combines the suggestion and conditions,
and remove all codes relating to the old UI.
Fix: 37645754
Fix: 62621808
Test: make RunSettingsRoboTests
Merged-In: I3421a9e5182f6606843392d6fae8b9f07c5f2e46
Change-Id: I5ef169a563166520dad0ac44f6780da814e2f1f7
Change to always use the new UI that combines the suggestion and conditions,
and remove all codes relating to the old UI.
Bug: 37645754
Bug: 62621808
Test: make RunSettingsRoboTests
Change-Id: I3421a9e5182f6606843392d6fae8b9f07c5f2e46
The dashboard spacer has been removed, but the remaining indexing is not
modified correspondingly, which results in mismatched dashboard types.
Set the dashboard header position back to 0.
Change-Id: I732c4ada556d5d4325e357b8325f66ded5cbe952
Fix: 63052534
Test: make RunSettingsRoboTests
Various tweaks to match redlines:
- background is now grey all the time
- the search icon is aligned with the other icons
- the title text is primary colored instead of accent colored
- the background of search bar doesn't scroll anymore
Deletes a bunch of logic to add an initial view that would be
colored based on the first view. It never quite worked right.
Now it's consistent and never moves.
Bug: 37477506
Fixes: 62267378
Fixes: 62379978
Fixes: 62361213
Test: robotests
Change-Id: Iddfd45a64a0a8d0365397a207889d7225d1ebb70
Merged-In: I82c584e8f8ecc6fc298c5cdbce08516c6a069a39
Various tweaks to match redlines:
- background is now grey all the time
- the search icon is aligned with the other icons
- the title text is primary colored instead of accent colored
- the background of search bar doesn't scroll anymore
Deletes a bunch of logic to add an initial view that would be
colored based on the first view. It never quite worked right.
Now it's consistent and never moves.
Bug: 37477506
Change-Id: I82c584e8f8ecc6fc298c5cdbce08516c6a069a39
Fixes: 62267378
Fixes: 62379978
Fixes: 62361213
Test: robotests
If the suggestion is marked as isIconTintable, tint the icon with
colorControlNormal.
Test: cd tests/robotests && mma
Bug: 62258845
Change-Id: I2a76181d9b8b4d9fbf496a8fc605cb762bba87c0
In the new suggestion UI, the suggestions are listed inside the
suggestion container instead of individual dashboard items. When there
is only a single suggestion shown, and that is being swiped away, the
actual list for the suggestions will handle the swipe and remove that
list item from the list. However, the top level container will remain
until next time the dashboard list is being refreshed. Explicitly set
the suggestions to null to force refreshing of the dashboard UI.
Change-Id: I37f8c8f5a813a5c56f4f2f46103fdbb66ce97fcd
Fix: 62639824
Test: make RunSettingsRoboTests
DashboardCategory is no longer rendered in the dashboard ui
Bug: 33861822
Test: make RunSettingsRoboTests existing tests still pass
Change-Id: I0479967b0099f76f8c0c7894643d50b655de2892
- 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
Replaces the default Toolbar in SettingsActivity with one that looks
like a search bar. It uses a Toolbar inside a CardView with some custom
styling.
Since the search bar is a floating element, the new toolbar lives in the
content frame of the dashboard. A FrameLayout is used to provide the
layering that is desired.
Since the search bar is on top, an additional spacer view is added to
the list of items in the dashboard. Its color changes based on what
the first view is so that it always matches.
Adds android-support-v7-cardview as a dependency (and reorders the
other deps to be in alphabetical order).
Remaining work (in future CLs):
- remove search menu option?
- clean up initial window
- remove the line between the header and the first condition
when there's a condition
Bug: 37477506
Test: make RunSettingsRoboTests
Change-Id: Id7477b90fbaf30eb5cac1ee244c847bddb95b3fd
When suggestions are swiped away, refresh the suggestion categories
so that suggestions previously suppressed because it's lower priority
or because there is an exclusive suggestion now has a chance to be
shown.
Test: cd tests/robotests && mma
Bug: 36811621
Change-Id: I1a1ae1624c2f69153d95d238b2143ac9273e117d
Remove all the views before adding the remote views again, so the
card will not have multiple custom views on top of each other.
Test: cd tests/robotests && mma
Change-Id: Id41bfb962c08e8d1ee6534e0cf44d173a1f1910f
If a suggeested action Tile has a remote view defined, inflate a card
layout to contain the remote view, instead of showing the default
title-summary layout.
Additionally, if the remote view has a view with ID
@android:id/primary, that will be used as the click target rather
than the entire card.
Test: cd tests/robotests && mma
Bug: 35668836
Change-Id: I0fd1b9c637b6d7a3d7d2f6268669917408a882eb
And refactored the getIdent logic into feature provider.
Change-Id: Id6f66a6942cbaf6d26ae4dca62037a6cf01179a5
Fix: 36314240
Test: make RunSettingsRoboTests
- Move dismiss suggestion logic into feature provider
- In DashboardData, use hashcode as suggestion's stable id. This is much
more likely to provide a truely stable id for each suggestion card.
Eventually I want to use hash for all tiles to provide stable id.
- Add a SuggestionDismissionController to handle swipe to dismiss
callbacks
Change-Id: If3770f07a90c5469a0b86fc28f3eb5e4c17227cd
Fix: 35159816
Test: make RunSettingsRoboTests
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.
Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
Previously if there was three suggestions in the suggestions view, all
three would be logged as shown, although by default only two of them are
shown and the third one is shown only if the view is expanded. Now, only
the actual shown items will be logged.
Test: RunSettingsRoboTests
Fixes: b/35348496
Change-Id: Ic3af7961b4713f48e63c51ac599cb55bf69975ff
Use DashboardFeatureProvider to open tile instead. This makes logic more
centralized in one place, and makes logging easier in the future.
Bug: 30137094
Test: RunSettingsRoboTests
Change-Id: I8a028bb7cac8f70f6c237f253be8668cc3ef257e
Set the icon tint color to colorControlNormal for components not in
settings package.
Change-Id: I6b822b355eb706693a0af4e5832407064cd2b2c2
Fix: 34192209
Test: Visual
1. When condition is inserted, only scroll to top when previous
position is at the top.
2. Clean condition status after it is removed. So the next time
you insert a condition view, it will always be collapsed.
Bug: 33839780
Bug: 34115341
Test: make -j40 RunSettingsRoboTests
Change-Id: I7f48524917c3119ec24b2f67ba506f381573a391
Sometimes the airplane mode banner will show up even
though airplane mode is not on. Logging has been added
to several areas around this condition in addition to
where the actual view is created. This will be used
to try and get a better handle on what the source of
the bug is.
Test: manual
Bug: 30860132
Change-Id: I7213aa7e187c5a8c0e94a5ce7a3269e6667cd61b
When there is no offset change for identical holder in
animateChange, simply return and don't invoke the
resetAnimation.
Bug: 33198024
Test: make RunSettingsRoboTests
Change-Id: Ib83363873bc5f51e5bd71af5a013ee0756728d1a