本文整理匯總了Java中android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner方法的典型用法代碼示例。如果您正苦於以下問題:Java VectorDrawableCompat.createFromXmlInner方法的具體用法?Java VectorDrawableCompat.createFromXmlInner怎麽用?Java VectorDrawableCompat.createFromXmlInner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.graphics.drawable.VectorDrawableCompat
的用法示例。
在下文中一共展示了VectorDrawableCompat.createFromXmlInner方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createFromXmlInner
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) {
try {
return VectorDrawableCompat.createFromXmlInner(context.getResources(), parser, attrs, theme);
} catch (Exception e) {
Log.e("VdcInflateDelegate", "Exception while inflating <vector>", e);
return null;
}
}
示例2: createFromXmlInner
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
@SuppressLint("NewApi")
@Override
public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
@NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
try {
return VectorDrawableCompat
.createFromXmlInner(context.getResources(), parser, attrs, theme);
} catch (Exception e) {
Log.e("VdcInflateDelegate", "Exception while inflating <vector>", e);
return null;
}
}
示例3: inflateDrawable
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
@Override
public Drawable inflateDrawable(Context context, XmlPullParser parser, AttributeSet attrs) throws IOException, XmlPullParserException {
ColorStateList colorFilter = getTintColorList(context, attrs, android.R.attr.tint);
Drawable d;
if (resId == 0) {
d = VectorDrawableCompat.createFromXmlInner(context.getResources(), parser, attrs);
} else {
d = VectorDrawableCompat.create(context.getResources(), resId, context.getTheme());
}
if (d != null && colorFilter != null) {
DrawableCompat.setTintList(d, colorFilter);
}
return d;
}