forked from upstream-mirrors/quik
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>()),
|
BLOCKED_FUTURE("pref_key_block_future", new HashSet<String>()),
|
||||||
MOBILE_ONLY("pref_key_mobile_only", false),
|
MOBILE_ONLY("pref_key_mobile_only", false),
|
||||||
ENTER_BUTTON("pref_key_enter_button", "0"),
|
ENTER_BUTTON("pref_key_enter_button", "0"),
|
||||||
|
SENT_TIMESTAMPS("pref_key_sent_timestamps", false),
|
||||||
STARRED_CONTACTS("pref_key_compose_favorites", true),
|
STARRED_CONTACTS("pref_key_compose_favorites", true),
|
||||||
PROXIMITY_SENSOR("pref_key_prox_sensor_calling", false),
|
PROXIMITY_SENSOR("pref_key_prox_sensor_calling", false),
|
||||||
YAPPY_INTEGRATION("pref_key_endlessjabber", false),
|
YAPPY_INTEGRATION("pref_key_endlessjabber", false),
|
||||||
|
|||||||
@@ -20,14 +20,15 @@ package com.moez.QKSMS.ui.messagelist;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.ContentUris;
|
import android.content.ContentUris;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.Telephony.Mms;
|
import android.provider.Telephony.Mms;
|
||||||
import android.provider.Telephony.MmsSms;
|
import android.provider.Telephony.MmsSms;
|
||||||
import android.provider.Telephony.Sms;
|
import android.provider.Telephony.Sms;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.mms.util.DownloadManager;
|
import com.android.mms.util.DownloadManager;
|
||||||
import com.google.android.mms.MmsException;
|
import com.google.android.mms.MmsException;
|
||||||
import com.google.android.mms.pdu_alt.EncodedStringValue;
|
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.QKSMSApp;
|
||||||
import com.moez.QKSMS.R;
|
import com.moez.QKSMS.R;
|
||||||
import com.moez.QKSMS.common.formatter.FormatterFactory;
|
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.ItemLoadedCallback;
|
||||||
import com.moez.QKSMS.common.google.ItemLoadedFuture;
|
import com.moez.QKSMS.common.google.ItemLoadedFuture;
|
||||||
import com.moez.QKSMS.common.google.PduLoaderManager;
|
import com.moez.QKSMS.common.google.PduLoaderManager;
|
||||||
import com.moez.QKSMS.common.utils.AddressUtils;
|
import com.moez.QKSMS.common.utils.AddressUtils;
|
||||||
import com.moez.QKSMS.common.utils.DateFormatter;
|
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 com.moez.QKSMS.transaction.SmsHelper;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -119,6 +121,7 @@ public class MessageItem {
|
|||||||
mHighlight = highlight;
|
mHighlight = highlight;
|
||||||
mType = type;
|
mType = type;
|
||||||
mColumnsMap = columnsMap;
|
mColumnsMap = columnsMap;
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||||
|
|
||||||
if ("sms".equals(type)) {
|
if ("sms".equals(type)) {
|
||||||
mReadReport = false; // No read reports in sms
|
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.
|
// Unless the message is currently in the progress of being sent, it gets a time stamp.
|
||||||
if (!isOutgoingMessage()) {
|
if (!isOutgoingMessage()) {
|
||||||
// Set "received" or "sent" time stamp
|
// 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);
|
mTimestamp = DateFormatter.getMessageTimestamp(context, mDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,6 +155,8 @@
|
|||||||
<string name="pref_sliding_tab">Sliding panel tab</string>
|
<string name="pref_sliding_tab">Sliding panel tab</string>
|
||||||
<string name="pref_sliding_tab_summary">Sliding tab that allows you to quickly view your last conversation</string>
|
<string name="pref_sliding_tab_summary">Sliding tab that allows you to quickly view your last conversation</string>
|
||||||
|
|
||||||
|
<string name="pref_sent_timestamps">Sent timestamps</string>
|
||||||
|
<string name="pref_sent_timestamps_summary">Show the timestamp for when a message was sent, not received</string>
|
||||||
<string name="pref_compose_favorites">Starred contacts</string>
|
<string name="pref_compose_favorites">Starred contacts</string>
|
||||||
<string name="pref_compose_summary_favorites">Show your starred contacts in the QK Compose window, making them only a tap away</string>
|
<string name="pref_compose_summary_favorites">Show your starred contacts in the QK Compose window, making them only a tap away</string>
|
||||||
<string name="pref_prox_sensor_call">Proximity sensor</string>
|
<string name="pref_prox_sensor_call">Proximity sensor</string>
|
||||||
|
|||||||
@@ -130,6 +130,13 @@
|
|||||||
android:layout="@layout/list_item_preference"
|
android:layout="@layout/list_item_preference"
|
||||||
android:summary="@string/pref_enter_button_summary"
|
android:summary="@string/pref_enter_button_summary"
|
||||||
android:title="@string/pref_enter_button" />
|
android:title="@string/pref_enter_button" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_key_sent_timestamps"
|
||||||
|
android:layout="@layout/list_item_preference"
|
||||||
|
android:summary="@string/pref_sent_timestamps_summary"
|
||||||
|
android:title="@string/pref_sent_timestamps"
|
||||||
|
android:widgetLayout="@layout/view_switch" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="pref_key_compose_favorites"
|
android:key="pref_key_compose_favorites"
|
||||||
|
|||||||
Reference in New Issue
Block a user