本文整理汇总了Java中android.content.res.XResources.hookLayout方法的典型用法代码示例。如果您正苦于以下问题:Java XResources.hookLayout方法的具体用法?Java XResources.hookLayout怎么用?Java XResources.hookLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.res.XResources
的用法示例。
在下文中一共展示了XResources.hookLayout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: themeListItemView
import android.content.res.XResources; //导入方法依赖的package包/类
private static void themeListItemView(XResources res, String layoutName, final boolean extraLine) {
res.hookLayout(HANGOUTS_RES_PKG_NAME, "layout", layoutName, new XC_LayoutInflated() {
public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
((LinearLayout) liparam.view.findViewById(liparam.res.getIdentifier("icon", "id",
HANGOUTS_RES_PKG_NAME)).getParent()).setBackgroundColor(COLOR_GROUP_5);
((ImageView) liparam.view.findViewById(liparam.res.getIdentifier("icon", "id",
HANGOUTS_RES_PKG_NAME))).setColorFilter(COLOR_GROUP_1, PorterDuff.Mode.SRC_IN);
((TextView) liparam.view.findViewById(liparam.res.getIdentifier("text", "id",
HANGOUTS_RES_PKG_NAME))).setTextColor(COLOR_GROUP_1);
if (extraLine) {
((TextView) liparam.view.findViewById(liparam.res.getIdentifier("byline", "id",
HANGOUTS_RES_PKG_NAME))).setTextColor(COLOR_GROUP_2);
}
}
});
}
示例2: replaceLayoutBackgroundColor
import android.content.res.XResources; //导入方法依赖的package包/类
private static void replaceLayoutBackgroundColor(XResources res, String layoutName, final String ResId, final int color) {
res.hookLayout(HANGOUTS_RES_PKG_NAME, "layout", layoutName, new XC_LayoutInflated() {
public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
if (ResId == null) {
liparam.view.setBackgroundColor(color);
} else {
liparam.view.findViewById(liparam.res.getIdentifier(ResId, "id", HANGOUTS_RES_PKG_NAME))
.setBackgroundColor(color);
}
}
});
}
示例3: setTextColor
import android.content.res.XResources; //导入方法依赖的package包/类
private static void setTextColor(XResources res, String layoutName, final String ResId, final int color) {
res.hookLayout(HANGOUTS_RES_PKG_NAME, "layout", layoutName, new XC_LayoutInflated() {
public void handleLayoutInflated(LayoutInflatedParam liparam) throws Throwable {
((TextView) liparam.view.findViewById(liparam.res.getIdentifier(ResId, "id",
HANGOUTS_RES_PKG_NAME))).setTextColor(color);
}
});
}