show avatar upload date

This commit is contained in:
Riko Sakurauchi 2019-06-19 21:25:52 +08:00
parent 1f97eae63a
commit 371ef6e8ff
No known key found for this signature in database
GPG Key ID: 25AC0345B92902AF
1 changed files with 20 additions and 2 deletions

View File

@ -5622,8 +5622,26 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (index < 0 || index >= imagesArrLocations.size()) {
return;
}
nameTextView.setText("");
dateTextView.setText("");
if (avatarsDialogId < 0) {
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-avatarsDialogId);
if (chat != null) {
nameTextView.setText(chat.title);
} else {
nameTextView.setText("");
}
} else {
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(avatarsDialogId);
if (user != null) {
nameTextView.setText(UserObject.getUserName(user));
} else {
nameTextView.setText("");
}
}
long date = (long) avatarsArr.get(switchingToIndex).date * 1000;
if (date != 0) {
String dateString = LocaleController.formatString("formatDateAtTime", R.string.formatDateAtTime, LocaleController.getInstance().formatterYear.format(new Date(date)), LocaleController.getInstance().formatterDay.format(new Date(date)));
dateTextView.setText(dateString);
}
if (avatarsDialogId == UserConfig.getInstance(currentAccount).getClientUserId() && !avatarsArr.isEmpty()) {
menuItem.showSubItem(gallery_menu_delete);
} else {