@Test public void testIfCanReturnDefaultMode() { assertEquals(AppCompatDelegate.MODE_NIGHT_NO, ThemeUtils.getCurrentTheme("0")); assertEquals(AppCompatDelegate.MODE_NIGHT_NO, ThemeUtils.getCurrentTheme("4")); }
public static int getCurrentTheme(String themeId) { int currentTheme; switch(themeId) { case "1": currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; case "2": currentTheme = AppCompatDelegate.MODE_NIGHT_AUTO; break; case "3": currentTheme = AppCompatDelegate.MODE_NIGHT_YES; break; default: Log.e(ThemeUtils.class.getName(), "Default case in setAppTheme switch"); currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; } return currentTheme; }
ThemeUtils { public static int getCurrentTheme(String themeId) { int currentTheme; switch(themeId) { case "1": currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; case "2": currentTheme = AppCompatDelegate.MODE_NIGHT_AUTO; break; case "3": currentTheme = AppCompatDelegate.MODE_NIGHT_YES; break; default: Log.e(ThemeUtils.class.getName(), "Default case in setAppTheme switch"); currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; } return currentTheme; } }
ThemeUtils { public static int getCurrentTheme(String themeId) { int currentTheme; switch(themeId) { case "1": currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; case "2": currentTheme = AppCompatDelegate.MODE_NIGHT_AUTO; break; case "3": currentTheme = AppCompatDelegate.MODE_NIGHT_YES; break; default: Log.e(ThemeUtils.class.getName(), "Default case in setAppTheme switch"); currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; } return currentTheme; }  }
ThemeUtils { public static int getCurrentTheme(String themeId) { int currentTheme; switch(themeId) { case "1": currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; case "2": currentTheme = AppCompatDelegate.MODE_NIGHT_AUTO; break; case "3": currentTheme = AppCompatDelegate.MODE_NIGHT_YES; break; default: Log.e(ThemeUtils.class.getName(), "Default case in setAppTheme switch"); currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; } return currentTheme; }  static int getCurrentTheme(String themeId); }
ThemeUtils { public static int getCurrentTheme(String themeId) { int currentTheme; switch(themeId) { case "1": currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; case "2": currentTheme = AppCompatDelegate.MODE_NIGHT_AUTO; break; case "3": currentTheme = AppCompatDelegate.MODE_NIGHT_YES; break; default: Log.e(ThemeUtils.class.getName(), "Default case in setAppTheme switch"); currentTheme = AppCompatDelegate.MODE_NIGHT_NO; break; } return currentTheme; }  static int getCurrentTheme(String themeId);  }