mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
fixed issues with code quality.
This commit is contained in:
parent
99f4f376bd
commit
dd8f9a4873
1 changed files with 8 additions and 6 deletions
|
|
@ -39,8 +39,6 @@ public abstract class NavigationBaseActivity extends BaseActivity
|
|||
@BindView(R.id.drawer_layout)
|
||||
DrawerLayout drawerLayout;
|
||||
|
||||
TextView username;
|
||||
|
||||
private ActionBarDrawerToggle toggle;
|
||||
|
||||
public void initDrawer() {
|
||||
|
|
@ -54,13 +52,17 @@ public abstract class NavigationBaseActivity extends BaseActivity
|
|||
toggle.setDrawerIndicatorEnabled(true);
|
||||
toggle.syncState();
|
||||
setDrawerPaneWidth();
|
||||
|
||||
View navHeaderView= navigationView.getHeaderView(0);
|
||||
username = (TextView) navHeaderView.findViewById(R.id.username);
|
||||
setUserName();
|
||||
}
|
||||
|
||||
public void setUserName() {
|
||||
/**
|
||||
* Set the username in navigationHeader
|
||||
*/
|
||||
private void setUserName() {
|
||||
|
||||
View navHeaderView = navigationView.getHeaderView(0);
|
||||
TextView username = (TextView) navHeaderView.findViewById(R.id.username);
|
||||
|
||||
AccountManager accountManager = AccountManager.get(this);
|
||||
Account[] allAccounts = accountManager.getAccountsByType(AccountUtil.accountType());
|
||||
if (allAccounts.length != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue