Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ae6840c authored by InfinityDeltaX's avatar InfinityDeltaX
Browse files

Added preferences for controlling the delay for a new timestamp and...

Added preferences for controlling the delay for a new timestamp and force-enabling timestamps for all messages.
parent dfb849d6
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -282,7 +282,9 @@ public class MessageListAdapter extends RecyclerCursorAdapter<MessageListViewHol

        MessageItem messageItem2 = getItem(position + 1);

        if (messageItem.mDeliveryStatus != MessageItem.DeliveryStatus.NONE) {
        if(mPrefs.getBoolean(SettingsFragment.FORCE_TIMESTAMPS, false)) {
            return true;
        } else if (messageItem.mDeliveryStatus != MessageItem.DeliveryStatus.NONE) {
            return true;
        } else if (messageItem.isFailedMessage()) {
            return true;
@@ -291,7 +293,7 @@ public class MessageListAdapter extends RecyclerCursorAdapter<MessageListViewHol
        } else if (messagesFromDifferentPeople(messageItem, messageItem2)) {
            return true;
        } else {
            int MAX_DURATION = 60 * 60 * 1000;
            int MAX_DURATION = Integer.parseInt(mPrefs.getString(SettingsFragment.SHOW_NEW_TIMESTAMP_DELAY, "60")) * 60 * 1000;
            return (messageItem2.mDate - messageItem.mDate >= MAX_DURATION);
        }
    }
@@ -317,7 +319,9 @@ public class MessageListAdapter extends RecyclerCursorAdapter<MessageListViewHol
    private boolean messagesFromDifferentPeople(MessageItem a, MessageItem b) {
        return (a.mAddress != null && b.mAddress != null &&
                !a.mAddress.equals(b.mAddress) &&
                !a.isOutgoingMessage() && !b.isOutgoingMessage());
                !a.isOutgoingMessage(

                ) && !b.isOutgoingMessage());
    }

    private int getBubbleBackgroundResource(boolean showAvatar, boolean isMine) {
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
    public static final String AUTO_EMOJI = "pref_key_auto_emoji";
    public static final String MARKDOWN_ENABLED = "pref_key_markdown_enabled";
    public static final String ENTER_BUTTON = "pref_key_enter_button";
    public static final String FORCE_TIMESTAMPS = "pref_key_force_timestamps";
    public static final String SHOW_NEW_TIMESTAMP_DELAY = "pref_key_timestamp_delay";
    public static final String COMPOSE_FAVORITES = "pref_key_compose_favorites";
    public static final String FONT_FAMILY = "pref_key_font_family";
    public static final String FONT_SIZE = "pref_key_font_size";
+4 −0
Original line number Diff line number Diff line
@@ -157,6 +157,10 @@

    <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_force_timestamps">Force timestamps</string>
    <string name="pref_force_timestamps_summary">Enable timestamps for all messages</string>
    <string name="pref_key_timestamp_delay">New timestamp delay</string>
    <string name="pref_key_timestamp_delay_summary">The number of minutes which must elapse between two messages in order for a new timestamp to be shown.</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_prox_sensor_call">Proximity sensor</string>
+16 −0
Original line number Diff line number Diff line
@@ -137,6 +137,22 @@
            android:summary="@string/pref_sent_timestamps_summary"
            android:title="@string/pref_sent_timestamps"
            android:widgetLayout="@layout/view_switch" />
        <EditTextPreference
            android:defaultValue="60"
            android:dependency="pref_key_force_timestamps"
            android:inputType="number"
            android:key="pref_key_timestamp_delay"
            android:layout="@layout/list_item_preference"
            android:summary="@string/pref_key_timestamp_delay_summary"
            android:title="@string/pref_key_timestamp_delay" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:key="pref_key_force_timestamps"
            android:layout="@layout/list_item_preference"
            android:summary="@string/pref_force_timestamps_summary"
            android:title="@string/pref_force_timestamps"
            android:widgetLayout="@layout/view_switch"
            android:disableDependentsState="true"/>
        <CheckBoxPreference
            android:defaultValue="true"
            android:key="pref_key_compose_favorites"