Search in sources :

Example 1 with UploadListAdapter

use of com.owncloud.android.ui.adapter.UploadListAdapter 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();
}
Also used : GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) MediaGridItemDecoration(com.owncloud.android.ui.decoration.MediaGridItemDecoration) UploadListAdapter(com.owncloud.android.ui.adapter.UploadListAdapter)

Aggregations

GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)1 UploadListAdapter (com.owncloud.android.ui.adapter.UploadListAdapter)1 MediaGridItemDecoration (com.owncloud.android.ui.decoration.MediaGridItemDecoration)1