Show ContributorsTab only if you have permission to (#402)
add isRepoAdmin extend Adapters add check to RepoDetails refactor var names reformat code Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/402 Reviewed-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
		@@ -125,6 +125,15 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // only show Collaborators if you have permission to
 | 
			
		||||
        final View collaboratorTab = vg.getChildAt(9);
 | 
			
		||||
        if (tinyDb.getBoolean("isRepoAdmin")) {
 | 
			
		||||
            collaboratorTab.setVisibility(View.VISIBLE);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            collaboratorTab.setVisibility(View.GONE);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
 | 
			
		||||
        tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user