Update the storage summary header.

This changes it to now have a donut graph and reflects the new UI.
Finalized redlines are still pending, so there will be a follow
up patch to get everything aligned as per the mocks.

Bug: 33199077
Test: Settings Robo Tests
Change-Id: Ic12a77bd9be335af14f80886d1ecc24c82940e9b
This commit is contained in:
Daniel Nishi
2017-01-04 16:17:42 -08:00
parent 033dc469e5
commit b465005c29
10 changed files with 336 additions and 76 deletions

View File

@@ -46,7 +46,6 @@ public class StorageDashboardFragment extends DashboardFragment {
private static final String TAG = "StorageDashboardFrag";
private VolumeInfo mVolume;
private long mTotalSize;
private StorageSummaryDonutPreferenceController mSummaryController;
private StorageItemPreferenceController mPreferenceController;
@@ -70,16 +69,16 @@ public class StorageDashboardFragment extends DashboardFragment {
}
final long sharedDataSize = mVolume.getPath().getTotalSpace();
mTotalSize = sm.getPrimaryStorageSize();
long systemSize = mTotalSize - sharedDataSize;
long totalSize = sm.getPrimaryStorageSize();
long systemSize = totalSize - sharedDataSize;
if (mTotalSize <= 0) {
mTotalSize = sharedDataSize;
if (totalSize <= 0) {
totalSize = sharedDataSize;
systemSize = 0;
}
final long usedBytes = mTotalSize - mVolume.getPath().getFreeSpace();
mSummaryController.updateBytes(usedBytes, mTotalSize);
final long usedBytes = totalSize - mVolume.getPath().getFreeSpace();
mSummaryController.updateBytes(usedBytes, totalSize);
mPreferenceController.setVolume(mVolume);
mPreferenceController.setSystemSize(systemSize);
mPreferenceController.startMeasurement();
@@ -90,8 +89,6 @@ public class StorageDashboardFragment extends DashboardFragment {
pref.setFragment("com.android.settings.deletionhelper.AutomaticStorageManagerSettings");
pref.setIcon(R.drawable.ic_settings_storage);
pref.setEnabled(true);
}
@Override
@@ -128,13 +125,6 @@ public class StorageDashboardFragment extends DashboardFragment {
return controllers;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = super.onCreateView(inflater, container, savedInstanceState);
// TODO: Add loader to load the storage sizes for the StorageItemPreferenceControllers.
return root;
}
/**
* For Search.
*/