summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
index 186005c..720ab44 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
@@ -1,4 +1,7 @@
/*
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -105,11 +108,19 @@ 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.def_custom_dateformat)) {
+ return DateFormat.getDateFormat(getContext()).format(mCurrentTime);
+ } else {
+ return mDateFormat.format(mCurrentTime);
+ }
+ }
}