本文整理汇总了Java中android.support.v7.widget.TintContextWrapper.wrap方法的典型用法代码示例。如果您正苦于以下问题:Java TintContextWrapper.wrap方法的具体用法?Java TintContextWrapper.wrap怎么用?Java TintContextWrapper.wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.TintContextWrapper
的用法示例。
在下文中一共展示了TintContextWrapper.wrap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createView
import android.support.v7.widget.TintContextWrapper; //导入方法依赖的package包/类
final View createView(View parent, final String name, @NonNull Context context,
@NonNull AttributeSet attrs, boolean inheritContext,
boolean readAppTheme, boolean wrapContext) {
if (inheritContext && parent != null) {
context = parent.getContext();
}
if (readAppTheme) {
context = themifyContext(context, attrs, true);
}
if (wrapContext) {
context = TintContextWrapper.wrap(context);
}
View view = createViewFromTag(context, name, attrs);
if (view != null) {
checkOnClickListener(view, attrs);
}
return view;
}
示例2: createView
import android.support.v7.widget.TintContextWrapper; //导入方法依赖的package包/类
public final View createView(View parent, final String name, @NonNull Context context,
@NonNull AttributeSet attrs, boolean inheritContext,
boolean readAndroidTheme, boolean readAppTheme, boolean wrapContext) {
final Context originalContext = context;
// We can emulate Lollipop's android:theme attribute propagating down the view hierarchy
// by using the parent's context
if (inheritContext && parent != null) {
context = parent.getContext();
}
if (readAndroidTheme || readAppTheme) {
// We then apply the theme on the context, if specified
context = themifyContext(context, attrs, readAndroidTheme, readAppTheme);
}
if (wrapContext) {
context = TintContextWrapper.wrap(context);
}
View view = createViewFromHackInflater(context, name, attrs);
// We need to 'inject' our tint aware Views in place of the standard framework versions
if (view == null) {
view = createViewFromFV(context, name, attrs);
}
if (view == null) {
view = createViewFromV7(context, name, attrs);
}
if (view == null) {
view = createViewFromInflater(context, name, attrs);
}
if (view == null) {
view = createViewFromTag(context, name, attrs);
}
if (view != null) {
// If we have created a view, check it's android:onClick
checkOnClickListener(view, attrs);
}
return view;
}