mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
* Fixes #3389 - Show User profiles * Don't show dummy achievements data - show data only when loaded
This commit is contained in:
parent
7ce80aa804
commit
88b21a678e
20 changed files with 358 additions and 48 deletions
|
|
@ -74,13 +74,20 @@ public class MoreBottomSheetFragment extends BottomSheetDialogFragment {
|
|||
* Set the username in navigationHeader.
|
||||
*/
|
||||
private void setUserName() {
|
||||
AccountManager accountManager = AccountManager.get(getActivity());
|
||||
Account[] allAccounts = accountManager.getAccountsByType(BuildConfig.ACCOUNT_TYPE);
|
||||
moreProfile.setText(getUserName());
|
||||
}
|
||||
|
||||
private String getUserName(){
|
||||
final AccountManager accountManager = AccountManager.get(getActivity());
|
||||
final Account[] allAccounts = accountManager.getAccountsByType(BuildConfig.ACCOUNT_TYPE);
|
||||
if (allAccounts.length != 0) {
|
||||
moreProfile.setText(allAccounts[0].name);
|
||||
return allAccounts[0].name;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@OnClick(R.id.more_logout)
|
||||
public void onLogoutClicked() {
|
||||
new AlertDialog.Builder(getActivity())
|
||||
|
|
@ -136,9 +143,7 @@ public class MoreBottomSheetFragment extends BottomSheetDialogFragment {
|
|||
|
||||
@OnClick(R.id.more_profile)
|
||||
public void onProfileClicked() {
|
||||
final Intent intent = new Intent(getActivity(), ProfileActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
getActivity().startActivity(intent);
|
||||
ProfileActivity.startYourself(getActivity(), getUserName(), false);
|
||||
}
|
||||
|
||||
@OnClick(R.id.more_peer_review)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue