Set panel launch mode to singleInstance to avoid panel can show up
infinite time when user keep launching panels (Easy repro by
pressing volume hard key > settings again and again).
After changing launch mode to singleInstance, we will need to do
some refactors, to avoid weirdness when adding/changing/closing
panels:
1. Move and refactor logic in SettingsPanelActivity#onCreate.
We will need onNewIntent here to handle Panel launching, since
we only have one instance of SettingsPanelActivity now.
Also do refactor here to reuse the PanelFragment instead of
creating one every single time, to better handle the exit
animation, avoid janky exit behavior from the old PanelFragment
2. Move logic from PanelFragment#onCreateView, to reuse it when
updating panel content.
Also add exiting animation when we are transitioning the panel
from one to another. Also add alpha animation to make it move
more smoothly.
3. Adding flags to launch see more intent in settings.
Fixes: 131225920
Fixes: 131254399
Test: manual
Change-Id: I93d3708bd02a2d736e38685475f2d9988ef62d31
Settings Panels as a dialog have a default animation for entering the
screen, but Slices complicate the animation. While the dialog enters the
screen, Slices begin to bind, thus changing the height of the dialog as
it enters, causing perceived bounce / jank in the animation.
This CL is cherry-picked/based on ag/6671083 but do the following modification:
(See the original commit message for the whole concept)
When trying to load all the Slices, there are few possible situations:
1. Slice starts loading slowly, starting at state LOADED_NONE
2. Slice is loading in progress, having state LOADED_PARTIAL
3. Slice is loaded, but there's error return from the Slice data (We don't
need to show the Slice in this case)
4. Slice is loaded, progress to state LOADED_ALL
5. Slice starts from state LOADED_NONE, but never progress to the next state
because it crashes at setting backend.
Notice that there are two cases that the state will stay at LOADED_NONE and
we can't distinguish them.
Hence, we decide to do the following:
If Slice is with error (case 3) we remove the slice from the list and mark it
loaded.
If Slice is loaded with LOADED_ALL (case 4, which is the ideal case), we mark
it as loaded.
In the other cases, we fire a handler to mark the slice loaded anyway after
250ms timeout.
When all the slices are marked loaded (which should happen after 250ms timeout,
we will animate the panel out. Although there might be slices which are still
partial loaded, we can still have the slice in the panel once it is ready.
The panel might bounce/jank in this case, but at least it will still showing
correctly, and should show up smoothly in most cases.
The solution to this problem is twofold:
1. Load all Slices first
2. Create a custom animation to draw the panel once the recyclerview has
been laid out.
Test: Manual/Visual inspection
Test: make -j40 RunSettingsRobotests
Bug: 123942159
Change-Id: I639a707aa4ba3f906bd6f9752c92727aaba28142
The old logging only include see_more, done, and clicked_out when hiding
the panel page. We were missing many cases that user might use back
button, app switch button to close the page.
Update the hide page keys to change the clicked_out to others to
include all the other cases which hide the page.
Test: Manual verification
Test: atest PanelFragmentTest SettingsPanelActivityTest
Fixes: 130169553
Change-Id: Icede9a8dcb84565cba183963c9fb554507631c98
Remove the divider above the media device switcher Slice per the request.
Do a little refactor in Panel View, to use DividerItemDecoration instead of adding
divider views in layout file as the recycler view items divider.
Since dividers should be shown in most cases, we are setting DividerCondition to
DIVIDER_CONDITION_BOTH and default true to allow divider. For the slice we don't
need divider (media device switch in this case) we are setting the the target
direction of isDividerAllowed (above in this case) to false. Since we have
DIVIDER_CONDITION_BOTH, if one of the item view set the divider not allow, the
divider won't be shown.
Test: Visual/Manual inspection
Fixes: 126205139
Change-Id: Ic857705c90819ef9375f877a44bb32987b5d4438
Move getActivity() call and fetching of metrics feature provider into
onCreateView rathre than the Constructor of the fragment (where Activity
is not yet created).
Test: manual
Test: existing robotests
Fixes: 128808444
Change-Id: I88586b0ca3ebda60f8933041322541cc5911de68
The 3 main categories are:
- Panel Opened
- Panel Closed
- Panel Slice interaction
There are 3 close events:
- See more button
- Done button
- Clicking outside the panel
Slice interactions will log the Uri of the Slice and the ActionType,
such as Toggle, Slider, Content (intent).
Change-Id: Iecad948f39f50dd12ae1bcb23a5d523e0df8bb98
Fixes: 117804231
Test: robotests
Add media output panel type to launch media output slice.
Bug: 121083246
Test: make -j RunSettingsRoboTests
Change-Id: Ibf706146430e309fef6cbf0e1e86c2d5b78b50d5
Change the SettingsPanelActivity to reference the
public API.
Bug: 117804442
Test: robolectric, manual app
Change-Id: I4b128ae9d97c1000fdaa0c3fb5b94f8dc096055f
UI changes include:
- RecyclerView to host slices
- Font family to headline font
- Title is now centered
- Added SeeMore & Done buttons
- Horizontal Dividers between slices
- Indented Slices
- Landscape layout is fullscreen
Change-Id: I3549c847fc88edd81f670ddfa2907dd3741441e0
Screenshot: https://screenshot.googleplex.com/RzWktzOZJkc
Test: Robolectric
Test: Manual app
Bug: 118622007
Establish the Activity which hosts Settings panels through the
PanelFragment. The Activity's purpose is to validate the intent
data coming in, including:
- Called with startActivityForResult (so we can log who is calling)
- Intent has the proper intent extra to link to a Panel
The fragment takes the Panelable data and builds a Settings Panel.
Each panel will have:
- Title
- List of Slices
- Link to underlying content
The Panelable interface is created to provide all of those datums, and
the new FetureProvider provides the Panelables by linking them with
keys. The keys will eventually become public APIs with CTS tests.For
now, we store them locally.
I included an exmaple panel, the InternetConnectivityPanel which
currently shows Wifi and Airplane mode.
Screenshot: https://screenshot.googleplex.com/c6sv7ZzQ5OJ
Bug: 117804089
Test: make -j40 RunSettingsRobotest
Test: Manual app
Change-Id: I1932f7179cc32088acd6413a736901ddf9651892