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

Commit 6ac833c9 authored by Chris Wren's avatar Chris Wren Committed by Android (Google) Code Review
Browse files

Merge "re-use status bar DateView in QuickSettings." into jb-mr1-dev

parents fb4a113a 9c022dff
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -29,10 +29,11 @@
        android:hand_hour="@drawable/ic_qs_clock_hour"
        android:hand_minute="@drawable/ic_qs_clock_minute"
        />
    <com.android.systemui.statusbar.policy.QuickSettingsDateView
    <com.android.systemui.statusbar.policy.DateView
        android:textAppearance="@style/TextAppearance.QuickSettings.TileView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:gravity="center"
        />
</LinearLayout>
+0 −45
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.policy;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.text.format.DateFormat;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import android.widget.TextView;

import com.android.systemui.R;

import java.util.Date;

public final class QuickSettingsDateView extends DateView {

    public QuickSettingsDateView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    protected void updateClock() {
        final Context context = getContext();
        Date now = new Date();
        CharSequence dow = DateFormat.format("MMM d, yyyy", now);
        setText(dow);
    }
}