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

Commit c2c0b043 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where the chronometer was invisible

We were requiring the time to show in order to show the chronomer
which didn't make any sense.

Change-Id: Ia6d00d0932d272a6c5e20e8b41e3acfb53b7987a
Fixes: 28848113
parent a2a0171e
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -55,11 +55,9 @@ import android.text.style.RelativeSizeSpan;
import android.text.style.TextAppearanceSpan;
import android.util.Log;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.NotificationHeaderView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.RemoteViews;

@@ -3368,7 +3366,7 @@ public class Notification implements Parcelable
         *         otherwise
         */
        private boolean showsTimeOrChronometer() {
            return mN.showsTimeOrChronometer();
            return mN.showsTime() || mN.showsChronometer();
        }

        private void resetStandardTemplateWithActions(RemoteViews big) {
@@ -3864,14 +3862,21 @@ public class Notification implements Parcelable
    }

    /**
     * @return true if the notification will show the time or the chronometer; false
     *         otherwise
     * @return true if the notification will show the time; false otherwise
     * @hide
     */
    public boolean showsTimeOrChronometer() {
    public boolean showsTime() {
        return when != 0 && extras.getBoolean(EXTRA_SHOW_WHEN);
    }

    /**
     * @return true if the notification will show a chronometer; false otherwise
     * @hide
     */
    public boolean showsChronometer() {
        return when != 0 && extras.getBoolean(EXTRA_SHOW_CHRONOMETER);
    }

    /**
     * An object that can apply a rich notification style to a {@link Notification.Builder}
     * object.
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ public class NotificationHeaderUtil {
        }
        // in case no view is visible we make sure the time is visible
        int timeVisibility = !hasVisibleText
                || mRow.getStatusBarNotification().getNotification().showsTimeOrChronometer()
                || mRow.getStatusBarNotification().getNotification().showsTime()
                ? View.VISIBLE : View.GONE;
        time.setVisibility(timeVisibility);
        View left = null;