use of com.fastaccess.ui.adapter.LabelsAdapter in project FastHub by k0shk0sh.
the class FilterIssuesActivity method getLabelsAdapter.
private LabelsAdapter getLabelsAdapter() {
if (labelsAdapter == null) {
if (!getPresenter().getLabels().isEmpty()) {
LabelModel label = new LabelModel();
label.setName(getString(R.string.clear));
getPresenter().getLabels().add(0, label);
}
labelsAdapter = new LabelsAdapter(getPresenter().getLabels(), null);
labelsAdapter.setListener(new BaseViewHolder.OnItemClickListener<LabelModel>() {
@Override
public void onItemClick(int position, View v, LabelModel item) {
appendLabel(item);
}
@Override
public void onItemLongClick(int position, View v, LabelModel item) {
}
});
}
return labelsAdapter;
}
use of com.fastaccess.ui.adapter.LabelsAdapter in project FastHub by k0shk0sh.
the class LabelsDialogFragment method onFragmentCreated.
@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
stateLayout.setEmptyText(R.string.no_labels);
recycler.setEmptyView(stateLayout, refresh);
refresh.setOnRefreshListener(() -> getPresenter().onCallApi(1, null));
stateLayout.setOnReloadListener(v -> getPresenter().onCallApi(1, null));
recycler.addDivider();
title.setText(R.string.labels);
add.setVisibility(View.VISIBLE);
labelModels = getArguments().getParcelableArrayList(BundleConstant.EXTRA);
if (labelModels == null) {
labelModels = new ArrayList<>();
}
add.setVisibility(callback == null ? View.GONE : View.VISIBLE);
adapter = new LabelsAdapter(getPresenter().getLabels(), this);
recycler.setAdapter(adapter);
fastScroller.attachRecyclerView(recycler);
recycler.addOnScrollListener(getLoadMore());
if (getPresenter().getLabels().isEmpty() && !getPresenter().isApiCalled()) {
getPresenter().onCallApi(1, null);
}
}
Aggregations