summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ingest
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2013-01-16 13:22:37 -0800
committerBobby Georgescu <georgescu@google.com>2013-01-16 13:22:37 -0800
commit2c0396a28ebf8cad71d234a82add2afb763a68f4 (patch)
treed00c533429a43d6350b01045b7db9fbe8aa6a7b8 /src/com/android/gallery3d/ingest
parent29aeb6bc6ca5e750fad9ff1da351b25969513030 (diff)
downloadandroid_packages_apps_Snap-2c0396a28ebf8cad71d234a82add2afb763a68f4.tar.gz
android_packages_apps_Snap-2c0396a28ebf8cad71d234a82add2afb763a68f4.tar.bz2
android_packages_apps_Snap-2c0396a28ebf8cad71d234a82add2afb763a68f4.zip
Importer date tiles reflect language change
Bug: 8020035 Change-Id: I1ac2a27ca7be088e6ad6f9b8c624c36e04ff03b0
Diffstat (limited to 'src/com/android/gallery3d/ingest')
-rw-r--r--src/com/android/gallery3d/ingest/IngestActivity.java2
-rw-r--r--src/com/android/gallery3d/ingest/ui/DateTileView.java28
2 files changed, 28 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ingest/IngestActivity.java b/src/com/android/gallery3d/ingest/IngestActivity.java
index a21ccc2fe..feaf465c3 100644
--- a/src/com/android/gallery3d/ingest/IngestActivity.java
+++ b/src/com/android/gallery3d/ingest/IngestActivity.java
@@ -40,6 +40,7 @@ import android.widget.GridView;
import com.android.gallery3d.R;
import com.android.gallery3d.ingest.adapter.MtpAdapter;
+import com.android.gallery3d.ingest.ui.DateTileView;
import java.lang.ref.WeakReference;
import java.util.Collection;
@@ -167,6 +168,7 @@ public class IngestActivity extends Activity implements
@Override
protected void onResume() {
+ DateTileView.refreshLocale();
mActive = true;
if (mHelperService != null) mHelperService.setClientActivity(this);
super.onResume();
diff --git a/src/com/android/gallery3d/ingest/ui/DateTileView.java b/src/com/android/gallery3d/ingest/ui/DateTileView.java
index 19b3c608d..52fe9b85b 100644
--- a/src/com/android/gallery3d/ingest/ui/DateTileView.java
+++ b/src/com/android/gallery3d/ingest/ui/DateTileView.java
@@ -25,9 +25,26 @@ import com.android.gallery3d.R;
import com.android.gallery3d.ingest.SimpleDate;
import java.text.DateFormatSymbols;
+import java.util.Locale;
public class DateTileView extends FrameLayout {
- private static final String[] sMonthNames = DateFormatSymbols.getInstance().getShortMonths();
+ private static String[] sMonthNames = DateFormatSymbols.getInstance().getShortMonths();
+ private static Locale sLocale;
+
+ static {
+ refreshLocale();
+ }
+
+ public static boolean refreshLocale() {
+ Locale currentLocale = Locale.getDefault();
+ if (!currentLocale.equals(sLocale)) {
+ sLocale = currentLocale;
+ sMonthNames = DateFormatSymbols.getInstance(sLocale).getShortMonths();
+ return true;
+ } else {
+ return false;
+ }
+ }
private TextView mDateTextView;
private TextView mMonthTextView;
@@ -35,6 +52,7 @@ public class DateTileView extends FrameLayout {
private int mMonth = -1;
private int mYear = -1;
private int mDate = -1;
+ private String[] mMonthNames = sMonthNames;
public DateTileView(Context context) {
super(context);
@@ -71,9 +89,15 @@ public class DateTileView extends FrameLayout {
mDate = date;
mDateTextView.setText(mDate > 9 ? Integer.toString(mDate) : "0" + mDate);
}
+ if (mMonthNames != sMonthNames) {
+ mMonthNames = sMonthNames;
+ if (month == mMonth) {
+ mMonthTextView.setText(mMonthNames[mMonth]);
+ }
+ }
if (month != mMonth) {
mMonth = month;
- mMonthTextView.setText(sMonthNames[mMonth]);
+ mMonthTextView.setText(mMonthNames[mMonth]);
}
if (year != mYear) {
mYear = year;