本文整理汇总了Java中android.support.v7.widget.TintTypedArray.hasValue方法的典型用法代码示例。如果您正苦于以下问题:Java TintTypedArray.hasValue方法的具体用法?Java TintTypedArray.hasValue怎么用?Java TintTypedArray.hasValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.TintTypedArray
的用法示例。
在下文中一共展示了TintTypedArray.hasValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCollapsedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setCollapsedTextAppearance(int resId) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId, R.styleable.QMUITextAppearance);
if (a.hasValue(R.styleable.QMUITextAppearance_android_textColor)) {
mCollapsedTextColor = a.getColorStateList(R.styleable.QMUITextAppearance_android_textColor);
}
if (a.hasValue(R.styleable.QMUITextAppearance_android_textSize)) {
mCollapsedTextSize = a.getDimensionPixelSize(R.styleable.QMUITextAppearance_android_textSize,
(int) mCollapsedTextSize);
}
mCollapsedShadowColor = a.getInt(R.styleable.QMUITextAppearance_android_shadowColor, 0);
mCollapsedShadowDx = a.getFloat(R.styleable.QMUITextAppearance_android_shadowDx, 0);
mCollapsedShadowDy = a.getFloat(R.styleable.QMUITextAppearance_android_shadowDy, 0);
mCollapsedShadowRadius = a.getFloat(R.styleable.QMUITextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
mCollapsedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例2: setExpandedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setExpandedTextAppearance(int resId) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId, R.styleable.QMUITextAppearance);
if (a.hasValue(R.styleable.QMUITextAppearance_android_textColor)) {
mExpandedTextColor = a.getColorStateList(R.styleable.QMUITextAppearance_android_textColor);
}
if (a.hasValue(R.styleable.QMUITextAppearance_android_textSize)) {
mExpandedTextSize = a.getDimensionPixelSize(R.styleable.QMUITextAppearance_android_textSize,
(int) mExpandedTextSize);
}
mExpandedShadowColor = a.getInt(
R.styleable.QMUITextAppearance_android_shadowColor, 0);
mExpandedShadowDx = a.getFloat(
R.styleable.QMUITextAppearance_android_shadowDx, 0);
mExpandedShadowDy = a.getFloat(
R.styleable.QMUITextAppearance_android_shadowDy, 0);
mExpandedShadowRadius = a.getFloat(
R.styleable.QMUITextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
mExpandedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例3: setCollapsedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setCollapsedTextAppearance(int resId) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId,
android.support.v7.appcompat.R.styleable.TextAppearance);
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
mCollapsedTextColor = a.getColorStateList(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
}
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
mCollapsedTextSize = a.getDimensionPixelSize(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
(int) mCollapsedTextSize);
}
mCollapsedShadowColor = a.getInt(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
mCollapsedShadowDx = a.getFloat(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
mCollapsedShadowDy = a.getFloat(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
mCollapsedShadowRadius = a.getFloat(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
mCollapsedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例4: setExpandedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setExpandedTextAppearance(int resId) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId,
android.support.v7.appcompat.R.styleable.TextAppearance);
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
mExpandedTextColor = a.getColorStateList(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
}
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
mExpandedTextSize = a.getDimensionPixelSize(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
(int) mExpandedTextSize);
}
mExpandedShadowColor = a.getInt(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
mExpandedShadowDx = a.getFloat(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
mExpandedShadowDy = a.getFloat(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
mExpandedShadowRadius = a.getFloat(
android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
mExpandedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例5: loadFromAttributes
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs,
R.styleable.SkinBackgroundHelper, defStyleAttr, 0);
try {
if (a.hasValue(R.styleable.SkinBackgroundHelper_android_background)) {
mBackgroundResId = a.getResourceId(
R.styleable.SkinBackgroundHelper_android_background, INVALID_ID);
}
} finally {
a.recycle();
}
applySkin();
}
示例6: SkinCompatAutoCompleteTextView
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public SkinCompatAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
TINT_ATTRS, defStyleAttr, 0);
if (a.hasValue(0)) {
mDropDownBackgroundResId = a.getResourceId(0, INVALID_ID);
}
a.recycle();
applyDropDownBackgroundResource();
mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
mTextHelper = new SkinCompatTextHelper(this);
mTextHelper.loadFromAttributes(attrs, defStyleAttr);
}
示例7: SkinCompatMultiAutoCompleteTextView
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public SkinCompatMultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
TINT_ATTRS, defStyleAttr, 0);
if (a.hasValue(0)) {
mDropDownBackgroundResId = a.getResourceId(0, INVALID_ID);
}
a.recycle();
applyDropDownBackgroundResource();
mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
mTextHelper = new SkinCompatTextHelper(this);
mTextHelper.loadFromAttributes(attrs, defStyleAttr);
}
示例8: loadFromAttributes
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
final Context context = mView.getContext();
// First read the TextAppearance style id
TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs,
R.styleable.SkinCompatTextHelper, defStyleAttr, 0);
final int ap = a.getResourceId(R.styleable.SkinCompatTextHelper_android_textAppearance, INVALID_ID);
SkinLog.d(TAG, "ap = " + ap);
a.recycle();
if (ap != INVALID_ID) {
a = TintTypedArray.obtainStyledAttributes(context, ap, R.styleable.SkinTextAppearance);
if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
SkinLog.d(TAG, "mTextColorResId = " + mTextColorResId);
}
if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
mTextColorHintResId = a.getResourceId(
R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
SkinLog.d(TAG, "mTextColorHintResId = " + mTextColorHintResId);
}
a.recycle();
}
// Now read the style's values
a = TintTypedArray.obtainStyledAttributes(context, attrs, R.styleable.SkinTextAppearance,
defStyleAttr, 0);
if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
SkinLog.d(TAG, "mTextColorResId = " + mTextColorResId);
}
if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
mTextColorHintResId = a.getResourceId(
R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
SkinLog.d(TAG, "mTextColorHintResId = " + mTextColorHintResId);
}
a.recycle();
applySkin();
}
示例9: onSetTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void onSetTextAppearance(Context context, int resId) {
final TintTypedArray a = TintTypedArray.obtainStyledAttributes(context,
resId, R.styleable.SkinTextAppearance);
if (a.hasValue(R.styleable.SkinTextAppearance_android_textColor)) {
mTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
SkinLog.d(TAG, "mTextColorResId = " + mTextColorResId);
}
if (a.hasValue(R.styleable.SkinTextAppearance_android_textColorHint)) {
mTextColorHintResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColorHint, INVALID_ID);
SkinLog.d(TAG, "mTextColorHintResId = " + mTextColorHintResId);
}
a.recycle();
applySkin();
}
示例10: SkinCompatToolbar
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public SkinCompatToolbar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mBackgroundTintHelper = new SkinCompatBackgroundHelper(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
R.styleable.Toolbar, defStyleAttr, 0);
mNavigationIconResId = a.getResourceId(R.styleable.Toolbar_navigationIcon, INVALID_ID);
int titleAp = a.getResourceId(R.styleable.Toolbar_titleTextAppearance, INVALID_ID);
int subtitleAp = a.getResourceId(R.styleable.Toolbar_subtitleTextAppearance, INVALID_ID);
a.recycle();
if (titleAp != INVALID_ID) {
a = TintTypedArray.obtainStyledAttributes(context, titleAp, R.styleable.SkinTextAppearance);
mTitleTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
a.recycle();
}
if (subtitleAp != INVALID_ID) {
a = TintTypedArray.obtainStyledAttributes(context, subtitleAp, R.styleable.SkinTextAppearance);
mSubtitleTextColorResId = a.getResourceId(R.styleable.SkinTextAppearance_android_textColor, INVALID_ID);
a.recycle();
}
a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
R.styleable.Toolbar, defStyleAttr, 0);
if (a.hasValue(R.styleable.Toolbar_titleTextColor)) {
mTitleTextColorResId = a.getResourceId(R.styleable.Toolbar_titleTextColor, INVALID_ID);
}
if (a.hasValue(R.styleable.Toolbar_subtitleTextColor)) {
mSubtitleTextColorResId = a.getResourceId(R.styleable.Toolbar_subtitleTextColor, INVALID_ID);
}
a.recycle();
applyTitleTextColor();
applySubtitleTextColor();
applyNavigationIcon();
}
示例11: ExpandedMenuView
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public ExpandedMenuView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs);
setOnItemClickListener(this);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, TINT_ATTRS, defStyleAttr, 0);
if (a.hasValue(0)) {
setBackgroundDrawable(a.getDrawable(0));
}
if (a.hasValue(1)) {
setDivider(a.getDrawable(1));
}
a.recycle();
}
示例12: setCollapsedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setCollapsedTextAppearance(int resId) {
TintTypedArray a =
TintTypedArray.obtainStyledAttributes(
view.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
collapsedTextColor =
a.getColorStateList(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
}
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
collapsedTextSize =
a.getDimensionPixelSize(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
(int) collapsedTextSize);
}
collapsedShadowColor =
a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
collapsedShadowDx =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
collapsedShadowDy =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
collapsedShadowRadius =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
collapsedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例13: setExpandedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setExpandedTextAppearance(int resId) {
TintTypedArray a =
TintTypedArray.obtainStyledAttributes(
view.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
expandedTextColor =
a.getColorStateList(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
}
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
expandedTextSize =
a.getDimensionPixelSize(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
(int) expandedTextSize);
}
expandedShadowColor =
a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
expandedShadowDx =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
expandedShadowDy =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
expandedShadowRadius =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
expandedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例14: setCollapsedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setCollapsedTextAppearance(int resId) {
TintTypedArray a =
TintTypedArray.obtainStyledAttributes(
mView.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
mCollapsedTextColor =
a.getColorStateList(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
}
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
mCollapsedTextSize =
a.getDimensionPixelSize(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
(int) mCollapsedTextSize);
}
mCollapsedShadowColor =
a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
mCollapsedShadowDx =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
mCollapsedShadowDy =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
mCollapsedShadowRadius =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
mCollapsedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}
示例15: setExpandedTextAppearance
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setExpandedTextAppearance(int resId) {
TintTypedArray a =
TintTypedArray.obtainStyledAttributes(
mView.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
mExpandedTextColor =
a.getColorStateList(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
}
if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
mExpandedTextSize =
a.getDimensionPixelSize(
android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
(int) mExpandedTextSize);
}
mExpandedShadowColor =
a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
mExpandedShadowDx =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
mExpandedShadowDy =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
mExpandedShadowRadius =
a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
a.recycle();
if (Build.VERSION.SDK_INT >= 16) {
mExpandedTypeface = readFontFamilyTypeface(resId);
}
recalculate();
}