Search in sources :

Example 1 with SyncedFolderAdapter

use of com.owncloud.android.ui.adapter.SyncedFolderAdapter in project android by nextcloud.

the class SyncedFoldersActivity method setupContent.

/**
 * sets up the UI elements and loads all media/synced folders.
 */
private void setupContent() {
    mRecyclerView = findViewById(android.R.id.list);
    mProgress = findViewById(android.R.id.progress);
    mEmpty = findViewById(android.R.id.empty);
    final int gridWidth = getResources().getInteger(R.integer.media_grid_width);
    boolean lightVersion = getResources().getBoolean(R.bool.syncedFolder_light);
    mAdapter = new SyncedFolderAdapter(this, gridWidth, this, lightVersion);
    mSyncedFolderProvider = new SyncedFolderProvider(getContentResolver());
    final GridLayoutManager lm = new GridLayoutManager(this, gridWidth);
    mAdapter.setLayoutManager(lm);
    int spacing = getResources().getDimensionPixelSize(R.dimen.media_grid_spacing);
    mRecyclerView.addItemDecoration(new MediaGridItemDecoration(spacing));
    mRecyclerView.setLayoutManager(lm);
    mRecyclerView.setAdapter(mAdapter);
    BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation_view);
    if (getResources().getBoolean(R.bool.bottom_toolbar_enabled)) {
        bottomNavigationView.setVisibility(View.VISIBLE);
        DisplayUtils.setupBottomBar(bottomNavigationView, getResources(), this, -1);
    }
    load(gridWidth * 2, false);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) BottomNavigationView(android.support.design.widget.BottomNavigationView) MediaGridItemDecoration(com.owncloud.android.ui.decoration.MediaGridItemDecoration) SyncedFolderProvider(com.owncloud.android.datamodel.SyncedFolderProvider) SyncedFolderAdapter(com.owncloud.android.ui.adapter.SyncedFolderAdapter)

Aggregations

BottomNavigationView (android.support.design.widget.BottomNavigationView)1 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 SyncedFolderProvider (com.owncloud.android.datamodel.SyncedFolderProvider)1 SyncedFolderAdapter (com.owncloud.android.ui.adapter.SyncedFolderAdapter)1 MediaGridItemDecoration (com.owncloud.android.ui.decoration.MediaGridItemDecoration)1