Git Product home page Git Product logo

dynamicskindemo's People

Contributors

ouchangxin avatar

Stargazers

Kraos avatar rooony avatar  avatar  avatar Mumu_Q avatar  avatar  avatar  avatar Jacky avatar 536b8d24 avatar CLYR avatar  avatar 张杨 avatar  avatar ggband avatar  avatar zhaomingqiang avatar  avatar

dynamicskindemo's Issues

测试了一下,说说感受

1.可以切换textview和button的颜色、背景,view的background
2.不支持切换style,例如以下这种
<Button style="@style/textViewNormal" android:id="@+id/btn_blue" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginEnd="8dp" android:layout_alignParentEnd="true" android:text="闷*蓝"/>
3.查看了解析的代码,位于SkinItem下的 apply方法,遍历属性,然后对应的view重新设置,我修改了下,但是依然不行,代码如下,请高人指点
public void apply() { if (view == null || attrs == null) return; for (SkinAttr attr : attrs) { String attrName = attr.getAttrName(); String attrType = attr.getAttrType(); String resName = attr.getResName(); int resId = attr.getResId(); if ("background".equals(attrName)) { if ("color".equals(attrType)) { view.setBackgroundColor(SkinManager.getInstance().getColor(resName, resId)); } else if ("drawable".equals(attrType)) { view.setBackground(SkinManager.getInstance().getDrawable(resName, resId)); } } else if ("textColor".equals(attrName)) { if (view instanceof TextView && "color".equals(attrType)) { ((TextView) view).setTextColor(SkinManager.getInstance().getColor(resName, resId)); } } else if ("style".equals(attrName)) { if (view instanceof TextView && "style".equals(attrType)) { ((TextView) view).setTextAppearance(view.getContext(), resId); } else if (view instanceof Button && "style".equals(attrType)) { ((Button) view).setTextAppearance(view.getContext(), resId); } } } }
4.同时不支持,字体大小的设置

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.