Commit Graph

134 Commits

Author SHA1 Message Date
Doris Ling
83a6621b38 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
2017-06-02 14:59:48 -07:00
Fan Zhang
0a257ee1ba Add flag to control whether or not we should tint icons
Fix: 34365726
Test: robotests
Change-Id: Ic08d8590c9867fb0383da03f05237f74644a77ff
2017-04-28 09:54:33 -07:00
Fan Zhang
3c7ca105df Resolve intent before launching from DashboardFragment.
Once dashboard tile is displayed, the underlying intent can be disabled.
We will eventually hide the item from UI, but there can be a brief
moment before we are able to hide it. So to prevent user click and
launch a non-exist intent, we will try to resolve it first before
launching anything.

Change-Id: Ic8d790bf3c5d4d269eadb757f789a1641928a7b7
Fix: 36036097
Test: make RunSettingsRoboTests
2017-04-26 14:44:12 -07:00
Fan Zhang
320d60f0ad Fix some animation janks during code start.
- Create a   summary placeholder for preferences with summary.
- Create a totally empty summary for prefernces without summary.
- For all dynamic prefs that has *no* SummaryLoader, add meta to set
their summary to empty.
- Other dynamic perfs has   as initial summary.

By doing this, all dynamic pref's height is fixed and will not change as
we update summaries, thus eliminating jank during cold start in each
page.

Also removed DashboardAlias for notification preference and default apps as a side fix.

Change-Id: Iec98b7ffef4e920bf573b2244ad04124c1c5d154
Fix: 36414481
Test: make RunSettingsRoboTests
2017-03-21 13:20:18 -07:00
Fan Zhang
f0215712ba Disable collapse when fragment is opened from search
Change-Id: I9564dff4ec53256a0fe992055049cf65ce68e37b
Fix: 36076953
Test: make RunSettingsRoboTests
2017-03-15 15:21:34 -07:00
Doris Ling
f2cf2aea37 Remove code that check for dashboard feature.
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.

Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
2017-03-07 11:15:03 -08:00
Fan Zhang
ee45943177 Add logging whenever preference leads to intent.
Bug: 34774945
Test: make RunSettignsRoboTests
Change-Id: I694e5a0a2b614c695193c9c525991a1558e0a81a
2017-02-23 11:55:50 -08:00
Fan Zhang
cb287cfcd2 Add source metrics when launching top level setting items.
Change-Id: Idca6e136747fb40ba962307abd2620cdd241c3b1
Fix: 35359289
Test: make RunSettingsRoboTests
2017-02-16 10:25:49 -08:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08:00
Fan Zhang
fe9f0fda35 Add logging when "Advanced" button is clicked
Change-Id: I8259b1b863991935165afb19e34c30dcf5056acf
Fix: 35356464
Test: RunSettingsRoboTests
2017-02-15 15:12:26 -08:00
Fan Zhang
42aaa53e75 Add logging for settings
- Log when navigating from Settings to injected tiles.
- Log when user creates a new widget shortcut

Fix: 33209678
Fix: 30137094
Test: RunSettingsRoboTests
Change-Id: I1e0f4e00709c392cde2550fafe53890836387c99
2017-02-13 16:57:28 -08:00
Fan Zhang
628b3cb76e Deprecate SettingsDrawerActivity.openTile.
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
2017-02-13 14:41:27 -08:00
Fan Zhang
d69b443e35 Fix a memory leak caused by dashboard freature provider.
In constructor, use app context instead of fragment context

Change-Id: I24fbc457037c1d6854ecf0cb270110d73effb662
Fix: 35292764
Test: RunSettingsRoboTests
2017-02-11 16:57:31 -08:00
Fan Zhang
f91f7f7063 Fully enable IA.
This saves about 120ms for app start time.

Bug: 34103984
Test: RunSettingsRoboTests
Change-Id: Ib1d2b190eb3b563b99c7f9d82e11e28229fe3316
2017-01-07 13:13:10 -08:00
Doris Ling
3d9224fd82 Add new method getExtraIntentAction() in DashboardFeatureProvider.
Add a new method to get the extra intent-filter action to be used
to query the dynamic dashboard tiles.

Bug: 32739952
Test: make RunSettingsRoboTests
Change-Id: I96d9d8bd32ebe34b7c0df00c3fb4d8900b476c94
2016-12-19 14:23:09 -08:00
Doris Ling
a155197d65 Add handling for tiles with intent-action metadata.
If intent action is provided in the metadata for the dynamic tiles, it
will be added to the launching intent when user selects the tile.

Fixes: 31801423
Test: make RunSettingsRoboTests
Change-Id: Ic3e583a578660f4d9c40feff1418e5e354ab8f60
2016-12-05 16:50:47 -08:00
Shahriyar Amini
6259129d69 Use preference key specified in injected settings.
Bug: 31002801
Test: make RunSettingsRoboTests

Reads in optional metadata field for specifying the key used for an
injected preference.

Change-Id: Ief2ff10c508d42f91906b531cf34906c1c42fdd4
2016-11-28 14:49:46 -08:00
Fan Zhang
16f5af6e84 Move ad-hoc dynamic tile injection into FeatureProvider.
Ideally a page should use DashboardFragment and it doesn't need to
handle adding dynamic tiles manually. This method is only designed for
page that are not fully migrated to DashboardFragment yet.

