本文整理汇总了Java中org.holoeverywhere.ThemeManager.getDefaultTheme方法的典型用法代码示例。如果您正苦于以下问题:Java ThemeManager.getDefaultTheme方法的具体用法?Java ThemeManager.getDefaultTheme怎么用?Java ThemeManager.getDefaultTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.holoeverywhere.ThemeManager
的用法示例。
在下文中一共展示了ThemeManager.getDefaultTheme方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTheme
import org.holoeverywhere.ThemeManager; //导入方法依赖的package包/类
public synchronized void setTheme(int resid, boolean modifyGlobal) {
if (resid > ThemeManager._START_RESOURCES_ID) {
if (mLastThemeResourceId != resid) {
mActionBarContext = null;
super.setTheme(mLastThemeResourceId = resid);
}
} else {
if ((resid & ThemeManager.COLOR_SCHEME_MASK) == 0) {
resid &= ~ThemeManager.COLOR_SCHEME_MASK;
final int parentColorScheme = ThemeManager.getParentColorScheme(getIntent());
if (parentColorScheme != ThemeManager.INVALID) {
resid |= parentColorScheme;
} else {
resid |= ThemeManager.getDefaultTheme() & ThemeManager.COLOR_SCHEME_MASK;
}
}
setTheme(ThemeManager.getThemeResource(resid, modifyGlobal));
}
}
示例2: resolveThemeForContext
import org.holoeverywhere.ThemeManager; //导入方法依赖的package包/类
@Override
public int resolveThemeForContext(Context context, int invalidTheme) {
int theme, mod = 0;
TypedValue outValue = new TypedValue();
TypedArray a;
(a = context.obtainStyledAttributes(new int[] {
R.attr.preferenceTheme
})).getValue(0, outValue);
a.recycle();
switch (outValue.type) {
case TypedValue.TYPE_REFERENCE:
if (new ContextThemeWrapper(context, theme = outValue.resourceId)
.obtainStyledAttributes(new int[] {
R.attr.holoTheme
}).getInt(0, 0) == 4) {
return theme;
}
break;
case TypedValue.TYPE_INT_DEC:
case TypedValue.TYPE_INT_HEX:
mod = outValue.resourceId;
break;
}
theme = THEME_FLAG;
if (context instanceof Activity) {
if (mod == 0 || mod == ThemeManager.getDefaultTheme()) {
mod = ThemeManager.getThemeType(context);
if (mod == PreferenceInit.THEME_FLAG) {
theme = mod;
mod = 0;
} else if (mod == ThemeManager.INVALID) {
mod = ThemeManager.getDefaultTheme() & ThemeManager.COLOR_SCHEME_MASK;
if (mod == 0) {
mod = ThemeManager.DARK;
}
}
}
if (mod > 0) {
theme |= mod & ThemeManager.COLOR_SCHEME_MASK;
}
} else {
theme |= ThemeManager.getDefaultTheme() & ThemeManager.COLOR_SCHEME_MASK;
}
theme = ThemeManager.getThemeResource(theme, false);
if (theme == ThemeManager.getDefaultTheme() || theme == 0) {
theme = sThemes.getDarkTheme();
}
return theme;
}