mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Specify locale explicitly
This commit is contained in:
@@ -23,6 +23,7 @@ import java.util.Locale;
|
|||||||
import org.isoron.uhabits.R;
|
import org.isoron.uhabits.R;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ActionBar.LayoutParams;
|
import android.app.ActionBar.LayoutParams;
|
||||||
import android.app.DialogFragment;
|
import android.app.DialogFragment;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -132,6 +133,7 @@ public class TimePickerDialog extends DialogFragment implements OnValueSelectedL
|
|||||||
// Empty constructor required for dialog fragment.
|
// Empty constructor required for dialog fragment.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("Java")
|
||||||
public TimePickerDialog(Context context, int theme, OnTimeSetListener callback,
|
public TimePickerDialog(Context context, int theme, OnTimeSetListener callback,
|
||||||
int hourOfDay, int minute, boolean is24HourMode) {
|
int hourOfDay, int minute, boolean is24HourMode) {
|
||||||
// Empty constructor required for dialog fragment.
|
// Empty constructor required for dialog fragment.
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
@@ -42,7 +43,7 @@ public class CSVExporter
|
|||||||
|
|
||||||
basePath = String.format("%s/export/", context.getFilesDir());
|
basePath = String.format("%s/export/", context.getFilesDir());
|
||||||
|
|
||||||
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
||||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import org.isoron.uhabits.models.Habit;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class HabitHistoryView extends ScrollableDataView
|
public class HabitHistoryView extends ScrollableDataView
|
||||||
{
|
{
|
||||||
@@ -61,8 +62,8 @@ public class HabitHistoryView extends ScrollableDataView
|
|||||||
createColors();
|
createColors();
|
||||||
|
|
||||||
wdays = DateHelper.getShortDayNames();
|
wdays = DateHelper.getShortDayNames();
|
||||||
dfMonth = new SimpleDateFormat("MMM");
|
dfMonth = new SimpleDateFormat("MMM", Locale.getDefault());
|
||||||
dfYear = new SimpleDateFormat("yyyy");
|
dfYear = new SimpleDateFormat("yyyy", Locale.getDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDate()
|
private void updateDate()
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.isoron.helpers.DateHelper;
|
|||||||
import org.isoron.uhabits.models.Habit;
|
import org.isoron.uhabits.models.Habit;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class HabitScoreView extends ScrollableDataView
|
public class HabitScoreView extends ScrollableDataView
|
||||||
{
|
{
|
||||||
@@ -35,6 +36,8 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
private final Paint pGrid;
|
private final Paint pGrid;
|
||||||
private final float em;
|
private final float em;
|
||||||
private Habit habit;
|
private Habit habit;
|
||||||
|
private SimpleDateFormat dfMonth;
|
||||||
|
private SimpleDateFormat dfDay;
|
||||||
|
|
||||||
private Paint pText, pGraph;
|
private Paint pText, pGraph;
|
||||||
|
|
||||||
@@ -76,6 +79,9 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
colors[3] = habit.color;
|
colors[3] = habit.color;
|
||||||
colors[1] = ColorHelper.mixColors(colors[0], colors[3], 0.66f);
|
colors[1] = ColorHelper.mixColors(colors[0], colors[3], 0.66f);
|
||||||
colors[2] = ColorHelper.mixColors(colors[0], colors[3], 0.33f);
|
colors[2] = ColorHelper.mixColors(colors[0], colors[3], 0.33f);
|
||||||
|
|
||||||
|
dfMonth = new SimpleDateFormat("MMM", Locale.getDefault());
|
||||||
|
dfDay = new SimpleDateFormat("d", Locale.getDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fetchData()
|
protected void fetchData()
|
||||||
@@ -94,9 +100,6 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
rGrid.offset(0, headerHeight);
|
rGrid.offset(0, headerHeight);
|
||||||
drawGrid(canvas, rGrid);
|
drawGrid(canvas, rGrid);
|
||||||
|
|
||||||
SimpleDateFormat dfMonth = new SimpleDateFormat("MMM");
|
|
||||||
SimpleDateFormat dfDay = new SimpleDateFormat("d");
|
|
||||||
|
|
||||||
String previousMonth = "";
|
String previousMonth = "";
|
||||||
|
|
||||||
pGraph.setColor(habit.color);
|
pGraph.setColor(habit.color);
|
||||||
|
|||||||
Reference in New Issue
Block a user