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

Commit 76821d02 authored by Flavio Lerda's avatar Flavio Lerda
Browse files

Only show recent items in the new section.

This commit limits the set of items in the new section to items that
have been receiving within the last 7 days.

In order to make the unread items more visible even when they are not in
the new section, use highlighting on them, both in the text and the play
icon.

Bug: 5403047
Change-Id: I577c58bfcb9ef2031839092d50f41c357c7decba
parent 6493e0e4
Loading
Loading
Loading
Loading
+1.81 KiB
Loading image diff...
+1.35 KiB
Loading image diff...
+2.39 KiB
Loading image diff...
+1 −1
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ public class CallLogAdapter extends GroupingListAdapter
                    callTypes, date, duration, name, ntype, label, lookupUri, null);
        }

        final boolean isNew = CallLogQuery.isNewSection(c);
        final boolean isNew = c.getInt(CallLogQuery.IS_READ) == 0;
        // New items also use the highlighted version of the text.
        final boolean isHighlighted = isNew;
        mCallLogViewsHelper.setPhoneCallDetails(views, details, isHighlighted);
+4 −3
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ import android.view.View;

        if (canPlay) {
            // Playback action takes preference.
            configurePlaySecondaryAction(views);
            configurePlaySecondaryAction(views, isHighlighted);
            views.dividerView.setVisibility(View.VISIBLE);
        } else if (canCall) {
            // Call is the secondary action.
@@ -99,9 +99,10 @@ import android.view.View;
    }

    /** Sets the secondary action to correspond to the play button. */
    private void configurePlaySecondaryAction(CallLogListItemViews views) {
    private void configurePlaySecondaryAction(CallLogListItemViews views, boolean isHighlighted) {
        views.secondaryActionView.setVisibility(View.VISIBLE);
        views.secondaryActionView.setImageResource(R.drawable.ic_play);
        views.secondaryActionView.setImageResource(
                isHighlighted ? R.drawable.ic_play_active_holo_dark : R.drawable.ic_play_holo_dark);
        views.secondaryActionView.setContentDescription(
                mResources.getString(R.string.description_call_log_play_button));
    }
Loading