Search in sources :

Example 21 with DirectoryFragment

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

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 22 with DirectoryFragment

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

the class BaseActivity method toggleNavDrawerFocus.

/**
     * Toggles focus between the navigation drawer and the directory listing. If the drawer isn't
     * locked, open/close it as appropriate.
     */
void toggleNavDrawerFocus() {
    if (mNavDrawerHasFocus) {
        mDrawer.setOpen(false);
        DirectoryFragment df = DirectoryFragment.get(getFragmentManager());
        if (df != null) {
            df.requestFocus();
        }
    } else {
        mDrawer.setOpen(true);
        RootsFragment rf = RootsFragment.get(getFragmentManager());
        if (rf != null) {
            rf.requestFocus();
        }
    }
    mNavDrawerHasFocus = !mNavDrawerHasFocus;
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Example 23 with DirectoryFragment

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

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 24 with DirectoryFragment

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

the class BaseActivity method toggleNavDrawerFocus.

/**
     * Toggles focus between the navigation drawer and the directory listing. If the drawer isn't
     * locked, open/close it as appropriate.
     */
void toggleNavDrawerFocus() {
    if (mNavDrawerHasFocus) {
        mDrawer.setOpen(false);
        DirectoryFragment df = DirectoryFragment.get(getFragmentManager());
        if (df != null) {
            df.requestFocus();
        }
    } else {
        mDrawer.setOpen(true);
        RootsFragment rf = RootsFragment.get(getFragmentManager());
        if (rf != null) {
            rf.requestFocus();
        }
    }
    mNavDrawerHasFocus = !mNavDrawerHasFocus;
}
Also used : DirectoryFragment(com.android.documentsui.dirlist.DirectoryFragment)

Example 25 with DirectoryFragment

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

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