Skip to content

Commit 0c8f623

Browse files
committed
Fix commons-app#3191 Make the username along with the rewards icon clickable in the Navigation Drawer
1 parent eb40051 commit 0c8f623

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import android.view.MenuItem;
1414
import android.view.View;
1515
import android.widget.ImageView;
16+
import android.widget.LinearLayout;
1617
import android.widget.TextView;
1718
import android.widget.Toast;
1819

@@ -136,7 +137,7 @@ private void setUserName() {
136137
if (allAccounts.length != 0) {
137138
username.setText(allAccounts[0].name);
138139
}
139-
ImageView userIcon = navHeaderView.findViewById(R.id.user_icon);
140+
LinearLayout userIcon = navHeaderView.findViewById(R.id.user_details);
140141
userIcon.setOnClickListener(v -> {
141142
drawerLayout.closeDrawer(navigationView);
142143
AchievementsActivity.startYourself(NavigationBaseActivity.this);

app/src/main/res/layout/drawer_header.xml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
app:srcCompat="@drawable/commons_logo"/>
2020

2121
<LinearLayout
22+
android:id="@+id/user_details"
2223
android:layout_width="match_parent"
2324
android:layout_height="wrap_content"
2425
android:gravity="center"

0 commit comments

Comments
 (0)