-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何支持针对style.xml里的Theme换肤 #5
Comments
。。我是直接在代码中改变toolbar和statusbar颜色的0 0 |
我能想到的办法也是这样,不过感觉这样不优雅 |
我找到了个办法,在SkinAttrSupport类中增加如下一个分支判断,获取主题中的颜色值 else if (attrValue.startsWith("?"))
{
int id = Integer.parseInt(attrValue.substring(1));
TypedValue typedValue = new TypedValue();
TypedArray a = context.obtainStyledAttributes(typedValue.data, new int[]{id});
String entryName = context.getResources() .getResourceEntryName(a.getResourceId(0, 0));
a.recycle();
Timber.d("%s's entryName=@%s", attrName, entryName);
if (entryName != null && entryName.startsWith(SkinConfig.ATTR_PREFIX))
{
skinAttr = new SkinAttr(attrType, entryName);
skinAttrs.add(skinAttr);
}
} |
加进去了如何使用呢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
楼主,针对这种主题式换肤,怎么办呀?目前该框架从代码上看好像不支持~
The text was updated successfully, but these errors were encountered: