Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Merge PR #695: Use Indonesian greeting hours when locale is Indonesian

Gathin2304e2b73323f4
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 2fe57fb9b,e142c32e6..01c26d9e6
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -1941,11 -1915,20 +1941,22 @@@ public class MainActivity extends Activ
private void updateGreeting() {
int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
int res;
- if (hour < 5) res = R.string.good_night;
- else if (hour < 12) res = R.string.good_morning;
- else if (hour < 17) res = R.string.good_afternoon;
- else if (hour < 22) res = R.string.good_evening;
- else res = R.string.good_night;
+ // Indonesian day parts run on different hours than English:
+ // Pagi 00-10, Siang 10-15, Sore 15-18, Malam 18-24.
- if ("in".equals(Locale.getDefault().getLanguage())) {
++ // The app's own locale (per-app language on Android 13+), under either code Android uses for Indonesian.
++ String lang = getResources().getConfiguration().getLocales().get(0).getLanguage();
++ if ("in".equals(lang) || "id".equals(lang)) {
+ if (hour < 10) res = R.string.good_morning;
+ else if (hour < 15) res = R.string.good_afternoon;
+ else if (hour < 18) res = R.string.good_evening;
+ else res = R.string.good_night;
+ } else {
+ if (hour < 5) res = R.string.good_night;
+ else if (hour < 12) res = R.string.good_morning;
+ else if (hour < 17) res = R.string.good_afternoon;
+ else if (hour < 22) res = R.string.good_evening;
+ else res = R.string.good_night;
+ }
String festiveGreeting = festive ? festival.greetingText() : "";
if (!festiveGreeting.isEmpty()) {
greeting.setText(festiveGreeting);