Search in sources :

Example 16 with DirectoryFragment

use of com.android.documentsui.dirlist.DirectoryFragment in project android_frameworks_base by AOSPA.

the class BaseActivity method setDisplayFileSize.

/**
     * Set file size visible based on explicit user action.
     */
void setDisplayFileSize(boolean display) {
    Metrics.logUserAction(this, display ? Metrics.USER_ACTION_SHOW_SIZE : Metrics.USER_ACTION_HIDE_SIZE);
    LocalPreferences.setDisplayFileSize(this, display);
    mState.showSize = display;
    DirectoryFragment dir = getDirectoryFragment();
    if (dir != null) {
        dir.onDisplayStateChanged();
    }
    invalidateOptionsMenu();
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Example 17 with DirectoryFragment

use of com.android.documentsui.dirlist.DirectoryFragment in project android_frameworks_base by AOSPA.

the class BaseActivity method setUserSortOrder.

/**
     * Set state sort order based on explicit user action.
     */
void setUserSortOrder(int sortOrder) {
    switch(sortOrder) {
        case State.SORT_ORDER_DISPLAY_NAME:
            Metrics.logUserAction(this, Metrics.USER_ACTION_SORT_NAME);
            break;
        case State.SORT_ORDER_LAST_MODIFIED:
            Metrics.logUserAction(this, Metrics.USER_ACTION_SORT_DATE);
            break;
        case State.SORT_ORDER_SIZE:
            Metrics.logUserAction(this, Metrics.USER_ACTION_SORT_SIZE);
            break;
    }
    mState.userSortOrder = sortOrder;
    DirectoryFragment dir = getDirectoryFragment();
    if (dir != null) {
        dir.onSortOrderChanged();
    }
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Example 18 with DirectoryFragment

use of com.android.documentsui.dirlist.DirectoryFragment in project android_frameworks_base by AOSPA.

the class BaseActivity method setViewMode.

/**
     * Set mode based on explicit user action.
     */
void setViewMode(@ViewMode int mode) {
    if (mode == State.MODE_GRID) {
        Metrics.logUserAction(this, Metrics.USER_ACTION_GRID);
    } else if (mode == State.MODE_LIST) {
        Metrics.logUserAction(this, Metrics.USER_ACTION_LIST);
    }
    LocalPreferences.setViewMode(this, getCurrentRoot(), mode);
    mState.derivedMode = mode;
    // view icon needs to be updated, but we *could* do it
    // in onOptionsItemSelected, and not do the full invalidation
    // But! That's a larger refactoring we'll save for another day.
    invalidateOptionsMenu();
    DirectoryFragment dir = getDirectoryFragment();
    if (dir != null) {
        dir.onViewModeChanged();
    }
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Example 19 with DirectoryFragment

use of com.android.documentsui.dirlist.DirectoryFragment in project android_frameworks_base by AOSPA.

the class BaseActivity method onBackPressed.

@Override
public void onBackPressed() {
    // While action bar is expanded, the state stack UI is hidden.
    if (mSearchManager.cancelSearch()) {
        return;
    }
    DirectoryFragment dir = getDirectoryFragment();
    if (dir != null && dir.onBackPressed()) {
        return;
    }
    if (!mState.hasLocationChanged()) {
        super.onBackPressed();
        return;
    }
    if (onBeforePopDir() || popDir()) {
        return;
    }
    super.onBackPressed();
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Example 20 with DirectoryFragment

use of com.android.documentsui.dirlist.DirectoryFragment in project android_frameworks_base by DirtyUnicorns.

the class BaseActivity method onBackPressed.

@Override
public void onBackPressed() {
    // While action bar is expanded, the state stack UI is hidden.
    if (mSearchManager.cancelSearch()) {
        return;
    }
    DirectoryFragment dir = getDirectoryFragment();
    if (dir != null && dir.onBackPressed()) {
        return;
    }
    if (!mState.hasLocationChanged()) {
        super.onBackPressed();
        return;
    }
    if (onBeforePopDir() || popDir()) {
        return;
    }
    super.onBackPressed();
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Aggregations

DirectoryFragment (com.android.documentsui.dirlist.DirectoryFragment)30 Intent (android.content.Intent)5 RootInfo (com.android.documentsui.model.RootInfo)5