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

Commit 5fb18aa5 authored by Chris Wren's avatar Chris Wren
Browse files

Copy date format style from keyguard.

Bug: 7312660
Change-Id: Ia5e728758bd1f2caa039ea6b8f8fa9abcc9f8417
parent e1f4ebf5
Loading
Loading
Loading
Loading
+22 −13
Original line number Diff line number Diff line
@@ -25,6 +25,11 @@
    android:gravity="center_vertical"
    android:baselineAligned="false"
    >
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <com.android.systemui.statusbar.policy.Clock
            android:id="@+id/clock"
            android:layout_width="wrap_content"
@@ -32,6 +37,7 @@
            android:layout_marginLeft="8dp"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
            android:gravity="bottom"
            />

        <com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
@@ -39,8 +45,11 @@
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
            android:gravity="bottom"
            />
    </LinearLayout>

    <Space
        android:layout_width="0dp"
+2 −5
Original line number Diff line number Diff line
@@ -17,10 +17,7 @@
 */
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- For formatting day of week and date in DateView.  %1$s is DOW, %2$s is date.
         We show both (DOW on one line, then the date) but this can be overridden for locales as
         necessary.
         -->
    <string name="status_bar_date_formatter">%1$s\n%2$s</string>
    <!-- Date format for display: should match the lockscreen in /policy.  -->
    <string name="abbrev_wday_month_day_no_year">@*android:string/abbrev_wday_month_day_no_year</string>

</resources>
+2 −5
Original line number Diff line number Diff line
@@ -87,11 +87,8 @@ public class DateView extends TextView {
    }

    protected void updateClock() {
        final Context context = getContext();
        Date now = new Date();
        CharSequence dow = DateFormat.format("EEEE", now);
        CharSequence date = DateFormat.getLongDateFormat(context).format(now);
        setText(context.getString(R.string.status_bar_date_formatter, dow, date));
        final String dateFormat = getContext().getString(R.string.abbrev_wday_month_day_no_year);
        setText(DateFormat.format(dateFormat, new Date()));
    }

    private boolean isVisible() {