Bug: 32623105
Test: RunSettingsRoboTests
Change-Id: I0cafcddf9a43b164daea500bade869fada5b3f4e
2016-11-16 16:26:38 -08:00
Fan Zhang
9dc9c6174c Insert dynamic dashboard tiles into optional placeholders
Insteads of inserting tile onto screen using absolute priority values,
now each page can have a placeholder preference, and at run time we will
add dynamic dashboard tiles to placeholder's place.

Bug: 32827787
Test: RunSettingsRoboTests
Change-Id: I1fe9e11dce4eb6fb4a9b56af05a2b8e5cdae00d2
2016-11-14 17:09:18 -08:00
Fan Zhang
5482637f8b Refactor bindPreferenceToTile to properly handle multi-user
Change-Id: I751eb645663b3546c212925e2ba4a0a94714013b
Fixes: 32470791
Test: RunSettingsRoboTests
2016-11-01 12:06:38 -07:00
Fan Zhang
601fbec8e8 Show select user dialog if setting tile supports multi-user
Bug: 32470791
Test: RunSettingsRoboTests
Change-Id: I07a14c32a1b898467b03df09430038ac4a1a2aed
2016-10-31 16:55:12 -07:00
TreeHugger Robot
6e3b964cf4 Merge "UI Refresh: a new app info header for app/notification." 2016-10-27 22:43:52 +00:00
Fan Zhang
c9536b8e41 UI Refresh: a new app info header for app/notification.
- moved force stop and uninstall button to bottom of page (as footer)
- Forked appheader layout file, and created AppHeaderController to
  contain all binding logic for header.

Bug: 32442716
Test: RunSettingsRoboTests
Change-Id: Id4eb365ca25e035c043c068867f5cbc3a202b201
2016-10-27 13:48:13 -07:00
Fan Zhang
301fe80fa7 Add location to security settings.
Bug: 32437756
Test: RunSettingsRoboTests
Change-Id: I999669963801684eb2399f5e642159970727b3c4
2016-10-26 11:23:20 -07:00
Fan Zhang
a1a84e6530 Make dashboard tile refresh more effcient.
Instead of removing and re-adding all dashboard tiles, figure out a diff
and rebind/add/remove as necessary.

Bug: 32255863
Test: RunSettingsRoboTests
Change-Id: I9d87ba30ab746257d0ea71282951348ebc4e8965
2016-10-20 09:52:01 -07:00
Fan Zhang
be2ac27b67 Draw preference divider based on preference group.
Bug: 32179750
Test: RunSettingsRoboTests
Change-Id: I3ea1cd662c5baec825fae615883b94b26e648409
2016-10-17 10:16:04 -07:00
Fan Zhang
fabbfb435e Refactor SummaryLoader to set summary on subsetting pages.
- Make a SummaryConsumer interface. Things that needs latest summary
  should implement this interface (DashboardAdapter for homepage,
  DashboardFragment for subsettings). This also decouples SummaryLoader
  from relying on SettingsDrawerActivity.
- Make DashboardFeatureProvider more generic to load DashboardCategory
  by key.

Bug: 31781480
Test: RunSettingsRoboTests
Change-Id: I9c65456fb433a74c352498251e0ccf65da0be1f0
2016-10-07 14:52:06 -07:00
Fan Zhang
1d4495f985 Merge "Update signature when calling CategoryManager.get." 2016-10-05 00:14:54 +00:00
Fan Zhang
1fb1526af7 Update signature when calling CategoryManager.get.
Bug: 31781480
Test: compiles
Change-Id: Iee715aca3767a67728527ba9390787d3f8a7e5fe
2016-10-04 15:18:02 -07:00
Fan Zhang
bb6d2608e9 Add storage dashborad page.
Refactor shared dashboard page display logic between storage and
system page.

Bug: 31800690
Test: RunSettingsRoboTests

Change-Id: I7eb86f590b79ab871bdb383fb2f5326790beb193
2016-10-04 14:06:57 -07:00
Fan Zhang
81adfcfcca Listen to category changes in preference fragment.
Bug: 31781480
Test: make RunSettingsRoboTests
Change-Id: I702e524eb3a9e40b653e112dba80d620be3bc9bb
2016-10-03 16:38:02 -07:00
Fan Zhang
cc335d9509 Rearrange a few settings into System category page.
- Use activity-alias to define which activity shows up in what category.
  We choose activity-alias because it creates a reference to UI we need
  without having to define a new set of intent-filter and/or category
  keys. This reduces maintainence in the long run. We should merge
  metadata from activity-alias into targetActivity when cleaning up.

- Created new System dashboard activity that hosts all system category
  tiles dynamically, and a static tile for checking system update.

Bug: 31781480
Test: manual
Test: make RunSettingsRoboTests -j40
Change-Id: Ia2d762e3e1aebd17423a395c5e6c286dc3326492
2016-09-30 16:03:46 -07:00
Fan Zhang
a96a2d8d60 Use DashboardFeatureProvider to load homepage tiles.
Adding support to homepage category.

Test: SettingsRoboTests for regression. Will write tests for new feature
soon once we are set on the data structure.
Bug: 31781480

Change-Id: I25fa367fecb643f17e23f0182df7585bf1fcdd02
2016-09-29 12:31:10 -07:00
Fan Zhang
488033e54d Add feature provider for dashboard.
The feature provider contains API that controls whether a new
information architecture should be used. By default it's false.

Bug: 31768091
Test: make RunSettingsRoboTests
Change-Id: I5b177be418def50d877f53dc799e42d06eba95ec
2016-09-27 11:25:27 -07:00