mirror of
https://gitlab.com/xynngh/YetAnotherCallBlocker.git
synced 2025-06-05 22:19:12 +02:00
Ellipsize names in call log
This commit is contained in:
@@ -152,7 +152,8 @@ public class CallLogItemRecyclerViewAdapter
|
|||||||
callTypeIcon.setImageDrawable(null);
|
callTypeIcon.setImageDrawable(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
label.setText(item.numberInfo.name != null ? item.numberInfo.name : item.number);
|
label.setText(ellipsize(
|
||||||
|
item.numberInfo.name != null ? item.numberInfo.name : item.number, 15));
|
||||||
|
|
||||||
IconAndColor iconAndColor = IconAndColor.forNumberRating(
|
IconAndColor iconAndColor = IconAndColor.forNumberRating(
|
||||||
item.numberInfo.rating, item.numberInfo.contactItem != null);
|
item.numberInfo.rating, item.numberInfo.contactItem != null);
|
||||||
@@ -166,6 +167,12 @@ public class CallLogItemRecyclerViewAdapter
|
|||||||
time.setText(DateUtils.getRelativeTimeSpanString(item.timestamp));
|
time.setText(DateUtils.getRelativeTimeSpanString(item.timestamp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String ellipsize(String s, int maxLength) {
|
||||||
|
return s == null || s.length() <= maxLength
|
||||||
|
? s
|
||||||
|
: (s.substring(0, maxLength - 1) + '…');
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString() + " '" + label.getText() + "'";
|
return super.toString() + " '" + label.getText() + "'";
|
||||||
|
Reference in New Issue
Block a user