本文整理汇总了Java中android.support.v7.widget.TintContextWrapper类的典型用法代码示例。如果您正苦于以下问题:Java TintContextWrapper类的具体用法?Java TintContextWrapper怎么用?Java TintContextWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TintContextWrapper类属于android.support.v7.widget包,在下文中一共展示了TintContextWrapper类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: activityIsAlive
import android.support.v7.widget.TintContextWrapper; //导入依赖的package包/类
/**
* 判断Activity是否已经结束
*
* @param context context
* @return true:已结束
*/
private static boolean activityIsAlive(Context context) {
if (context == null) {
return false;
}
if (context instanceof TintContextWrapper) {
context = ((TintContextWrapper) context).getBaseContext();
}
if (context instanceof Activity) {
if (((Activity) context).isFinishing()) {
return false;
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && ((Activity) context).isDestroyed()) {
return false;
}
}
}
return true;
}
开发者ID:nichbar,项目名称:Aequorea,代码行数:25,代码来源:RichText.java
示例2: activityIsAlive
import android.support.v7.widget.TintContextWrapper; //导入依赖的package包/类
private boolean activityIsAlive() {
TextView textView = textViewWeakReference.get();
if (textView == null) {
return false;
}
Context context = textView.getContext();
if (context == null) {
return false;
}
if (context instanceof TintContextWrapper) {
context = ((TintContextWrapper) context).getBaseContext();
}
if (context instanceof Activity) {
if (((Activity) context).isFinishing()) {
return false;
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && ((Activity) context).isDestroyed()) {
return false;
}
}
}
return true;
}
开发者ID:nichbar,项目名称:Aequorea,代码行数:24,代码来源:AbstractImageLoader.java
示例3: injectVectorAwareContext
import android.support.v7.widget.TintContextWrapper; //导入依赖的package包/类
@NonNull
@SuppressLint("RestrictedApi")
public Picasso.Builder injectVectorAwareContext(@NonNull final Context context,
@NonNull final Picasso.Builder builder) {
// XXX: forcibly inject a TintContextWrapper context to support loading Support VectorDrawables
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
try {
final Field f = Picasso.Builder.class.getDeclaredField("context");
f.setAccessible(true);
f.set(builder, TintContextWrapper.wrap(context.getApplicationContext()));
} catch (final Exception e) {
Crashlytics.logException(e);
}
}
return builder;
}
开发者ID:CruGlobal,项目名称:android-gto-support,代码行数:18,代码来源:PicassoUtils.java
示例4: activityIsAlive
import android.support.v7.widget.TintContextWrapper; //导入依赖的package包/类
/**
* 判断Activity是否已经结束
*
* @return true:已结束
*/
boolean activityIsAlive() {
TextView textView = textViewWeakReference.get();
if (textView == null) {
return false;
}
Context context = textView.getContext();
if (context == null) {
return false;
}
if (context instanceof TintContextWrapper) {
context = ((TintContextWrapper) context).getBaseContext();
}
if (context instanceof Activity) {
if (((Activity) context).isFinishing()) {
return false;
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && ((Activity) context).isDestroyed()) {
return false;
}
}
}
return true;
}
开发者ID:zzhoujay,项目名称:RichText,代码行数:29,代码来源:ImageTarget.java
示例5: 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;
}
开发者ID:johnkil,项目名称:Android-RobotoTextView,代码行数:22,代码来源:RobotoCompatInflater.java
示例6: 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;
}
开发者ID:ximsfei,项目名称:Android-skin-support,代码行数:45,代码来源:SkinCompatViewInflater.java
注:本文中的android.support.v7.widget.TintContextWrapper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论