Commit b593a636 authored by Romain Hunault's avatar Romain Hunault

Merge branch 'issue-811' into 'master'

Calender icon: Add translation for month names

See merge request e/apps/BlissLauncher!38
parents bdb78530 c4aa9f0e
Pipeline #55104 canceled with stage
......@@ -17,6 +17,7 @@ import android.view.ViewGroup;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.concurrent.Executor;
......@@ -26,6 +27,7 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utilities {
private static final String TAG = "Utilities";
......@@ -109,35 +111,10 @@ public class Utilities {
return (int) Math.ceil(fm.bottom - fm.top);
}
public static String convertMonthToString(int month) {
switch (month) {
case Calendar.JANUARY:
return "JAN";
case Calendar.FEBRUARY:
return "FEB";
case Calendar.MARCH:
return "MAR";
case Calendar.APRIL:
return "APR";
case Calendar.MAY:
return "MAY";
case Calendar.JUNE:
return "JUN";
case Calendar.JULY:
return "JUL";
case Calendar.AUGUST:
return "AUG";
case Calendar.SEPTEMBER:
return "SEP";
case Calendar.OCTOBER:
return "OCT";
case Calendar.NOVEMBER:
return "NOV";
case Calendar.DECEMBER:
return "DEC";
default:
return "";
}
public static String convertMonthToString() {
Calendar cal=Calendar.getInstance();
SimpleDateFormat month_date = new SimpleDateFormat("MMM");
return month_date.format(cal.getTime());
}
/**
......
......@@ -237,7 +237,7 @@ public class BlissFrameLayout extends FrameLayout {
CalendarIcon calendarIcon = new CalendarIcon(monthTextView, dateTextView);
calendarIcon.monthTextView.setText(
Utilities.convertMonthToString(Calendar.getInstance().get(Calendar.MONTH)));
Utilities.convertMonthToString());
calendarIcon.dayTextView.setText(
String.valueOf(Calendar.getInstance().get(Calendar.DAY_OF_MONTH)));
} else {
......
......@@ -410,7 +410,7 @@ public class LauncherActivity extends AppCompatActivity implements
private void updateCalendarIcon(CalendarIcon calendarIcon, Calendar calendar) {
calendarIcon.monthTextView.setText(
Utilities.convertMonthToString(calendar.get(Calendar.MONTH)));
Utilities.convertMonthToString());
calendarIcon.dayTextView.setText(
String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment