Merge "Add first pass at a new Storage screen."

This commit is contained in:
Daniel Nishi
2017-01-05 22:35:38 +00:00
committed by Android (Google) Code Review
14 changed files with 703 additions and 21 deletions

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="@dimen/preference_no_icon_padding_start"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="16dip"
android:paddingBottom="16dip"
android:background="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@android:id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:textAlignment="viewStart"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textColor="?android:attr/textColorSecondaryNoDisable"
android:maxLines="10" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- TODO: Update this view to not match the existing storage summary.-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="@dimen/preference_no_icon_padding_start"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="16dip"
android:paddingBottom="16dip"
android:background="?android:attr/selectableItemBackground">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAlignment="viewStart"
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:textColor="?android:attr/colorAccent"
android:textSize="36sp"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:maxLines="10" />
<ProgressBar
android:id="@android:id/progress"
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:visibility="gone"
android:max="100"
style="?android:attr/progressBarStyleHorizontal" />
</LinearLayout>

View File

@@ -8002,4 +8002,23 @@
<string name="enterprise_privacy_security_logs">Your most recent security log</string>
<!-- Label indicating that the date at which the admin last took a particular action was "never" (i.e. the admin never took the action so far). -->
<string name="enterprise_privacy_never">Never</string>
<!-- Preference label for the Photos & Videos storage section. [CHAR LIMIT=50] -->
<string name="storage_photos_videos">Photos &amp; Videos</string>
<!-- Preference label for the Music & Audio storage section. [CHAR LIMIT=50] -->
<string name="storage_music_audio">Music &amp; Audio</string>
<!-- Preference label for the Games storage section. [CHAR LIMIT=50] -->
<string name="storage_games">Games</string>
<!-- Preference label for the Other apps storage section. [CHAR LIMIT=50] -->
<string name="storage_other_apps">Other apps</string>
<!-- Preference label for the Files storage section. [CHAR LIMIT=50] -->
<string name="storage_files">Files</string>
<!-- Main settings screen item's title to go into the storage settings screen [CHAR LIMIT=25] -->
<string name="storage_settings_2" >Phone Storage</string>
</resources>

View File

@@ -17,9 +17,36 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/storage_settings">
<Preference
android:key="pref_manage_storage"
android:title="@string/storage_menu_manage"
<com.android.settings.deviceinfo.storage.StorageSummaryDonutPreference
android:key="pref_summary" />
<com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate
android:key="pref_photos_videos"
android:title="@string/storage_photos_videos"
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings">
</Preference>
</com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate>
<com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate
android:key="pref_music_audio"
android:title="@string/storage_music_audio"
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings">
</com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate>
<com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate
android:key="pref_games"
android:title="@string/storage_games"
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings">
</com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate>
<com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate
android:key="pref_other_apps"
android:title="@string/storage_other_apps"
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings">
</com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate>
<com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate
android:key="pref_system"
android:title="@string/storage_detail_system"
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings">
</com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate>
<com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate
android:key="pref_files"
android:title="@string/storage_files"
android:fragment="com.android.settings.deletionhelper.AutomaticStorageManagerSettings">
</com.android.settings.deviceinfo.storage.StorageItemPreferenceAlternate>
</PreferenceScreen>