Commit Graph

7 Commits

Author SHA1 Message Date
Fan Zhang
b3eea29141 Remove some dead code
DashboardCategory is no longer rendered in the dashboard ui

Bug: 33861822
Test: make RunSettingsRoboTests existing tests still pass
Change-Id: I0479967b0099f76f8c0c7894643d50b655de2892
2017-06-15 14:58:25 -07:00
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
Andrew Sapperstein
048f6fb8b3 Initial search bar implementation.
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
2017-05-31 15:24:25 -07:00
Maurice Lam
fc972a75a9 Allow remote views to be used in Tiles
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
2017-03-27 20:32:20 -07:00
Fan Zhang
a5b620e738 Swipe to dismiss suggestions
- 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
2017-03-13 14:39:00 -07:00
jackqdyulei
022d4476c7 Add payload for condition card to reuse the viewholder
Bug: 30319913
Test: make RunSettingsRoboTests
Change-Id: Ib08a301203f4075f0553386f7db1a68d69bde436
2016-10-28 11:23:56 -07:00
jackqdyulei
0b818b79db Elicit ItemsData class and add DiffUtil.Callback
In the previous version, when there is a minor change in data, we
will refresh the whole screen(and data) by invoking "recountItems"
and "notifyDataSetChanged", which did lots of unnecessary works.

In this new cl, I elicit ItemsData class, which encapsulates the list
data used in adapter. When data changed, I build another ItemsData and
use the DiffUtil.Callback to calculate diffs between ItemsDatas. In
this way we can only refresh the items that changed in adapter.

Since I cannot find usage of see_all.xml anymore, I delete the relevant
code as well as the resource files.

Bug: 30319913
Test: make RunSettingsRoboTests
Change-Id: I4f753a26f624affea6c6c35d49cfb9c43fb74fe6
2016-10-21 11:02:29 -07:00