From 2d28a4ceb4b1eec43972255801d9e9f81d95c1c3 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Thu, 27 Jul 2017 12:14:59 -0700 Subject: [PATCH] Unify action buttons to a common widget (part 1) - Create a preference type to host action button preferences. - Convert app battery usage page to use the new preference - Convert wifi detail page to use the new preference Change-Id: I60bc473986ab46f2897e2537eb0e013fa813a4fc Fix: 63991885 Test: robotests --- res/layout/two_action_buttons.xml | 66 +++++++ res/values/styles.xml | 2 + res/xml/power_usage_detail.xml | 4 +- res/xml/wifi_network_details_fragment.xml | 3 +- .../AppButtonsPreferenceController.java | 77 ++++---- .../widget/ActionButtonPreference.java | 186 ++++++++++++++++++ .../WifiDetailPreferenceController.java | 24 +-- .../StorageItemPreferenceControllerTest.java | 5 +- .../AppButtonsPreferenceControllerTest.java | 50 +++-- .../widget/ActionButtonPreferenceTest.java | 139 +++++++++++++ .../WifiDetailPreferenceControllerTest.java | 66 ++----- 11 files changed, 486 insertions(+), 136 deletions(-) create mode 100644 res/layout/two_action_buttons.xml create mode 100644 src/com/android/settings/widget/ActionButtonPreference.java create mode 100644 tests/robotests/src/com/android/settings/widget/ActionButtonPreferenceTest.java diff --git a/res/layout/two_action_buttons.xml b/res/layout/two_action_buttons.xml new file mode 100644 index 00000000000..0594daf69de --- /dev/null +++ b/res/layout/two_action_buttons.xml @@ -0,0 +1,66 @@ + + + + + + +