Merge "Fix default clock localization in keyguard." into klp-dev
This commit is contained in:
@@ -29,8 +29,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/clock_white"
|
||||
android:format12Hour="@string/abbrev_wday_month_day_no_year"
|
||||
android:format24Hour="@string/abbrev_wday_month_day_no_year"
|
||||
style="@style/widget_label"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
@@ -16,7 +16,5 @@
|
||||
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- String matching the lock screen format for displaying the date. -->
|
||||
<string name="abbrev_wday_month_day_no_year">EEE, MMMM d</string>
|
||||
<!-- Format for describing the date, for accessibility. -->
|
||||
<string name="full_wday_month_day_no_year">EEEE, MMMM d</string>
|
||||
<string name="abbrev_wday_month_day_no_year">EEEMMMMd</string>
|
||||
</resources>
|
||||
|
||||
@@ -17,24 +17,20 @@
|
||||
package com.android.keyguard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateFormat;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
import android.view.View;
|
||||
import android.widget.GridLayout;
|
||||
import android.widget.TextClock;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import libcore.icu.ICU;
|
||||
|
||||
public class KeyguardStatusView extends GridLayout {
|
||||
private static final boolean DEBUG = KeyguardViewMediator.DEBUG;
|
||||
private static final String TAG = "KeyguardStatusView";
|
||||
@@ -42,6 +38,7 @@ public class KeyguardStatusView extends GridLayout {
|
||||
private LockPatternUtils mLockPatternUtils;
|
||||
|
||||
private TextView mAlarmStatusView;
|
||||
private TextClock mDateView;
|
||||
|
||||
private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
|
||||
|
||||
@@ -58,10 +55,12 @@ public class KeyguardStatusView extends GridLayout {
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onScreenTurnedOn() {
|
||||
setEnableMarquee(true);
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onScreenTurnedOff(int why) {
|
||||
setEnableMarquee(false);
|
||||
};
|
||||
@@ -88,6 +87,7 @@ public class KeyguardStatusView extends GridLayout {
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
mAlarmStatusView = (TextView) findViewById(R.id.alarm_status);
|
||||
mDateView = (TextClock) findViewById(R.id.date_view);
|
||||
mLockPatternUtils = new LockPatternUtils(getContext());
|
||||
final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
|
||||
setEnableMarquee(screenOn);
|
||||
@@ -95,7 +95,11 @@ public class KeyguardStatusView extends GridLayout {
|
||||
}
|
||||
|
||||
protected void refresh() {
|
||||
refreshAlarmStatus(); // might as well
|
||||
final String fmt = DateFormat.getBestDateTimePattern(Locale.getDefault(),
|
||||
mContext.getResources().getString(R.string.abbrev_wday_month_day_no_year));
|
||||
mDateView.setFormat24Hour(fmt);
|
||||
mDateView.setFormat12Hour(fmt);
|
||||
refreshAlarmStatus();
|
||||
}
|
||||
|
||||
void refreshAlarmStatus() {
|
||||
|
||||
Reference in New Issue
Block a user