use of cn.feng.skin.manager.entity.DynamicAttr in project Android-Skin-Loader by fengjundev.
the class ArticleListFragment method dynamicAddTitleView.
private void dynamicAddTitleView() {
TextView textView = new TextView(getActivity());
textView.setText("Small Article (动态new)");
RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
param.addRule(RelativeLayout.CENTER_IN_PARENT);
textView.setLayoutParams(param);
textView.setTextColor(getActivity().getResources().getColor(R.color.color_title_bar_text));
textView.setTextSize(20);
titleBarLayout.addView(textView);
List<DynamicAttr> mDynamicAttr = new ArrayList<DynamicAttr>();
mDynamicAttr.add(new DynamicAttr(AttrFactory.TEXT_COLOR, R.color.color_title_bar_text));
dynamicAddView(textView, mDynamicAttr);
}
use of cn.feng.skin.manager.entity.DynamicAttr in project Android-Skin-Loader by fengjundev.
the class SkinInflaterFactory method dynamicAddSkinEnableView.
public void dynamicAddSkinEnableView(Context context, View view, List<DynamicAttr> pDAttrs) {
List<SkinAttr> viewAttrs = new ArrayList<SkinAttr>();
SkinItem skinItem = new SkinItem();
skinItem.view = view;
for (DynamicAttr dAttr : pDAttrs) {
int id = dAttr.refResId;
String entryName = context.getResources().getResourceEntryName(id);
String typeName = context.getResources().getResourceTypeName(id);
SkinAttr mSkinAttr = AttrFactory.get(dAttr.attrName, id, entryName, typeName);
viewAttrs.add(mSkinAttr);
}
skinItem.attrs = viewAttrs;
addSkinView(skinItem);
}
Aggregations