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
- 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
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
This allows Settings to test against the latest framework changes.
Also replaced TestConfig with traditional robolectric.properties.
Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
- 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
- instead of using hard-coded width for 1 or 2 cards, they should take
up the whole screen width minus the defined padding, so that when the
device is in landscape mode, they look better.
Change-Id: Ic6485c858c7742a154a6d9b05fff180f161be323
Fixes: 72850225
Test: 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
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
Convert input device search into a search query loader
And remove old logic from DynamicIndexableContentMonitor
Change-Id: If652b1ea7c8add9185bbd025055e14925d3a8eec
Bug: 64310452
Bug: 63831980
Test: robotests
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
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.
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
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
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.
Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
- 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
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