From 28c3f6bb71da1727fdc39bdc622518b1daeb3b0a Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Tue, 21 Apr 2015 23:01:11 -0700 Subject: [PATCH] [WifiSettings] Add progress bar when scanning Add a progress bar when the Wi-Fi screen is in a transient state, like enabling, disabling Wi-Fi and scanning for network. This change sets the progress bar as a pinned header at the top of the activity. The pinned header container needs to be match parent so that the progress bar can occupy the full width of the screen. If the header view doesn't want to fill the width, then the header view *inside* the container should be wrap_content. Added an overloaded setPinnedHeader method that takes a layout resource ID, and returns the view to the caller. This way the inflater can set the parent property so that layout params will not be ignored. Bug: 17389577 Change-Id: I18d0eb7c72ad31d1c4b35a54789016c32c81fb93 --- ...eterminate_horizontal_material_trimmed.xml | 28 ++++++++++ ...gress_indeterminate_horizontal_trimmed.xml | 53 +++++++++++++++++++ res/layout/preference_list_fragment.xml | 2 +- res/layout/wifi_progress_header.xml | 22 ++++++++ res/values/styles.xml | 6 +++ .../settings/SettingsPreferenceFragment.java | 8 +++ .../settings/print/PrintSettingsFragment.java | 4 +- .../users/RestrictedProfileSettings.java | 5 +- .../android/settings/wifi/WifiSettings.java | 15 +++++- .../wifi/WifiSettingsForSetupWizard.java | 11 ++++ 10 files changed, 145 insertions(+), 9 deletions(-) create mode 100644 res/drawable/progress_indeterminate_horizontal_material_trimmed.xml create mode 100644 res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml create mode 100644 res/layout/wifi_progress_header.xml diff --git a/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml b/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml new file mode 100644 index 00000000000..070b9a10351 --- /dev/null +++ b/res/drawable/progress_indeterminate_horizontal_material_trimmed.xml @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml b/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml new file mode 100644 index 00000000000..39e3a3738e2 --- /dev/null +++ b/res/drawable/vector_drawable_progress_indeterminate_horizontal_trimmed.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + diff --git a/res/layout/preference_list_fragment.xml b/res/layout/preference_list_fragment.xml index 1412381a6c6..2e9299c78f9 100644 --- a/res/layout/preference_list_fragment.xml +++ b/res/layout/preference_list_fragment.xml @@ -25,7 +25,7 @@ android:background="@android:color/transparent"> diff --git a/res/layout/wifi_progress_header.xml b/res/layout/wifi_progress_header.xml new file mode 100644 index 00000000000..05518ae6a8f --- /dev/null +++ b/res/layout/wifi_progress_header.xml @@ -0,0 +1,22 @@ + + + + diff --git a/res/values/styles.xml b/res/values/styles.xml index d0d2ead3229..cca8a700d29 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -158,6 +158,12 @@ ?android:attr/colorAccent + +