Commit Graph

104 Commits

Author SHA1 Message Date
TreeHugger Robot
f940f86bbc Merge "Do not load old category when IA is enabled." 2017-01-06 03:01:17 +00:00
Fan Zhang
e8a77c551e Do not load old category when IA is enabled.
Bug: 34026031
Test: RunSettingsRoboTests
Change-Id: Ie4ede018c8e3e906093cba4b9d4bf9d75c0bd972
2017-01-05 17:20:59 -08:00
Fan Zhang
c54503d9e1 Update tile color from using accent to colorControlNormal.
Also remove some unused code
Bug: 33759208
Test: visual

Change-Id: I0a019bf6b514564f9e6e844de8a6b75b2ca69cc7
2017-01-05 16:47:59 -08:00
jackqdyulei
0fd7190fdd Refine animation to remove strange reshuffling animation
The issue happens mainly because two animations(move + change) running
on the same view interrupt with each other. When ItemAnimator runs the
move animation, it will change the translationX&Y in a time period.
When the change animation occurs in this period, it gets this translation
value and calculates a non-zero deta, then it would run an unnecessary
move animation, which causes the strange reshuffling.

In this cl, I skip the translation value only for the tile view when
there is pending animation.

I also add scroll operation for conditions view to make it scroll to
top after condition change.

Bug: 33839777
Bug: 33839780
Test: make -j40 RunSettingsRoboTests

Change-Id: I2152f93f756ae20cf754d6fca3525119cb4ceb1f
2016-12-29 14:18:16 -08:00
Fan Zhang
413eaa4070 Clean up search fragment loader lifecycle.
- Programatically create SearchView to make it always expand across
  entire action bar.
- Store current query text during screen rotation
- Restart loader when query text changes

Bug: 33354491
Test: RunSettingsRoboTests
Change-Id: I63838a38514569aac60c5d67ac52ac06a7acd5a3
2016-12-06 14:43:01 -08:00
TreeHugger Robot
cdec3495f8 Merge "Add InstrumentFragment for non-PreferenceFragment types." 2016-12-06 03:10:01 +00:00
Fan Zhang
2d0b344736 Add InstrumentFragment for non-PreferenceFragment types.
This allows app fragment use a less heavyweight fragment as super class
if they don't need PreferenceFragment. Using this class as base is
generally easier to set up robolectric tests too.

Bug: 33354536
Test: RunSettingsRoboTests
Change-Id: I91c4d242ea0333c76c8767c03c3f18dee6b6e104
2016-12-05 17:13:33 -08:00
Salvador Martinez
179e16445e Added logging to pinpoint source of bug
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
2016-12-05 15:32:14 -08:00
jackqdyulei
fa45aee813 Add DashboardItemAnimator to stop flash
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
2016-11-30 16:39:28 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00: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
TreeHugger Robot
96fa06ebf7 Merge "Use DashboardFeatureProvider to load homepage tiles." 2016-09-29 21:19:34 +00: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
Salvador Martinez
d969a5f53d Settings timeout for suggestions
If loading suggestions takes too long (750ms)
settings will display just the categories
so the user does not get confused.

Test: Forthcoming
Bug: 31203004
Change-Id: Ic9866a5ccdcef965908db8c4592435a5d252f7b0
2016-09-29 18:39:47 +00:00
Fan Zhang
aa71afe597 Use MetricsFeatureProvider for logging in Settings.
Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: Id944be7c4ff9911aebee481c2df485542f1318f0
2016-09-23 08:37:37 -07:00
Fan Zhang
c93d18e29c Use MetricsFeatureProvider for condition/suggestion/search.
Bug: 31664539
Test: make RunSettingsRoboTests

This allows different metric clients to listen to these events.

Change-Id: Ib19c8099b16ff78d9aa4901278e0ff33eeefd4a8
2016-09-22 13:22:26 -07:00
Doris Ling
f0bb63f307 Fix NullPointerException in DashboardSummary. am: 797dd7440d am: 454dc3739a
am: 45a821105f

