mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Remove unused name-order code.
This commit is contained in:
@@ -122,40 +122,6 @@ public class ContactsController {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static String formatName(String firstName, String lastName) {
|
||||
|
||||
if (firstName != null) {
|
||||
firstName = firstName.trim();
|
||||
}
|
||||
if (lastName != null) {
|
||||
lastName = lastName.trim();
|
||||
}
|
||||
StringBuilder result = new StringBuilder((firstName != null ? firstName.length() : 0) + (lastName != null ? lastName.length() : 0) + 1);
|
||||
if (LocaleController.nameDisplayOrder == 1) {
|
||||
if (firstName != null && firstName.length() > 0) {
|
||||
result.append(firstName);
|
||||
if (lastName != null && lastName.length() > 0) {
|
||||
result.append(" ");
|
||||
result.append(lastName);
|
||||
}
|
||||
} else if (lastName != null && lastName.length() > 0) {
|
||||
result.append(lastName);
|
||||
}
|
||||
} else {
|
||||
if (lastName != null && lastName.length() > 0) {
|
||||
result.append(lastName);
|
||||
if (firstName != null && firstName.length() > 0) {
|
||||
result.append(" ");
|
||||
result.append(firstName);
|
||||
}
|
||||
} else if (firstName != null && firstName.length() > 0) {
|
||||
result.append(firstName);
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
/* Handle contact images
|
||||
**********************************************************************************************/
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ import java.util.TimeZone;
|
||||
public class LocaleController {
|
||||
|
||||
public static boolean isRTL = false;
|
||||
public static int nameDisplayOrder = 1;
|
||||
public FastDateFormat formatterDay;
|
||||
public FastDateFormat formatterWeek;
|
||||
public FastDateFormat formatterMonth;
|
||||
@@ -153,7 +152,6 @@ public class LocaleController {
|
||||
lang = "en";
|
||||
}
|
||||
isRTL = lang.toLowerCase().equals("ar");
|
||||
nameDisplayOrder = lang.toLowerCase().equals("ko") ? 2 : 1;
|
||||
boolean is24HourFormat = DateFormat.is24HourFormat(ApplicationLoader.applicationContext);
|
||||
|
||||
formatterMonth = createFormatter(locale, ApplicationLoader.applicationContext.getString(R.string.formatterMonth), "dd MMM");
|
||||
|
||||
@@ -2087,34 +2087,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
|
||||
private void measureTime(MessageObject messageObject) {
|
||||
boolean hasSign = !messageObject.isOutOwner() && messageObject.messageOwner.from_id > 0 && messageObject.messageOwner.post;
|
||||
TLRPC.User signUser = MrMailbox.getUser(messageObject.messageOwner.from_id);
|
||||
if (hasSign && signUser == null) {
|
||||
hasSign = false;
|
||||
}
|
||||
String timeString = LocaleController.getInstance().formatterDay.format((long) (messageObject.messageOwner.date) * 1000);
|
||||
if (hasSign) {
|
||||
currentTimeString = ", " + timeString;
|
||||
} else {
|
||||
currentTimeString = timeString;
|
||||
}
|
||||
currentTimeString = LocaleController.getInstance().formatterDay.format((long) (messageObject.messageOwner.date) * 1000);
|
||||
timeTextWidth = timeWidth = (int) Math.ceil(timePaint.measureText(currentTimeString));
|
||||
|
||||
if (hasSign) {
|
||||
if (availableTimeWidth == 0) {
|
||||
availableTimeWidth = dp(1000);
|
||||
}
|
||||
CharSequence name = ContactsController.formatName(signUser.first_name, signUser.last_name).replace('\n', ' ');
|
||||
int widthForSign = availableTimeWidth - timeWidth;
|
||||
int width = (int) Math.ceil(timePaint.measureText(name, 0, name.length()));
|
||||
if (width > widthForSign) {
|
||||
name = TextUtils.ellipsize(name, timePaint, widthForSign, TextUtils.TruncateAt.END);
|
||||
width = widthForSign;
|
||||
}
|
||||
currentTimeString = name + currentTimeString;
|
||||
timeTextWidth += width;
|
||||
timeWidth += width;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDrawSelectedBackground() {
|
||||
|
||||
Reference in New Issue
Block a user