use of com.owncloud.android.ui.decoration.MediaGridItemDecoration in project android by nextcloud.
the class UploadListActivity method setupContent.
private void setupContent() {
binding.list.setEmptyView(binding.emptyList.getRoot());
binding.emptyList.getRoot().setVisibility(View.GONE);
binding.emptyList.emptyListIcon.setImageResource(R.drawable.uploads);
binding.emptyList.emptyListIcon.getDrawable().mutate();
binding.emptyList.emptyListIcon.setAlpha(0.5f);
binding.emptyList.emptyListIcon.setVisibility(View.VISIBLE);
binding.emptyList.emptyListViewHeadline.setText(getString(R.string.upload_list_empty_headline));
binding.emptyList.emptyListViewText.setText(getString(R.string.upload_list_empty_text_auto_upload));
binding.emptyList.emptyListViewText.setVisibility(View.VISIBLE);
uploadListAdapter = new UploadListAdapter(this, uploadsStorageManager, getStorageManager(), userAccountManager, connectivityService, powerManagementService, clock);
final GridLayoutManager lm = new GridLayoutManager(this, 1);
uploadListAdapter.setLayoutManager(lm);
int spacing = getResources().getDimensionPixelSize(R.dimen.media_grid_spacing);
binding.list.addItemDecoration(new MediaGridItemDecoration(spacing));
binding.list.setLayoutManager(lm);
binding.list.setAdapter(uploadListAdapter);
ThemeLayoutUtils.colorSwipeRefreshLayout(this, swipeListRefreshLayout);
swipeListRefreshLayout.setOnRefreshListener(this::refresh);
loadItems();
}
use of com.owncloud.android.ui.decoration.MediaGridItemDecoration in project android by nextcloud.
the class SyncedFoldersActivity method setupContent.
/**
* sets up the UI elements and loads all media/synced folders.
*/
private void setupContent() {
final int gridWidth = getResources().getInteger(R.integer.media_grid_width);
boolean lightVersion = getResources().getBoolean(R.bool.syncedFolder_light);
adapter = new SyncedFolderAdapter(this, clock, gridWidth, this, lightVersion);
syncedFolderProvider = new SyncedFolderProvider(getContentResolver(), preferences, clock);
binding.emptyList.emptyListIcon.setImageResource(R.drawable.nav_synced_folders);
ThemeButtonUtils.colorPrimaryButton(binding.emptyList.emptyListViewAction, this);
final GridLayoutManager lm = new GridLayoutManager(this, gridWidth);
adapter.setLayoutManager(lm);
int spacing = getResources().getDimensionPixelSize(R.dimen.media_grid_spacing);
binding.list.addItemDecoration(new MediaGridItemDecoration(spacing));
binding.list.setLayoutManager(lm);
binding.list.setAdapter(adapter);
load(gridWidth * 2, false);
}
Aggregations