本文整理汇总了Java中android.support.v7.widget.TintTypedArray.recycle方法的典型用法代码示例。如果您正苦于以下问题:Java TintTypedArray.recycle方法的具体用法?Java TintTypedArray.recycle怎么用?Java TintTypedArray.recycle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.TintTypedArray
的用法示例。
在下文中一共展示了TintTypedArray.recycle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: MyToolBar
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public MyToolBar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initview();
if (attrs != null) {
final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
R.styleable.MyToolBar, defStyleAttr, 0);
showSearchView = a.getBoolean(R.styleable.MyToolBar_showSearchView, false);
left_button_icon = a.getDrawable(R.styleable.MyToolBar_leftButtonIcon);
right_button_icon = a.getDrawable(R.styleable.MyToolBar_rightButtonIcon);
title = a.getString(R.styleable.MyToolBar_myTitle);
a.recycle();
}
isShouw();
setContentInsetsRelative(10, 10);
initListener();
}
示例3: reSetSubTitleStyle
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
/**
* 重新设置标题的样式
*
* @param context
* @param attrs
* @param defStyleAttr
*/
private void reSetSubTitleStyle(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
final TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs,
R.styleable.Toolbar, defStyleAttr, 0);
final int titleTextAppearance = a.getResourceId(R.styleable.Toolbar_subtitleTextAppearance, 0);
if (titleTextAppearance != 0) {
setSubtitleTextAppearance(context, titleTextAppearance);
}
if (mSubtitleTextColor != 0) {
setTitleTextColor(mSubtitleTextColor);
}
a.recycle();
post(new Runnable() {
@Override
public void run() {
if (getLayoutParams() instanceof LayoutParams) {
((LayoutParams) getLayoutParams()).gravity = Gravity.CENTER;
}
}
});
}
示例4: 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();
}
示例5: init
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
private void init(final AttributeSet attrs, final int defStyleAttr) {
final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
R.styleable.IcButtonStyle, defStyleAttr, 0);
try {
final AppCompatDrawableManager drawableManager = AppCompatDrawableManager.get();
Drawable rightIcon = a.getDrawableIfKnown(R.styleable.IcButtonStyle_rightIcon);
int id = a.getResourceId(R.styleable.IcButtonStyle_rightIcon, -1);
if (id != -1) {
rightIcon = drawableManager.getDrawable(getContext(), id);
}
Drawable topIcon = a.getDrawableIfKnown(R.styleable.IcButtonStyle_topIcon);
id = a.getResourceId(R.styleable.IcButtonStyle_topIcon, -1);
if (id != -1) {
topIcon = drawableManager.getDrawable(getContext(), id);
}
setCompoundDrawablesWithIntrinsicBounds(null, topIcon, rightIcon, null);
} finally {
a.recycle();
}
}
示例6: createDummyTextView
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
@SuppressLint("PrivateResource")
private void createDummyTextView(Context context) {
final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), null,
R.styleable.Toolbar, R.attr.toolbarStyle, 0);
int titleTextAppearance =
a.getResourceId(R.styleable.Toolbar_titleTextAppearance, 0);
a.recycle();
dummy = new TextView(context);
dummy.setSingleLine();
dummy.setEllipsize(TextUtils.TruncateAt.END);
TextViewCompat.setTextAppearance(dummy, titleTextAppearance);
collapsedTextSize = dummy.getTextSize();
expendedTextSize = collapsedTextSize * TEXT_SCALE_FACTOR;
dummy.setTextSize(ViewUtils.convertPixelToSp(expendedTextSize));
dummy.setVisibility(INVISIBLE);
addView(dummy, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
}
示例7: 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();
}
示例8: 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();
}
示例9: loadFromAttributes
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs,
com.ljz.base.widget.R.styleable.SelectorInjection, defStyleAttr, 0);
Drawable[] drawables = mView.getCompoundDrawables();
try {
int leftColor = a.getColor(com.ljz.base.widget.R.styleable.SelectorInjection_drawableLeftTint, DEFAULT_COLOR);
int topColor = a.getColor(com.ljz.base.widget.R.styleable.SelectorInjection_drawableTopTint, DEFAULT_COLOR);
int rightColor = a.getColor(com.ljz.base.widget.R.styleable.SelectorInjection_drawableRightTint, DEFAULT_COLOR);
int bottomColor = a.getColor(com.ljz.base.widget.R.styleable.SelectorInjection_drawableBottomTint, DEFAULT_COLOR);
int[] colors = {leftColor, topColor, rightColor, bottomColor};
tintDrawable(drawables, colors);
} finally {
a.recycle();
}
}
示例10: KyToolBar
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public KyToolBar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView();
final TintTypedArray a =
TintTypedArray.obtainStyledAttributes(getContext(), attrs, R.styleable.KyToolbar,
defStyleAttr, 0);
final boolean enableKyNavigationIcon =
a.getBoolean(R.styleable.KyToolbar_enableKyNavigationIcon, true);
final boolean enableKySearch = a.getBoolean(R.styleable.KyToolbar_enableKySearch, false);
final Drawable navIcon = a.getDrawable(R.styleable.KyToolbar_KyNavigationIcon);
final Drawable rightButtonIcon = a.getDrawable(R.styleable.KyToolbar_setRightButton);
final String rightText = a.getString(R.styleable.KyToolbar_setRightText);
setNavigationIcon(navIcon);
setRightButtonIcon(rightButtonIcon);
enableKyNavigation(enableKyNavigationIcon);
setRightTextView(rightText);
setEnabledSearch(enableKySearch);
a.recycle();
}
示例11: TabItem
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public TabItem(Context context, AttributeSet attrs) {
super(context, attrs);
TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, R.styleable.TabItem);
this.mText = a.getText(R.styleable.TabItem_android_text);
this.mIcon = a.getDrawable(R.styleable.TabItem_android_icon);
this.mCustomLayout = a.getResourceId(R.styleable.TabItem_android_layout, 0);
a.recycle();
}
示例12: loadFromAttributes
import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void loadFromAttributes(AttributeSet attrs, int defStyleAttr) {
TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), attrs,
TINT_ATTRS, defStyleAttr, 0);
mIndeterminateDrawableResId = a.getResourceId(0, INVALID_ID);
mProgressDrawableResId = a.getResourceId(1, INVALID_ID);
a.recycle();
applySkin();
}
示例13: 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();
}
示例14: 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);
}
示例15: 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);
}