Search in sources :

Example 6 with SecondaryUserController

use of com.android.settings.deviceinfo.storage.SecondaryUserController in project android_packages_apps_Settings by omnirom.

the class StorageDashboardFragment method onReceivedSizes.

private void onReceivedSizes() {
    if (mStorageInfo == null || mAppsResult == null) {
        return;
    }
    if (getView().findViewById(R.id.loading_container).getVisibility() == View.VISIBLE) {
        setLoading(false, /* loading */
        true);
    }
    final long privateUsedBytes = mStorageInfo.totalBytes - mStorageInfo.freeBytes;
    mPreferenceController.setVolume(mSelectedStorageEntry.getVolumeInfo());
    mPreferenceController.setUsedSize(privateUsedBytes);
    mPreferenceController.setTotalSize(mStorageInfo.totalBytes);
    for (int i = 0, size = mSecondaryUsers.size(); i < size; i++) {
        final AbstractPreferenceController controller = mSecondaryUsers.get(i);
        if (controller instanceof SecondaryUserController) {
            SecondaryUserController userController = (SecondaryUserController) controller;
            userController.setTotalSize(mStorageInfo.totalBytes);
        }
    }
    mPreferenceController.onLoadFinished(mAppsResult, mUserId);
    updateSecondaryUserControllers(mSecondaryUsers, mAppsResult);
    setSecondaryUsersVisible(true);
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) SecondaryUserController(com.android.settings.deviceinfo.storage.SecondaryUserController)

Example 7 with SecondaryUserController

use of com.android.settings.deviceinfo.storage.SecondaryUserController in project android_packages_apps_Settings by omnirom.

the class StorageCategoryFragment method onReceivedSizes.

private void onReceivedSizes() {
    if (mStorageInfo == null || mAppsResult == null) {
        return;
    }
    if (getView().findViewById(R.id.loading_container).getVisibility() == View.VISIBLE) {
        setLoading(false, /* loading */
        true);
    }
    final long privateUsedBytes = mStorageInfo.totalBytes - mStorageInfo.freeBytes;
    mPreferenceController.setVolume(mSelectedStorageEntry.getVolumeInfo());
    mPreferenceController.setUsedSize(privateUsedBytes);
    mPreferenceController.setTotalSize(mStorageInfo.totalBytes);
    for (int i = 0, size = mSecondaryUsers.size(); i < size; i++) {
        final AbstractPreferenceController controller = mSecondaryUsers.get(i);
        if (controller instanceof SecondaryUserController) {
            SecondaryUserController userController = (SecondaryUserController) controller;
            userController.setTotalSize(mStorageInfo.totalBytes);
        }
    }
    mPreferenceController.onLoadFinished(mAppsResult, mUserId);
    updateSecondaryUserControllers(mSecondaryUsers, mAppsResult);
    setSecondaryUsersVisible(true);
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) SecondaryUserController(com.android.settings.deviceinfo.storage.SecondaryUserController)

Example 8 with SecondaryUserController

use of com.android.settings.deviceinfo.storage.SecondaryUserController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class StorageDashboardFragment method onReceivedSizes.

private void onReceivedSizes() {
    if (mStorageInfo != null) {
        long privateUsedBytes = mStorageInfo.totalBytes - mStorageInfo.freeBytes;
        mSummaryController.updateBytes(privateUsedBytes, mStorageInfo.totalBytes);
        mPreferenceController.setVolume(mVolume);
        mPreferenceController.setUsedSize(privateUsedBytes);
        mPreferenceController.setTotalSize(mStorageInfo.totalBytes);
        for (int i = 0, size = mSecondaryUsers.size(); i < size; i++) {
            AbstractPreferenceController controller = mSecondaryUsers.get(i);
            if (controller instanceof SecondaryUserController) {
                SecondaryUserController userController = (SecondaryUserController) controller;
                userController.setTotalSize(mStorageInfo.totalBytes);
            }
        }
    }
    if (mAppsResult == null) {
        return;
    }
    mPreferenceController.onLoadFinished(mAppsResult, UserHandle.myUserId());
    updateSecondaryUserControllers(mSecondaryUsers, mAppsResult);
    // setLoading always causes a flicker, so let's avoid doing it.
    if (getView().findViewById(R.id.loading_container).getVisibility() == View.VISIBLE) {
        setLoading(false, true);
    }
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) SecondaryUserController(com.android.settings.deviceinfo.storage.SecondaryUserController)

Aggregations

SecondaryUserController (com.android.settings.deviceinfo.storage.SecondaryUserController)8 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)8