mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
show current state of the location-streaming in chatlist and chat
This commit is contained in:
@@ -1008,6 +1008,12 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isVerified(JNIEnv *env, jobjec
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isSendingLocations(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chat_is_sending_locations(get_dc_chat(env, obj))!=0;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jintArray Java_com_b44t_messenger_DcContext_getChatMedia(JNIEnv *env, jobject obj, jint chat_id, jint type1, jint type2, jint type3)
|
||||
{
|
||||
dc_array_t* ca = dc_get_chat_media(get_dc_context(env, obj), chat_id, type1, type2, type3);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 811 B |
@@ -94,6 +94,7 @@
|
||||
<TextView android:id="@id/date"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:drawablePadding="5dp"
|
||||
style="@style/Signal.Text.Caption"
|
||||
android:textColor="?attr/conversation_list_item_date_color"
|
||||
tools:text="30 mins"
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
style="@style/TextSecure.SubtitleTextStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="5dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textDirection="ltr"
|
||||
|
||||
@@ -29,6 +29,7 @@ public class DcChat {
|
||||
public native boolean isUnpromoted ();
|
||||
public native boolean isSelfTalk ();
|
||||
public native boolean isVerified ();
|
||||
public native boolean isSendingLocations();
|
||||
|
||||
// working with raw c-data
|
||||
private long chatCPtr; // CAVE: the name is referenced in the JNI
|
||||
|
||||
@@ -1302,6 +1302,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
@Override
|
||||
public void handleEvent(int eventId, Object data1, Object data2) {
|
||||
if (eventId==DcContext.DC_EVENT_CHAT_MODIFIED || eventId==DcContext.DC_EVENT_CONTACTS_CHANGED) {
|
||||
dcChat = dcContext.getChat(chatId);
|
||||
titleView.setTitle(glideRequests, dcChat);
|
||||
updateReminders();
|
||||
initializeSecurity(isSecureText, isDefaultSms);
|
||||
|
||||
@@ -157,6 +157,8 @@ public class ConversationListItem extends RelativeLayout
|
||||
dateView.setText("");
|
||||
}
|
||||
|
||||
dateView.setCompoundDrawablesWithIntrinsicBounds(0, 0,
|
||||
thread.isSendingLocations()? R.drawable.ic_location_state : 0, 0);
|
||||
|
||||
setStatusIcons(thread);
|
||||
setBatchState(batchMode);
|
||||
@@ -193,8 +195,10 @@ public class ConversationListItem extends RelativeLayout
|
||||
this.glideRequests = glideRequests;
|
||||
|
||||
fromView.setText(getHighlightedSpan(locale, contact.getDisplayName(), highlightSubstring));
|
||||
fromView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
subjectView.setText(getHighlightedSpan(locale, contact.getAddr(), highlightSubstring));
|
||||
dateView.setText("");
|
||||
dateView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
archivedView.setVisibility(GONE);
|
||||
unreadIndicator.setVisibility(GONE);
|
||||
deliveryStatusIndicator.setNone();
|
||||
@@ -217,6 +221,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
this.glideRequests = glideRequests;
|
||||
|
||||
fromView.setText(recipient, true);
|
||||
fromView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
subjectView.setText(getHighlightedSpan(locale, messageResult.getSummarytext(512), highlightSubstring));
|
||||
|
||||
long timestamp = messageResult.getTimestamp();
|
||||
@@ -226,6 +231,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
else {
|
||||
dateView.setText("");
|
||||
}
|
||||
dateView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
archivedView.setVisibility(GONE);
|
||||
unreadIndicator.setVisibility(GONE);
|
||||
deliveryStatusIndicator.setNone();
|
||||
|
||||
@@ -55,6 +55,7 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
|
||||
int imgLeft = 0;
|
||||
int imgRight = 0;
|
||||
int imgSubtitleRight = 0;
|
||||
|
||||
if (dcChat == null) {
|
||||
setComposeTitle();
|
||||
@@ -67,9 +68,14 @@ public class ConversationTitleView extends RelativeLayout {
|
||||
imgRight = R.drawable.ic_verified;
|
||||
}
|
||||
this.avatar.setAvatar(glideRequests, DcHelper.getContext(getContext()).getRecipient(dcChat), false);
|
||||
|
||||
if (dcChat.isSendingLocations()) {
|
||||
imgSubtitleRight = R.drawable.ic_location_state;
|
||||
}
|
||||
}
|
||||
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(imgLeft, 0, imgRight, 0);
|
||||
subtitle.setCompoundDrawablesWithIntrinsicBounds(0, 0, imgSubtitleRight, 0);
|
||||
}
|
||||
|
||||
public void hideAvatar() {
|
||||
|
||||
@@ -259,7 +259,7 @@ public class ApplicationDcContext extends DcContext {
|
||||
|
||||
return new ThreadRecord(context, body, recipient, date,
|
||||
unreadCount, chatId,
|
||||
archived, verified, summary);
|
||||
archived, verified, chat.isSendingLocations(), summary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,13 +47,16 @@ public class ThreadRecord {
|
||||
private final int unreadCount;
|
||||
private final boolean archived;
|
||||
private final boolean verified;
|
||||
private final boolean isSendingLocations;
|
||||
private @Nullable final DcLot dcSummary;
|
||||
|
||||
public ThreadRecord(@NonNull Context context, @NonNull String body,
|
||||
@NonNull Recipient recipient, long dateReceived, int unreadCount,
|
||||
long threadId,
|
||||
boolean archived,
|
||||
boolean verified, @Nullable DcLot dcSummary)
|
||||
boolean verified,
|
||||
boolean isSendingLocations,
|
||||
@Nullable DcLot dcSummary)
|
||||
{
|
||||
this.context = context.getApplicationContext();
|
||||
this.threadId = threadId;
|
||||
@@ -63,6 +66,7 @@ public class ThreadRecord {
|
||||
this.unreadCount = unreadCount;
|
||||
this.archived = archived;
|
||||
this.verified = verified;
|
||||
this.isSendingLocations = isSendingLocations;
|
||||
this.dcSummary = dcSummary;
|
||||
}
|
||||
|
||||
@@ -113,4 +117,8 @@ public class ThreadRecord {
|
||||
public boolean isVerified() {
|
||||
return verified;
|
||||
}
|
||||
|
||||
public boolean isSendingLocations() {
|
||||
return isSendingLocations;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user