Change-Id: I39623232f80a9de2d2199af11585eaa61bce2e08
2016-08-26 23:03:39 +00:00
Doris Ling
45a821105f Fix NullPointerException in DashboardSummary. am: 797dd7440d
am: 454dc3739a

Change-Id: Id334c7b3f36d8fcfbb4e919007d0bf5789b605fb
2016-08-26 22:26:40 +00:00
Doris Ling
797dd7440d Fix NullPointerException in DashboardSummary.
In onSaveInstanceState(), move saving the suggestions logging lists to
the top so that it will be saved to the bundle even when layout manager
is null.

Test: run monkey
Change-Id: I248563a255158feadeb85898a920af96a1565fa9
Fixes:31111795
2016-08-26 11:13:21 -07:00
Salvador Martinez
a54c3690a4 Added guard to logging in AsyncTask am: 030eeeee6d
am: 60bd509d4e

Change-Id: Ib1d37a0c9c68c01be0d59bff5d78cd37c083689f
2016-08-25 20:02:35 +00:00
Salvador Martinez
030eeeee6d Added guard to logging in AsyncTask
An async task was trying to get the context
in an InstrumentedFragment. This could return
null if the context disappears before the new
thread gets to that line. Logging will now
be aborted if context is null to avoid this.

Test: Manual/Monkey Stability Test
Bug: 31058928
Change-Id: Iae97d389e58a76b0f213a2749415501894ebf649
(cherry picked from commit 566b66e27c)
2016-08-25 17:45:24 +00:00
TreeHugger Robot
e96d65deea Merge "Added guard to logging in AsyncTask" 2016-08-25 00:36:32 +00:00
Salvador Martinez
566b66e27c Added guard to logging in AsyncTask
An async task was trying to get the context
in an InstrumentedFragment. This could return
null if the context disappears before the new
thread gets to that line. Logging will now
be aborted if context is null to avoid this.

Bug: 31058928
Change-Id: Iae97d389e58a76b0f213a2749415501894ebf649
2016-08-24 15:11:21 -07:00
Andrew Sapperstein
f36eac3889 resolve merge conflicts of 6890d53 to master
Change-Id: I61c1ed150fe311c4e07df524b5c0577f35d3bd60
2016-08-24 10:50:28 -04:00
Doris Ling
6890d538ae resolve merge conflicts of f757d1e to nyc-mr1-dev-plus-aosp
Change-Id: I1e53b78977bb32fe34462cf46bbfe66626574e65
2016-08-23 19:02:31 -07:00
Doris Ling
bfbb964cb1 Log settings suggestions events only once.
The show/hide settings suggestions events are logged every time Settings
is shown. Save the logged events into the state bundle so that when the
fragment is resumed, it does not re-log the suggestions events.

Also move the logging for the show suggestion event to when the suggestion
is loaded, as the suggestions can be empty when the fragment starts.

Change-Id: I644ea0012bad309e59fed0d48171915c955779cc
Fixes: 30108142
2016-08-23 13:25:06 -07:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Doris Ling
b14d42080b Log settings suggestions events only once.
The show/hide settings suggestions events are logged every time Settings
is shown. Save the logged events into the state bundle so that when the
fragment is resumed, it does not re-log the suggestions events.

Also move the logging for the show suggestion event to when the suggestion
is loaded, as the suggestions can be empty when the fragment starts.

Change-Id: I644ea0012bad309e59fed0d48171915c955779cc
Fixes: 30108142
2016-08-02 17:01:39 -07:00
Doris Ling
4a6f8b967a Check for null activity before getting dashboard categories. am: b7e650c6f7
am: 4ec4b64b9d

