mirror of
https://github.com/gitnex-org/gitnex.git
synced 2026-03-22 21:13:45 -05:00
FAB for label in repo
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user