Revamp Storage Settings header part

1. Add new object StorageEntry to encapsulate VolumeInfo and
   unsupported DiskInfo and missing VolumeRecord.
2. Replaces StorageSummaryDonutPreference with UsageProgressBarPreference.
3. Add storage select spinner.
4. Add a "Free up storage" preference to replace "Manage storage" button.

Bug: 174964885
Test: atest com.android.settings.deviceinfo.storage
      atest com.android.settings.deviceinfo
      manual
      Insert an USB drive, select the drive in StorageDashboardFragment
      and observe UI.
Change-Id: I83877f76869414de4fb2788b6b18fe507aa5cfcf
This commit is contained in:
Arc Wang
2021-02-25 15:01:08 +08:00
parent 8b4add3ae6
commit 89e6d99daf
14 changed files with 1443 additions and 33 deletions

View File

@@ -3333,6 +3333,10 @@
<string name="storage_menu_manage">Manage storage</string>
<!-- Storage setting. Keywords for Free up space. [CHAR LIMIT=NONE] -->
<string name="keywords_storage_menu_free">clean, storage</string>
<!-- Storage setting. Title for storage free up option. [CHAR LIMIT=30] -->
<string name="storage_free_up_space_title">Free up space</string>
<!-- Storage setting. Summary for storage free up option. [CHAR LIMIT=NONE] -->
<string name="storage_free_up_space_summary">Go to Files app to manage and free up space</string>
<!-- Storage setting. Title for USB transfer settings [CHAR LIMIT=30]-->
<string name="storage_title_usb">USB computer connection</string>
@@ -11455,6 +11459,10 @@
<!-- Follows the percent of storage used by a storage volume. Exposed inside of a donut graph. [CHAR LIMIT=7]-->
<string name="storage_percent_full">used</string>
<!-- Summary of a single storage volume used space. [CHAR LIMIT=24] -->
<string name="storage_usage_summary"><xliff:g id="number" example="128">%1$s</xliff:g> <xliff:g id="unit" example="KB">%2$s</xliff:g> used</string>
<!-- Summary of a single storage volume total space. [CHAR LIMIT=24] -->
<string name="storage_total_summary">Total <xliff:g id="number" example="128">%1$s</xliff:g> <xliff:g id="unit" example="KB">%2$s</xliff:g></string>
<!-- Label for button allow user to remove the instant app from the device. -->
<string name="clear_instant_app_data">Clear app</string>

View File

@@ -19,11 +19,22 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/storage_settings"
android:orderingFromXml="false">
<com.android.settings.deviceinfo.storage.StorageSummaryDonutPreference
android:key="storage_summary"
android:order="0"
<com.android.settingslib.widget.SettingsSpinnerPreference
android:key="storage_spinner"
android:order="-2"
settings:searchable="false"
settings:controller="com.android.settings.deviceinfo.storage.StorageSummaryDonutPreferenceController"/>
settings:controller="com.android.settings.deviceinfo.storage.StorageSelectionPreferenceController"/>
<com.android.settingslib.widget.UsageProgressBarPreference
android:key="storage_summary"
android:order="-1"
settings:searchable="false"
settings:controller="com.android.settings.deviceinfo.storage.StorageUsageProgressBarPreferenceController"/>
<Preference
android:key="free_up_space"
android:order="0"
android:title="@string/storage_free_up_space_title"
android:summary="@string/storage_free_up_space_summary"
settings:allowDividerAbove="true"/>
<com.android.settings.widget.PrimarySwitchPreference
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings"
android:key="toggle_asm"
@@ -74,4 +85,4 @@
android:key="pref_secondary_users"
android:title="@string/storage_other_users"
android:order="200" />
</PreferenceScreen>
</PreferenceScreen>