Change-Id: Id96c017083cc49abbdc3cc6122ea277fe3c78755
2016-07-22 01:47:12 +00:00
Doris Ling
4ec4b64b9d Check for null activity before getting dashboard categories.
am: b7e650c6f7

Change-Id: I26f8c96189d3390055a7dd02680da57d2c2ed2cb
2016-07-22 01:42:47 +00:00
Doris Ling
b7e650c6f7 Check for null activity before getting dashboard categories.
In DashboardSummary, when async task finishes running, ensure that the
fragment is still associated with the activity before getting the
dashboard categories from the activity.

Change-Id: If23cd27a0d3e3429d900ae41ef6f24ed03b9e8d6
Fixes: 30278854
2016-07-21 12:22:17 -07:00
Doris Ling
eacb97e3d7 Merge \\"Combine setCategories() and setSuggestions() in DashboardAdapter.\\" into nyc-mr1-dev am: 7e70fd1166
am: b3055b083a

Change-Id: I1c61400fee835a8297d754455596e530b1d006c2
2016-07-20 19:51:24 +00:00
Doris Ling
b3055b083a Merge \"Combine setCategories() and setSuggestions() in DashboardAdapter.\" into nyc-mr1-dev
am: 7e70fd1166

Change-Id: Id8f655e0a9b29369a57eea3c5140cf47def7cc36
2016-07-20 18:51:17 +00:00
Doris Ling
38d8582abe Combine setCategories() and setSuggestions() in DashboardAdapter.
In DashboardSummary.rebuildUI(), we first update the adapter with the
current categories, then run the async task to update the adapter with
the suggestions. This causes the adapter to first layout the existing
categories, and relayout when the suggestions is available. This causes
the suggestions view and categories view to overlap before the
relayout is complete.

Since categories and suggestions are borh set each time we try to
rebuild the UI, delaying the update for categories until the suggestions
are ready will avoid the unnecessary relayout of the list elements.

Ran app launch test for Settings app with the change and launch time is
between 412ms and 486ms in 10 runs, which does not show much delay in
app launch time with delaying updating the categories.

Bug: 29318104
Change-Id: I03ae2386392315f28fe2c361682f2f3252e9f827
2016-07-15 13:08:56 -07:00
Doris Ling
89b315568a resolve merge conflicts of 161093b to master
Change-Id: I14c74be54ca216b1f1e369685516a821a94ab30a
2016-07-13 11:18:28 -07:00
Doris Ling
161093bb0a Merge \"Reduce the number of times that dataset changed is triggerd in DashboardAdapter\" into nyc-mr1-dev
am: 8c50ced07c

Change-Id: I0989b7f8e122d5221757b57b1866d536a1657ae3
2016-07-13 17:25:16 +00:00
Doris Ling
b76de265a2 Reduce the number of times that dataset changed is triggerd in DashboardAdapter
1. Save the suggestion list and the category list into the instance
state so that it will be available on warm start, and avoid the need
to reload the data.
2. Add the condition list to the constructor parameters for
DashboardAdapter, so that it does not need to setConditions()
separately which will trigger notifyDataSetChanged()

Bug: 30055644
Change-Id: Ia04fa3a25b13d2dacf6baf5f412d662a595fb6dd
2016-07-12 18:02:22 -07:00
Jason Monk
718c84f121 resolve merge conflicts of 67e87fa to nyc-mr1-dev
Change-Id: I8c5a79de3176912a1803a481b8b179faf1dad178
2016-06-01 16:20:01 -04:00
Jason Monk
350a930c68 onResume -> onStart, onPause -> onStop
For SettingsActivity and DashboardSummary

Bug: 28896214
Change-Id: I235d5c82b04b1363bf4416acb5cf5fc1c4db704f
2016-06-01 13:45:25 -04:00
Jason Monk
e5e4a555e7 Merge "Fix crash from battery saver switch" into nyc-dev am: 371aec1e92 am: e3b9c3dd63
am: 362287567e

