mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Option to view sent timestamps instead of received
This commit is contained in:
@@ -54,6 +54,7 @@ public enum QKPreference {
|
||||
BLOCKED_FUTURE("pref_key_block_future", new HashSet<String>()),
|
||||
MOBILE_ONLY("pref_key_mobile_only", false),
|
||||
ENTER_BUTTON("pref_key_enter_button", "0"),
|
||||
SENT_TIMESTAMPS("pref_key_sent_timestamps", false),
|
||||
STARRED_CONTACTS("pref_key_compose_favorites", true),
|
||||
PROXIMITY_SENSOR("pref_key_prox_sensor_calling", false),
|
||||
YAPPY_INTEGRATION("pref_key_endlessjabber", false),
|
||||
|
||||
@@ -20,14 +20,15 @@ package com.moez.QKSMS.ui.messagelist;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.Telephony.Mms;
|
||||
import android.provider.Telephony.MmsSms;
|
||||
import android.provider.Telephony.Sms;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.mms.util.DownloadManager;
|
||||
import com.google.android.mms.MmsException;
|
||||
import com.google.android.mms.pdu_alt.EncodedStringValue;
|
||||
@@ -39,15 +40,16 @@ import com.google.android.mms.pdu_alt.RetrieveConf;
|
||||
import com.moez.QKSMS.QKSMSApp;
|
||||
import com.moez.QKSMS.R;
|
||||
import com.moez.QKSMS.common.formatter.FormatterFactory;
|
||||
import com.moez.QKSMS.data.Contact;
|
||||
import com.moez.QKSMS.model.SlideModel;
|
||||
import com.moez.QKSMS.model.SlideshowModel;
|
||||
import com.moez.QKSMS.model.TextModel;
|
||||
import com.moez.QKSMS.common.google.ItemLoadedCallback;
|
||||
import com.moez.QKSMS.common.google.ItemLoadedFuture;
|
||||
import com.moez.QKSMS.common.google.PduLoaderManager;
|
||||
import com.moez.QKSMS.common.utils.AddressUtils;
|
||||
import com.moez.QKSMS.common.utils.DateFormatter;
|
||||
import com.moez.QKSMS.data.Contact;
|
||||
import com.moez.QKSMS.enums.QKPreference;
|
||||
import com.moez.QKSMS.model.SlideModel;
|
||||
import com.moez.QKSMS.model.SlideshowModel;
|
||||
import com.moez.QKSMS.model.TextModel;
|
||||
import com.moez.QKSMS.transaction.SmsHelper;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
@@ -119,6 +121,7 @@ public class MessageItem {
|
||||
mHighlight = highlight;
|
||||
mType = type;
|
||||
mColumnsMap = columnsMap;
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||
|
||||
if ("sms".equals(type)) {
|
||||
mReadReport = false; // No read reports in sms
|
||||
@@ -157,7 +160,8 @@ public class MessageItem {
|
||||
// Unless the message is currently in the progress of being sent, it gets a time stamp.
|
||||
if (!isOutgoingMessage()) {
|
||||
// Set "received" or "sent" time stamp
|
||||
mDate = cursor.getLong(columnsMap.mColumnSmsDate);
|
||||
boolean sent = prefs.getBoolean(QKPreference.SENT_TIMESTAMPS.getKey(), false);
|
||||
mDate = cursor.getLong(sent ? columnsMap.mColumnSmsDateSent : columnsMap.mColumnSmsDate);
|
||||
mTimestamp = DateFormatter.getMessageTimestamp(context, mDate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user