Loading res/values/lineage_arrays.xml +10 −0 Original line number Diff line number Diff line Loading @@ -400,4 +400,14 @@ <item>@string/app_ops_permissions_ignored</item> <item>@string/app_ops_permissions_always_ask</item> </string-array> <!-- Colors for internal storages --> <array name="internal_storage_colors"> <item>@color/storage_color_default</item> <item>@color/storage_color1</item> <item>@color/storage_color2</item> <item>@color/storage_color3</item> <item>@color/storage_color4</item> </array> </resources> res/values/lineage_colors.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The LineageOS 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. --> <resources> <color name="storage_color_default">@*android:color/accent_device_default_light</color> <color name="storage_color1">#ffab47bc</color> <color name="storage_color2">#fff2a600</color> <color name="storage_color3">#ffec407a</color> <color name="storage_color4">#ffc0ca33</color> </resources> src/com/android/settings/deviceinfo/StorageSettings.java +4 −9 Original line number Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * Copyright (C) 2019 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -76,14 +77,6 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index static final int COLOR_PUBLIC = Color.parseColor("#ff9e9e9e"); static final int[] COLOR_PRIVATE = new int[]{ Color.parseColor("#ff26a69a"), Color.parseColor("#ffab47bc"), Color.parseColor("#fff2a600"), Color.parseColor("#ffec407a"), Color.parseColor("#ffc0ca33"), }; private StorageManager mStorageManager; private PreferenceCategory mInternalCategory; Loading Loading @@ -169,11 +162,13 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index final List<VolumeInfo> volumes = mStorageManager.getVolumes(); Collections.sort(volumes, VolumeInfo.getDescriptionComparator()); int[] colors = getResources().getIntArray(R.array.internal_storage_colors); for (VolumeInfo vol : volumes) { if (vol.getType() == VolumeInfo.TYPE_PRIVATE) { final long volumeTotalBytes = PrivateStorageInfo.getTotalSize(vol, sTotalInternalStorage); final int color = COLOR_PRIVATE[privateCount++ % COLOR_PRIVATE.length]; final int color = colors[privateCount++ % colors.length]; mInternalCategory.addPreference( new StorageVolumePreference(context, vol, color, volumeTotalBytes)); } else if (vol.getType() == VolumeInfo.TYPE_PUBLIC) { Loading Loading
res/values/lineage_arrays.xml +10 −0 Original line number Diff line number Diff line Loading @@ -400,4 +400,14 @@ <item>@string/app_ops_permissions_ignored</item> <item>@string/app_ops_permissions_always_ask</item> </string-array> <!-- Colors for internal storages --> <array name="internal_storage_colors"> <item>@color/storage_color_default</item> <item>@color/storage_color1</item> <item>@color/storage_color2</item> <item>@color/storage_color3</item> <item>@color/storage_color4</item> </array> </resources>
res/values/lineage_colors.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The LineageOS 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. --> <resources> <color name="storage_color_default">@*android:color/accent_device_default_light</color> <color name="storage_color1">#ffab47bc</color> <color name="storage_color2">#fff2a600</color> <color name="storage_color3">#ffec407a</color> <color name="storage_color4">#ffc0ca33</color> </resources>
src/com/android/settings/deviceinfo/StorageSettings.java +4 −9 Original line number Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * Copyright (C) 2019 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -76,14 +77,6 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index static final int COLOR_PUBLIC = Color.parseColor("#ff9e9e9e"); static final int[] COLOR_PRIVATE = new int[]{ Color.parseColor("#ff26a69a"), Color.parseColor("#ffab47bc"), Color.parseColor("#fff2a600"), Color.parseColor("#ffec407a"), Color.parseColor("#ffc0ca33"), }; private StorageManager mStorageManager; private PreferenceCategory mInternalCategory; Loading Loading @@ -169,11 +162,13 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index final List<VolumeInfo> volumes = mStorageManager.getVolumes(); Collections.sort(volumes, VolumeInfo.getDescriptionComparator()); int[] colors = getResources().getIntArray(R.array.internal_storage_colors); for (VolumeInfo vol : volumes) { if (vol.getType() == VolumeInfo.TYPE_PRIVATE) { final long volumeTotalBytes = PrivateStorageInfo.getTotalSize(vol, sTotalInternalStorage); final int color = COLOR_PRIVATE[privateCount++ % COLOR_PRIVATE.length]; final int color = colors[privateCount++ % colors.length]; mInternalCategory.addPreference( new StorageVolumePreference(context, vol, color, volumeTotalBytes)); } else if (vol.getType() == VolumeInfo.TYPE_PUBLIC) { Loading