Loading core/res/res/values/customize.xml +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> <resources> <!-- custom date format or not --> <bool name="config_dateformat">false</bool> <!-- Used in LocalePicker, default language must be contained --> <string name="locale_codes" translatable="false"></string> Loading core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -2417,7 +2417,7 @@ <java-symbol type="drawable" name="platlogo_m" /> <!-- language/locale picker extention feature --> <java-symbol type="string" name="locale_codes" /> <java-symbol type="bool" name="config_dateformat" /> <java-symbol type="string" name="config_iccHotswapPromptForRestartDialogComponent" /> <java-symbol type="string" name="config_packagedKeyboardName" /> Loading packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +8 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.os.UserHandle; import android.provider.Settings; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.AttributeSet; Loading Loading @@ -236,8 +237,13 @@ public class KeyguardStatusView extends GridLayout { final String clockView24Skel = res.getString(R.string.clock_24hr_format); final String key = locale.toString() + dateViewSkel + clockView12Skel + clockView24Skel; if (key.equals(cacheKey)) return; if (res.getBoolean(com.android.internal.R.bool.config_dateformat)) { final String dateformat = Settings.System.getString(context.getContentResolver(), Settings.System.DATE_FORMAT); dateView = dateformat; } else { dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel); } clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel); if(!context.getResources().getBoolean(R.bool.config_showAmpm)){ Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java +9 −1 Original line number Diff line number Diff line Loading @@ -108,10 +108,18 @@ public class DateView extends TextView { mCurrentTime.setTime(System.currentTimeMillis()); final String text = mDateFormat.format(mCurrentTime); final String text = getDateFormat(); if (!text.equals(mLastText)) { setText(text); mLastText = text; } } private String getDateFormat() { if (getContext().getResources().getBoolean(com.android.internal.R.bool.config_dateformat)) { return android.text.format.DateFormat.getDateFormat(getContext()).format(mCurrentTime); } else { return mDateFormat.format(mCurrentTime); } } } Loading
core/res/res/values/customize.xml +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> <resources> <!-- custom date format or not --> <bool name="config_dateformat">false</bool> <!-- Used in LocalePicker, default language must be contained --> <string name="locale_codes" translatable="false"></string> Loading
core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -2417,7 +2417,7 @@ <java-symbol type="drawable" name="platlogo_m" /> <!-- language/locale picker extention feature --> <java-symbol type="string" name="locale_codes" /> <java-symbol type="bool" name="config_dateformat" /> <java-symbol type="string" name="config_iccHotswapPromptForRestartDialogComponent" /> <java-symbol type="string" name="config_packagedKeyboardName" /> Loading
packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +8 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.os.UserHandle; import android.provider.Settings; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.AttributeSet; Loading Loading @@ -236,8 +237,13 @@ public class KeyguardStatusView extends GridLayout { final String clockView24Skel = res.getString(R.string.clock_24hr_format); final String key = locale.toString() + dateViewSkel + clockView12Skel + clockView24Skel; if (key.equals(cacheKey)) return; if (res.getBoolean(com.android.internal.R.bool.config_dateformat)) { final String dateformat = Settings.System.getString(context.getContentResolver(), Settings.System.DATE_FORMAT); dateView = dateformat; } else { dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel); } clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel); if(!context.getResources().getBoolean(R.bool.config_showAmpm)){ Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java +9 −1 Original line number Diff line number Diff line Loading @@ -108,10 +108,18 @@ public class DateView extends TextView { mCurrentTime.setTime(System.currentTimeMillis()); final String text = mDateFormat.format(mCurrentTime); final String text = getDateFormat(); if (!text.equals(mLastText)) { setText(text); mLastText = text; } } private String getDateFormat() { if (getContext().getResources().getBoolean(com.android.internal.R.bool.config_dateformat)) { return android.text.format.DateFormat.getDateFormat(getContext()).format(mCurrentTime); } else { return mDateFormat.format(mCurrentTime); } } }