public final class ThemeManager extends Object
DARK | FULLSCREEN map(int, int)
where first arg - flags, second - theme resource | Modifier and Type | Class and Description |
|---|---|
static interface |
ThemeManager.SuperStartActivity
System interface for calling super.startActivity in the activities.
|
static interface |
ThemeManager.ThemeGetter
Theme getter.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DARK
Flag indicates on the dark theme
|
static int |
FULLSCREEN
Flag indicates on the fullscreen theme
|
static int |
LIGHT
Flag indicates on the light theme.
|
static int |
MIXED
Flag indicates on the light theme with dark action bar
|
static int |
NO_ACTION_BAR
Flag indicates on the theme without action bar by default (may be show
later)
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyTheme(android.app.Activity activity)
Apply theme from intent.
|
static void |
applyTheme(android.app.Activity activity,
boolean force)
Apply theme from intent.
|
static void |
cloneTheme(android.content.Intent sourceIntent,
android.content.Intent intent)
Synonym for
cloneTheme(Intent, Intent, boolean) with third arg -
false |
static void |
cloneTheme(android.content.Intent sourceIntent,
android.content.Intent intent,
boolean force)
Clone theme from sourceIntent to intent, if it specified for sourceIntent
or set flag force
|
static int |
getDefaultTheme() |
static int |
getModifier() |
static int |
getTheme(android.app.Activity activity)
Extract theme flags from activity intent
|
static int |
getTheme(android.content.Intent intent)
Extract theme flags from intent
|
static int |
getThemeResource(android.app.Activity activity)
Resolve theme resource id by flags from activity intent
|
static int |
getThemeResource(int themeTag)
Resolve theme resource id by flags
|
static int |
getThemeResource(android.content.Intent intent)
Resolve theme resource id by flags from intent
|
static boolean |
hasSpecifiedTheme(android.app.Activity activity) |
static boolean |
hasSpecifiedTheme(android.content.Intent intent) |
static boolean |
isDark(android.app.Activity activity) |
static boolean |
isDark(int i) |
static boolean |
isDark(android.content.Intent intent) |
static boolean |
isFullScreen(android.app.Activity activity) |
static boolean |
isFullScreen(int i) |
static boolean |
isFullScreen(android.content.Intent intent) |
static boolean |
isLight(android.app.Activity activity) |
static boolean |
isLight(int i) |
static boolean |
isLight(android.content.Intent intent) |
static boolean |
isMixed(android.app.Activity activity) |
static boolean |
isMixed(int i) |
static boolean |
isMixed(android.content.Intent intent) |
static boolean |
isNoActionBar(android.app.Activity activity) |
static boolean |
isNoActionBar(int i) |
static boolean |
isNoActionBar(android.content.Intent intent) |
static void |
map(int theme)
Remap default theme.
|
static void |
map(int flags,
int theme)
Remap themes.
|
static void |
modify(int mod)
Add modifier to all themes, using in
ThemeManager. |
static void |
modifyClear()
Clear all modifiers
|
static void |
modifyClear(int mod)
Clear modifier
|
static void |
modifyDefaultTheme(int mod)
Like
modify(int), but applying only on default theme. |
static void |
modifyDefaultThemeClear(int mod)
Clear modifier from default theme
|
static void |
restartWithDarkTheme(android.app.Activity activity)
Check activity on dark theme and restart it if theme incorrect.
|
static void |
restartWithLightTheme(android.app.Activity activity)
Check activity on light theme and restart it if theme incorrect.
|
static void |
restartWithMixedTheme(android.app.Activity activity)
Check activity on light with dark action bar theme and restart it if
theme incorrect.
|
static void |
restartWithTheme(android.app.Activity activity,
int theme)
Check activity on theme and restart it if theme incorrect.
|
static void |
restartWithTheme(android.app.Activity activity,
int theme,
boolean force)
Like
restartWithTheme(Activity, int), but if third arg is true -
restart activity regardless theme. |
static void |
setDefaultTheme(int theme)
Set default theme.
|
static void |
setModifier(int mod)
Set theme modifiers.
|
static void |
setThemeGetter(ThemeManager.ThemeGetter themeGetter)
Set
ThemeManager.ThemeGetter instance for getting theme resources. |
static void |
startActivity(android.content.Context context,
android.content.Intent intent)
Only for system use
|
static void |
startActivity(android.content.Context context,
android.content.Intent intent,
android.os.Bundle options)
Only for system use
|
static void |
startActivity(android.content.Context context,
android.content.Intent intent,
int requestCode)
Only for system use
|
static void |
startActivity(android.content.Context context,
android.content.Intent intent,
int requestCode,
android.os.Bundle options)
Only for system use
|
public static final int DARK
public static final int FULLSCREEN
public static final int LIGHT
MIXED flagpublic static final int MIXED
public static final int NO_ACTION_BAR
public static void applyTheme(android.app.Activity activity)
public static void applyTheme(android.app.Activity activity,
boolean force)
public static void cloneTheme(android.content.Intent sourceIntent,
android.content.Intent intent)
cloneTheme(Intent, Intent, boolean) with third arg -
falsecloneTheme(Intent, Intent, boolean)public static void cloneTheme(android.content.Intent sourceIntent,
android.content.Intent intent,
boolean force)
sourceIntent - Intent with specified _THEME_TAGintent - Intent into which will be put a themeforce - Clone theme even if sourceIntent not contain
_THEME_TAGpublic static int getDefaultTheme()
setDefaultTheme(int),
modifyDefaultTheme(int),
modifyDefaultThemeClear(int)public static int getModifier()
modify(int),
setModifier(int)public static int getTheme(android.app.Activity activity)
public static int getTheme(android.content.Intent intent)
public static int getThemeResource(android.app.Activity activity)
public static int getThemeResource(int themeTag)
public static int getThemeResource(android.content.Intent intent)
public static boolean hasSpecifiedTheme(android.app.Activity activity)
public static boolean hasSpecifiedTheme(android.content.Intent intent)
public static boolean isDark(android.app.Activity activity)
public static boolean isDark(int i)
public static boolean isDark(android.content.Intent intent)
public static boolean isFullScreen(android.app.Activity activity)
public static boolean isFullScreen(int i)
public static boolean isFullScreen(android.content.Intent intent)
public static boolean isLight(android.app.Activity activity)
public static boolean isLight(int i)
public static boolean isLight(android.content.Intent intent)
public static boolean isMixed(android.app.Activity activity)
public static boolean isMixed(int i)
public static boolean isMixed(android.content.Intent intent)
public static boolean isNoActionBar(android.app.Activity activity)
public static boolean isNoActionBar(int i)
public static boolean isNoActionBar(android.content.Intent intent)
public static void map(int theme)
map(int, int)public static void map(int flags,
int theme)
LIGHT theme on
R.style.Holo_Theme_Dialog_Light:ThemeManager.map(LIGHT,R.style.Holo_Theme_Dialog_Light);
public static void modify(int mod)
ThemeManager. If you call
modify(NO_ACTION_BAR), then all themes will be without action
bar by default, regardless of the flag is passed.modifyClear(int),
modifyClear(),
setModifier(int)public static void modifyClear()
modify(int),
modifyClear(int),
setModifier(int)public static void modifyClear(int mod)
modify(int),
modifyClear(),
setModifier(int)public static void modifyDefaultTheme(int mod)
modify(int), but applying only on default theme.public static void modifyDefaultThemeClear(int mod)
public static void restartWithDarkTheme(android.app.Activity activity)
restartWithTheme(Activity, int)public static void restartWithLightTheme(android.app.Activity activity)
restartWithTheme(Activity, int)public static void restartWithMixedTheme(android.app.Activity activity)
restartWithTheme(Activity, int)public static void restartWithTheme(android.app.Activity activity,
int theme)
activity - Activitytheme - Theme flags for checkpublic static void restartWithTheme(android.app.Activity activity,
int theme,
boolean force)
restartWithTheme(Activity, int), but if third arg is true -
restart activity regardless theme.activity - Activitytheme - Theme flags for checkforce - Force restart activitypublic static void setDefaultTheme(int theme)
theme - ThememodifyDefaultTheme(int),
modifyDefaultThemeClear(int),
getDefaultTheme()public static void setModifier(int mod)
modify(int)mod - Modififersmodify(int)public static void setThemeGetter(ThemeManager.ThemeGetter themeGetter)
ThemeManager.ThemeGetter instance for getting theme resources.themeGetter - ThemeGetterpublic static void startActivity(android.content.Context context,
android.content.Intent intent)
public static void startActivity(android.content.Context context,
android.content.Intent intent,
android.os.Bundle options)
public static void startActivity(android.content.Context context,
android.content.Intent intent,
int requestCode)
public static void startActivity(android.content.Context context,
android.content.Intent intent,
int requestCode,
android.os.Bundle options)
Copyright © 2012-2013. All Rights Reserved.