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.
|
static interface |
ThemeManager.ThemeSetter |
| Modifier and Type | Field and Description |
|---|---|
static int |
_START_RESOURCES_ID |
static int |
COLOR_SCHEME_MASK |
static int |
DARK
Flag indicates on the dark theme
|
static int |
DIALOG
Flag indicates on the dialog theme.
|
static int |
DIALOG_WHEN_LARGE
Flag indicates on the dialog-when-large theme.
|
static int |
FULLSCREEN
Flag indicates on the fullscreen theme
|
static int |
INVALID
Invalid theme
|
static String |
KEY_CREATED_BY_THEME_MANAGER
Boolean flag indicates that activity was be created by theme manager
|
static String |
KEY_INSTANCE_STATE
Key for saving activity instance state.
|
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
|
static int |
WALLPAPER
Flag indicates on the theme with wallpaper background
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyTheme(Activity activity)
Apply theme from intent.
|
static void |
applyTheme(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 android.content.Context |
context(android.content.Context context,
int theme) |
static android.content.Context |
context(android.content.Context context,
int theme,
boolean applyModifier) |
static int |
getDefaultTheme() |
static int |
getModifier() |
static int |
getTheme(Activity activity)
Extract theme flags from activity intent
|
static int |
getTheme(android.content.Intent intent)
Extract theme flags from intent
|
static int |
getTheme(android.content.Intent intent,
boolean applyModifier)
Extract theme flags from intent
|
static int |
getThemeMask() |
static int |
getThemeResource(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(int themeTag,
boolean applyModifier)
Resolve theme resource id by flags
|
static int |
getThemeResource(android.content.Intent intent)
Resolve theme resource id by flags from intent
|
static int |
getThemeType(android.content.Context context) |
static boolean |
hasSpecifiedTheme(Activity activity) |
static boolean |
hasSpecifiedTheme(android.content.Intent intent) |
static boolean |
isDark(Activity activity) |
static boolean |
isDark(int i) |
static boolean |
isDark(android.content.Intent intent) |
static boolean |
isDialog(Activity activity) |
static boolean |
isDialog(int i) |
static boolean |
isDialog(android.content.Intent intent) |
static boolean |
isDialogWhenLarge(Activity activity) |
static boolean |
isDialogWhenLarge(int i) |
static boolean |
isDialogWhenLarge(android.content.Intent intent) |
static boolean |
isFullScreen(Activity activity) |
static boolean |
isFullScreen(int i) |
static boolean |
isFullScreen(android.content.Intent intent) |
static boolean |
isLight(Activity activity) |
static boolean |
isLight(int i) |
static boolean |
isLight(android.content.Intent intent) |
static boolean |
isMixed(Activity activity) |
static boolean |
isMixed(int i) |
static boolean |
isMixed(android.content.Intent intent) |
static boolean |
isNoActionBar(Activity activity) |
static boolean |
isNoActionBar(int i) |
static boolean |
isNoActionBar(android.content.Intent intent) |
static boolean |
isWallpaper(Activity activity) |
static boolean |
isWallpaper(int i) |
static boolean |
isWallpaper(android.content.Intent intent) |
static int |
makeNewFlag()
Generate flag for using it in ThemeManager.
|
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 |
registerThemeSetter(ThemeManager.ThemeSetter themeSetter) |
static void |
removeTheme(Activity activity)
Remove theme from the intent extras.
|
static void |
reset()
Reset all themes to default
|
static void |
restart(Activity activity)
Simply restart activity
|
static void |
restart(Activity activity,
boolean force) |
static void |
restartWithDarkTheme(Activity activity)
Check activity on dark theme and restart it if theme incorrect.
|
static void |
restartWithLightTheme(Activity activity)
Check activity on light theme and restart it if theme incorrect.
|
static void |
restartWithMixedTheme(Activity activity)
Check activity on light with dark action bar theme and restart it if
theme incorrect.
|
static void |
restartWithTheme(Activity activity,
int theme)
Check activity on theme and restart it if theme incorrect.
|
static void |
restartWithTheme(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
|
static void |
unregisterThemeSetter(ThemeManager.ThemeSetter themeSetter) |
public static final int _START_RESOURCES_ID
public static final int COLOR_SCHEME_MASK
public static final int DARK
public static final int DIALOG
public static final int DIALOG_WHEN_LARGE
public static final int FULLSCREEN
public static final int INVALID
public static final String KEY_CREATED_BY_THEME_MANAGER
public static final String KEY_INSTANCE_STATE
public static final int LIGHT
MIXED flagpublic static final int MIXED
public static final int NO_ACTION_BAR
public static final int WALLPAPER
public static void applyTheme(Activity activity)
public static void applyTheme(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 android.content.Context context(android.content.Context context,
int theme)
public static android.content.Context context(android.content.Context context,
int theme,
boolean applyModifier)
public static int getDefaultTheme()
setDefaultTheme(int),
modifyDefaultTheme(int),
modifyDefaultThemeClear(int)public static int getModifier()
modify(int),
setModifier(int)public static int getTheme(Activity activity)
public static int getTheme(android.content.Intent intent)
public static int getTheme(android.content.Intent intent,
boolean applyModifier)
public static int getThemeMask()
public static int getThemeResource(Activity activity)
public static int getThemeResource(int themeTag)
public static int getThemeResource(int themeTag,
boolean applyModifier)
public static int getThemeResource(android.content.Intent intent)
public static int getThemeType(android.content.Context context)
public static boolean hasSpecifiedTheme(Activity activity)
public static boolean hasSpecifiedTheme(android.content.Intent intent)
public static boolean isDark(Activity activity)
public static boolean isDark(int i)
public static boolean isDark(android.content.Intent intent)
public static boolean isDialog(Activity activity)
public static boolean isDialog(int i)
public static boolean isDialog(android.content.Intent intent)
public static boolean isDialogWhenLarge(Activity activity)
public static boolean isDialogWhenLarge(int i)
public static boolean isDialogWhenLarge(android.content.Intent intent)
public static boolean isFullScreen(Activity activity)
public static boolean isFullScreen(int i)
public static boolean isFullScreen(android.content.Intent intent)
public static boolean isLight(Activity activity)
public static boolean isLight(int i)
public static boolean isLight(android.content.Intent intent)
public static boolean isMixed(Activity activity)
public static boolean isMixed(int i)
public static boolean isMixed(android.content.Intent intent)
public static boolean isNoActionBar(Activity activity)
public static boolean isNoActionBar(int i)
public static boolean isNoActionBar(android.content.Intent intent)
public static boolean isWallpaper(Activity activity)
public static boolean isWallpaper(int i)
public static boolean isWallpaper(android.content.Intent intent)
public static int makeNewFlag()
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(If theme value negative - remove pair flags-themeLIGHT,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 registerThemeSetter(ThemeManager.ThemeSetter themeSetter)
public static void removeTheme(Activity activity)
public static void reset()
public static void restart(Activity activity)
activity - Activitypublic static void restart(Activity activity, boolean force)
public static void restartWithDarkTheme(Activity activity)
restartWithTheme(Activity, int)public static void restartWithLightTheme(Activity activity)
restartWithTheme(Activity, int)public static void restartWithMixedTheme(Activity activity)
restartWithTheme(Activity, int)public static void restartWithTheme(Activity activity, int theme)
activity - Activitytheme - Theme flags for checkpublic static void restartWithTheme(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)
public static void unregisterThemeSetter(ThemeManager.ThemeSetter themeSetter)
Copyright © 2012-2013. All Rights Reserved.