mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
FAB for label in repo
This commit is contained in:
parent
d2960fa13b
commit
e8878c90c0
|
@ -55,6 +55,9 @@ public class LabelsFragment extends Fragment {
|
|||
FragmentLabelsBinding.inflate(inflater, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
boolean canPush = repository.getPermissions().isPush();
|
||||
boolean archived = repository.getRepository().isArchived();
|
||||
|
||||
final SwipeRefreshLayout swipeRefresh = fragmentLabelsBinding.pullToRefresh;
|
||||
noData = fragmentLabelsBinding.noData;
|
||||
|
||||
|
@ -79,6 +82,15 @@ public class LabelsFragment extends Fragment {
|
|||
|
||||
fetchDataAsync(repository.getOwner(), repository.getName());
|
||||
|
||||
if (!canPush || archived) {
|
||||
fragmentLabelsBinding.createLabel.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
fragmentLabelsBinding.createLabel.setOnClickListener(
|
||||
v112 -> {
|
||||
startActivity(repository.getIntent(getContext(), CreateLabelActivity.class));
|
||||
});
|
||||
|
||||
return fragmentLabelsBinding.getRoot();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue