improve coversation title's subtitle

This commit is contained in:
adbenitez
2024-01-20 02:46:34 -05:00
parent b1df4a70b2
commit 9fa07fe8f3
7 changed files with 25 additions and 15 deletions
+5
View File
@@ -1922,6 +1922,11 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_isBlocked(JNIEnv *env, jobj
return (jboolean)(dc_contact_is_blocked(get_dc_contact(env, obj))!=0);
}
JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_isBot(JNIEnv *env, jobject obj)
{
return (jboolean)(dc_contact_is_bot(get_dc_contact(env, obj))!=0);
}
JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_isVerified(JNIEnv *env, jobject obj)
{
+4 -3
View File
@@ -100,10 +100,11 @@
<string name="last_week">La semana pasada</string>
<string name="last_month">El mes pasado</string>
<!-- Refers to the time a contact was last seen. Shown below contact name in the profile. The placeholder will be replaced by date or time, resulting in "Last seen at 12:13 AM" or "Last seen Nov 12" -->
<string name="last_seen_at">Visto por última vez: %1$s</string>
<string name="last_seen_at">últ. vez: %1$s</string>
<!-- Refers to the time a contact was last seen. Shown below contact name in the profile. The placeholder will be replaced by a relative point in time as "3 minutes ago" (see https://momentjs.com for more examples and languages)-->
<string name="last_seen_relative">Visto por última vez: %1$s</string>
<string name="last_seen_unknown">Visto por última vez: Desconocido</string>
<string name="last_seen_relative">últ. vez: %1$s</string>
<string name="last_seen_unknown">últ. vez: Desconocido</string>
<string name="online">en línea</string>
<!-- Shown beside messages that are "N minutes old". Prefer short strings, or well-known abbreviations. -->
<plurals name="n_minutes">
<item quantity="one">%d min</item>
+5 -3
View File
@@ -8,6 +8,7 @@
<!-- the word "or" to separate blocks in the user interface that are mutually exclusive -->
<string name="or_separator">or</string>
<string name="clear_search">Clear Search</string>
<string name="bot">bot</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="select">Select</string>
@@ -101,10 +102,11 @@
<string name="last_week">Last week</string>
<string name="last_month">Last month</string>
<!-- Refers to the time a contact was last seen. Shown below contact name in the profile. The placeholder will be replaced by date or time, resulting in "Last seen at 12:13 AM" or "Last seen Nov 12" -->
<string name="last_seen_at">Last seen at %1$s</string>
<string name="last_seen_at">last seen at %1$s</string>
<!-- Refers to the time a contact was last seen. Shown below contact name in the profile. The placeholder will be replaced by a relative point in time as "3 minutes ago" (see https://momentjs.com for more examples and languages)-->
<string name="last_seen_relative">Last seen %1$s</string>
<string name="last_seen_unknown">Last seen: Unknown</string>
<string name="last_seen_relative">last seen %1$s</string>
<string name="last_seen_unknown">last seen: Unknown</string>
<string name="online">online</string>
<!-- Shown beside messages that are "N minutes old". Prefer short strings, or well-known abbreviations. -->
<plurals name="n_minutes">
<item quantity="one">%d min</item>
+1
View File
@@ -56,6 +56,7 @@ public class DcContact {
public native long getLastSeen ();
public native boolean wasSeenRecently();
public native boolean isBlocked ();
public native boolean isBot ();
public native boolean isVerified ();
public native int getVerifierId ();
@@ -255,8 +255,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
if (!isMultiUser()) {
eventCenter.addObserver(DcContext.DC_EVENT_INCOMING_MSG, this);
eventCenter.addObserver(DcContext.DC_EVENT_MSG_READ, this);
// handle DC_EVENT_MSG_DELIVERED to hide the seen-recently indicator if needed:
eventCenter.addObserver(DcContext.DC_EVENT_MSG_DELIVERED, this);
}
handleRelaying();
@@ -1489,11 +1487,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
setComposePanelVisibility();
initializeContactRequest();
} else if ((eventId == DcContext.DC_EVENT_INCOMING_MSG
|| eventId == DcContext.DC_EVENT_MSG_READ
|| eventId == DcContext.DC_EVENT_MSG_DELIVERED)
|| eventId == DcContext.DC_EVENT_MSG_READ)
&& event.getData1Int() == chatId) {
DcContact contact = recipient.getDcContact();
titleView.setSeenRecently(contact!=null? dcContext.getContact(contact.getId()).wasSeenRecently() : false);
dcChat = dcContext.getChat(chatId);
titleView.setTitle(glideRequests, dcChat);
}
}
@@ -110,8 +110,13 @@ public class ConversationTitleView extends RelativeLayout {
}
else {
DcContact dcContact = dcContext.getContact(chatContacts[0]);
if (profileView || !dcChat.isProtected()) {
isOnline = dcContact.wasSeenRecently();
if (profileView) {
subtitleStr = dcContact.getAddr();
} else if (false && dcContact.isBot()) {
subtitleStr = context.getString(R.string.bot);
} else if (isOnline) {
subtitleStr = context.getString(R.string.online);
} else {
long timestamp = dcContact.getLastSeen();
if (timestamp != 0) {
@@ -119,7 +124,6 @@ public class ConversationTitleView extends RelativeLayout {
subtitleStr = context.getString(R.string.last_seen_at, DateUtils.getExtendedTimeSpanString(context, locale, timestamp));
}
}
isOnline = dcContact.wasSeenRecently();
}
}