* commit '362287567e1b66421c9bbdf1fd1ca7ae7c547113':
  Fix crash from battery saver switch

Change-Id: I01a71bf6f60c634baa2b4784dd757ca729b7075c
2016-05-26 18:02:56 +00:00
Jason Monk
e3b9c3dd63 Merge "Fix crash from battery saver switch" into nyc-dev
am: 371aec1e92

* commit '371aec1e92aa4b5cf6e4ed2b5f39faf180c17d1f':
  Fix crash from battery saver switch

Change-Id: I0416b92dbc9b18a97c9d6d0617cba636e310690b
2016-05-26 17:53:41 +00:00
Jason Monk
e4d0ed502d Fix crash from battery saver switch
Turns out most things expect the conditions to be loaded immediately
so if the dashboard hasn't been hit, they crash.  Instead load
immediately for everything but the dashboard.

Change-Id: Iaa1114c88b3766e2ac513acb417ef2a55a0f4e7f
Fixes: 28952354
2016-05-26 11:07:53 -04:00
Jason Monk
5c2a9d336b Merge "Protect against case when suggestions haven\'t loaded" into nyc-dev am: 76f95e82b8 am: f241ae5fcf
am: 2a5b456e69

* commit '2a5b456e69e029f101769e8465afc50939254780':
  Protect against case when suggestions haven't loaded

Change-Id: I085ab8cdb6650457ebc552afdb5218a3fe37ce0a
2016-05-11 15:21:29 +00:00
Jason Monk
f241ae5fcf Merge "Protect against case when suggestions haven\'t loaded" into nyc-dev
am: 76f95e82b8

* commit '76f95e82b861441bccb9f452fe77e1c47acc1d3c':
  Protect against case when suggestions haven't loaded

Change-Id: Ie0bc3aa3e696efcec5560860284b457e636bd5bc
2016-05-11 15:16:01 +00:00
Jason Monk
31ecec0ab1 Protect against case when suggestions haven't loaded
Change-Id: I7668ed8af3f1808b619f0fdbd77c2f85da98f607
Fixes: 28691636
2016-05-11 11:01:17 -04:00
Jason Monk
2e2f19d2eb resolve merge conflicts of 0496ffa to master
Change-Id: I61589b7e9f1190e19d48dbb421541ebc2891ee82
2016-05-10 16:34:48 -04:00
Jason Monk
0496ffad87 Merge "Make sure TileAdapter always has a SuggestionParser" into nyc-dev am: a50a14a23a
am: 4101ba4eb1

* commit '4101ba4eb1395988941f3f24bc2f502753036e2f':
  Make sure TileAdapter always has a SuggestionParser

Change-Id: Ic204cabd5cdbdd67f6bbdb53032a277da7fd34fa
2016-05-10 20:29:02 +00:00
Jason Monk
6e9867dcc9 Merge "Make sure TileAdapter always has a SuggestionParser" into nyc-dev
am: a50a14a23a

* commit 'a50a14a23a4f57203d01489ddef607f46f485518':
  Make sure TileAdapter always has a SuggestionParser

Change-Id: I87ee80fa989079c554c60870b9ddc70d3b36c5e4
2016-05-10 20:26:22 +00:00
Jason Monk
a41a8d05ab Make sure TileAdapter always has a SuggestionParser
Since it expects to have one

Change-Id: Ic0dccd2271c011cf7dc877e341af5a8bfea90c37
Fixes: 28689801
2016-05-10 13:03:35 -04:00
Jason Monk
572b3c82fc Merge "Dashboard performance work" into nyc-dev am: 04b25af149 am: 96eedcfdd2
am: fc5f0d4d20

* commit 'fc5f0d4d20817112d7d8d101f245ba50d45728e8':
  Dashboard performance work

Change-Id: I5daad812baf80d27ea6cf097bea15065fa581a7b
2016-05-09 13:48:48 +00:00