And switch to getId() instead of title when comparing 2 tiles. This is
more accurate and more efficient.
Bug: 77600770
Test: robotests
Change-Id: I587d90702d98956bf7b420529ac3280351ca4a10
- Create a new ConditionManager that loads data and filters displayable
condtionals in memory
- Separete conditional controller logic and ui model
- Plumb new ui model into DashboardAdapater, and create a new
ConditionAdapter to manage UI.
Bug: 112485407
Test: robotests
Change-Id: If56d141d135341e9b8c2dc80e43c3d40b1de1340
dashboard package is not a real place for homepage stuff. Putting
Conditionals here makes it easier to refactor it for new homepage in the
future
Bug: 110405144
Bug: 112485407
Test: robotests
Change-Id: If433aeac8766124f0f4f6e5786b93ac1372bb745
And each page has ability to turn on/off rounded icons. This CL only
adds the flag, it doesn't actually change icon shape yet.
- Boolean config in xml
- New protected method for each DashboardFragment to load config
- Plumb the boolean into DashboardFeatureProvider for future use.
- Remove some unused APIs from DashboardFeatureProvider
Bug: 110405144
Fixes: 79748104
Test: robotests
Change-Id: Id34782e75aa7289967e4dd1f4fe2978688092702
This patch focused on fixing compile errors and some runtime errors.
Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
- when handling dismiss of suggestion card, need to check if the
dismissed suggestion can actually be removed from the current
suggestion list before trying to refresh the list.
Change-Id: Ia07b4cb76ef6c61a7d27184c3cba9d99fcc90bb3
Fixes: 76094746
Test: RunSettingsRoboTests
When a setting is injected to homepage, we now allow the setting
provider customize the background color for its icon.
If no custom bg color is provided, we fallback to existing behavior.
This behavior is only needed in homepage, because we don't have any
tinting logic in other pages so external setting providers can just
provide arbitrary icon.
Bug: 77188317
Test: robotests
Change-Id: I7d4b512fafc28537de46192026ce4bbe51b498c4
- Updated condition interface to use Drawable instead of Icon for icons.
- Converted all conditions to return drawable instead of Icon.
- Created a BatterySaverDrawable to draw a static battery saver icon.
Change-Id: Ie964f3439009c7658603a8ff352a05e964a0a795
Fixes: 76168403
Test: robotests
On homepage, if an icon is already wrapped in RoundedHomepageIcon, we
shouldn't wrap it more. Otherwise each time we do this it will add a few
dp padding around the bitmap.
Change-Id: I5313a38f4bd128272d7b4e05209aaee72c690c55
Fixes: 73295342
Test: robotest
- using sublist of the original suggestions list may results in
ConcurrentModificationException if the originaly list is being modified.
Create a new list instead to avoid running into the issue.
Change-Id: Ia83a0432be542eeb428d177f6118d26fc2262e93
Fixes: 74194336
Test: run monkey
- since we now either have 1 or 2 suggestions, putting most layout
configuration in the xml instead of dynamically setting it in code.
- remove the suggestion header
- vertical center align the suggestion title text for 2 cards to make
the card with single line looks better.
- tint all suggestions icons.
Change-Id: I0130f15d530264e164e5afd7c091f165a4a6adc2
Fixes: 70573674
Fixes: 73293989
Fixes: 64986736
Test: visual and make RunSettingsRoboTests
- reduce space above and below the suggestion header
- reduce space around the suggestion cardview
- set the font family for the suggestion header and title.
Change-Id: Ief6247005f1e69fe5025af60f3c9627d357d94a4
Fixes: 72710227
Test: visual
- remove the check for feature flag for suggestion UI v2 and switch to
use the v2 codes.
- remove all code related to v1 of suggestion UI
Fixes: 70573674
Test: make RunSettingsRoboTests
Change-Id: I99ab318c1c0192508a9c5e9e708e86319120d55b
- This is unfortunately necessary to avoid a jank when category
load completes before suggestion load, in which case user has to
manually scroll up to see the suggestions.
- We could technically just add scrollTo(0), but that causes the list
scroll on its own within 0.5 second of settings start, and that's bad.
Change-Id: I8dc869a69a5bf11bbf7644b281cc1778dd1a90e8
Fixes: 69068691
Test: visual
Test: robotests
When the dashboard summary is being initialized, it will rebuild the UI
while the summary loader tries to to go through the tiles to update the
summary. Both is being done on a separate backgroud thread, and it will
run into concurrent modification issue if the thread is being swapped
while one is looping through the list.
Instead of letting clients access the list of tiles directly, add a
getter method in DashboardCategory to get a copy of the list of tiles
for all read-only operations.
Change-Id: I479669abd8d1d0a8ee9a4113d8ad2244da56f4d8
Fixes: 69677575
Test: make RunSettingsRoboTests
- Remove show_suggestion logging in DashboardAdapater. Showing
suggestion is logged inside SuggestionAdapter during onBind.
- Remove hide_suggestion logging. It's not used by anyone.
- Move SuggestionLogHelper into SuggestionFeatureProvider
Bug: 65065268
Test: robotests
Change-Id: I1e7929d739b79527d2ae01c25177676f6be6ddff
- 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