diff --git a/res/values/lineage_arrays.xml b/res/values/lineage_arrays.xml index 9377953e21d462cd95e53af088f1d45396e534df..0145438148f3523174a9fdfceb3e8a04be9e0051 100644 --- a/res/values/lineage_arrays.xml +++ b/res/values/lineage_arrays.xml @@ -400,4 +400,14 @@ @string/app_ops_permissions_ignored @string/app_ops_permissions_always_ask + + + + @color/storage_color_default + @color/storage_color1 + @color/storage_color2 + @color/storage_color3 + @color/storage_color4 + + diff --git a/res/values/lineage_colors.xml b/res/values/lineage_colors.xml new file mode 100644 index 0000000000000000000000000000000000000000..a4c11850f79a363bbbeeb1c7ff7902f30fcca8e3 --- /dev/null +++ b/res/values/lineage_colors.xml @@ -0,0 +1,25 @@ + + + + + @*android:color/accent_device_default_light + #ffab47bc + #fff2a600 + #ffec407a + #ffc0ca33 + + diff --git a/src/com/android/settings/deviceinfo/StorageSettings.java b/src/com/android/settings/deviceinfo/StorageSettings.java index cf9d34b3bcacdb61a7d805840afaac3b700dcb0a..32a739ed2131ee6e9b28b26851e2204d90ede3c4 100644 --- a/src/com/android/settings/deviceinfo/StorageSettings.java +++ b/src/com/android/settings/deviceinfo/StorageSettings.java @@ -1,5 +1,6 @@ /* * 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. @@ -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; @@ -169,11 +162,13 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index final List 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) {