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

Commit e8865178 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

Merge "Show date in system bar."

parents 06a42367 3b476abc
Loading
Loading
Loading
Loading
+23 −16
Original line number Diff line number Diff line
@@ -172,37 +172,44 @@
        android:layout_width="match_parent"
        android:layout_height="48dip"
        >
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:orientation="horizontal"
            >
            <!-- TODO: alarm -->
            <!-- TODO: sync -->
            <TextView android:id="@+id/date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />
        </LinearLayout>

        <TextView android:id="@+id/settings_button"
            style="@style/TextAppearance.StatusBar.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:paddingRight="32dip"
            android:paddingLeft="32dip"
            android:textSize="20sp"
            android:gravity="center"
            android:text="@string/system_panel_settings_button"
            />
        <View
            android:id="@+id/settings_left_divider"
            android:layout_height="match_parent"
            android:layout_width="1sp"
            android:layout_toLeftOf="@id/settings_button"
            android:background="@*android:drawable/divider_vertical_dark"
            />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:layout_toLeftOf="@id/settings_left_divider"
            android:orientation="horizontal"
            android:gravity="left|center_vertical"
            >
            <!-- TODO: alarm -->
            <!-- TODO: sync -->
            <com.android.systemui.statusbar.DateView
                android:id="@+id/date"
                style="@style/TextAppearance.StatusBar.SystemPanel"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:singleLine="true"
                android:gravity="center"
                />
        </LinearLayout>


    </RelativeLayout>
</com.android.systemui.statusbar.tablet.SystemPanel>
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
        parent="@android:style/TextAppearance.StatusBar">
        <item name="android:textAppearance">?android:attr/textAppearance</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">#50FFFFFF</item>
        <item name="android:textColor">#FF808080</item>
    </style>

    <style name="TextAppearance.StatusBar.TextButton"
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public final class DateView extends TextView {
        setText(DateFormat.getDateInstance(DateFormat.LONG).format(now));
    }

    void setUpdates(boolean update) {
    public void setUpdates(boolean update) {
        if (update != mUpdating) {
            mUpdating = update;
            if (update) {
+3 −0
Original line number Diff line number Diff line
@@ -431,6 +431,9 @@ public class SystemPanel extends LinearLayout implements StatusBarPanel {
    }

    public void onAttachedToWindow() {
        DateView date = (DateView)findViewById(R.id.date);
        date.setUpdates(true);

        TextView settingsButton = (TextView)findViewById(R.id.settings_button);
        settingsButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {