本文整理汇总了Java中android.content.res.TypedArray.recycle方法的典型用法代码示例。如果您正苦于以下问题:Java TypedArray.recycle方法的具体用法?Java TypedArray.recycle怎么用?Java TypedArray.recycle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.res.TypedArray
的用法示例。
在下文中一共展示了TypedArray.recycle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void initView(AttributeSet attrs) {
if (attrs != null) {
TypedArray a = getContext().obtainStyledAttributes(attrs,
R.styleable.BubbleImageView);
mAngle = (int) a.getDimension(
R.styleable.BubbleImageView_bubble_angle, mAngle);
mArrowHeight = (int) a.getDimension(
R.styleable.BubbleImageView_bubble_arrowHeight,
mArrowHeight);
mArrowOffset = (int) a.getDimension(
R.styleable.BubbleImageView_bubble_arrowOffset,
mArrowOffset);
mArrowTop = (int) a.getDimension(
R.styleable.BubbleImageView_bubble_arrowTop, mArrowTop);
mArrowWidth = (int) a.getDimension(
R.styleable.BubbleImageView_bubble_arrowWidth, mAngle);
mArrowLocation = a.getInt(
R.styleable.BubbleImageView_bubble_arrowLocation,
mArrowLocation);
mShowText = a.getBoolean(R.styleable.BubbleImageView_bubble_showText, mShowText);
mShowShadow = a.getBoolean(R.styleable.BubbleImageView_bubble_showShadow, mShowShadow);
a.recycle();
}
}
示例2: VerticalSlideColorPicker
import android.content.res.TypedArray; //导入方法依赖的package包/类
public VerticalSlideColorPicker(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.VerticalSlideColorPicker, 0, 0);
try {
int colorsResourceId = a.getResourceId(R.styleable.VerticalSlideColorPicker_pickerColors, R.array.scribble_colors);
colors = a.getResources().getIntArray(colorsResourceId);
borderColor = a.getColor(R.styleable.VerticalSlideColorPicker_pickerBorderColor, Color.WHITE);
borderWidth = a.getDimension(R.styleable.VerticalSlideColorPicker_pickerBorderWidth, 10f);
} finally {
a.recycle();
}
init();
}
示例3: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
void init(AttributeSet attrs) {
resources = context.getResources();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.VectorMasterView);
final int N = a.getIndexCount();
for (int i = 0; i < N; ++i) {
int attr = a.getIndex(i);
if (attr == R.styleable.VectorMasterView_vector_src) {
resID = a.getResourceId(attr, -1);
} else if (attr == R.styleable.VectorMasterView_use_legacy_parser) {
useLegacyParser = a.getBoolean(attr, false);
}
}
a.recycle();
buildVectorModel();
}
示例4: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs) {
this.context = context;
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseContactList);
primaryColor = ta.getColor(R.styleable.EaseContactList_ctsListPrimaryTextColor, 0);
primarySize = ta.getDimensionPixelSize(R.styleable.EaseContactList_ctsListPrimaryTextSize, 0);
showSiderBar = ta.getBoolean(R.styleable.EaseContactList_ctsListShowSiderBar, true);
initialLetterBg = ta.getDrawable(R.styleable.EaseContactList_ctsListInitialLetterBg);
initialLetterColor = ta.getColor(R.styleable.EaseContactList_ctsListInitialLetterColor, 0);
ta.recycle();
LayoutInflater.from(context).inflate(R.layout.ease_widget_contact_list, this);
listView = (ListView)findViewById(R.id.list);
sidebar = (EaseSidebar) findViewById(R.id.sidebar);
if(!showSiderBar)
sidebar.setVisibility(View.GONE);
}
示例5: initDimensions
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void initDimensions(Context context, AttributeSet attrs) {
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.MozaikLayout, 0, 0);
try {
//maxSingleImageHeight = a.getDimensionPixelSize(R.styleable.MozaikLayout_maxSingleImageHeight, (int) context.getResources().getDimension(R.dimen.max_single_image_height));
maxSingleImageHeight = a.getDimensionPixelSize(R.styleable.MozaikLayout_maxSingleImageHeight, getDisplayHeight(context));
prefImageSize = (int) a.getDimension(R.styleable.MozaikLayout_prefImageSize, context.getResources().getDimension(R.dimen.pref_image_size));
spacing = a.getDimensionPixelSize(R.styleable.MozaikLayout_spacing, (int) dpToPx(1));
} finally {
a.recycle();
}
}
示例6: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void init(AttributeSet attrs) {
setOrientation(VERTICAL);
mainParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
mainParams.weight = 1;
secondaryParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);
secondaryParams.weight = 1;
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.OnetoFouragainLayout);
size = a.getInt(R.styleable.OnetoFouragainLayout_countImages, 0);
a.recycle();
handleSize();
}
示例7: internalSetTargetResources
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void internalSetTargetResources(int resourceId) {
Resources res = getContext().getResources();
TypedArray array = res.obtainTypedArray(resourceId);
int count = array.length();
ArrayList<TargetDrawable> targetDrawables = new ArrayList<TargetDrawable>(count);
for (int i = 0; i < count; i++) {
Drawable drawable = array.getDrawable(i);
targetDrawables.add(new TargetDrawable(res, drawable));
}
array.recycle();
mTargetResourceId = resourceId;
mTargetDrawables = targetDrawables;
updateTargetPositions();
}
示例8: InitFromAttributes
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void InitFromAttributes(Context context, AttributeSet attrs) {
TypedArray arr = context.obtainStyledAttributes(attrs, R.styleable.DecimalEdit);
CharSequence editmode = arr.getString(R.styleable.DecimalEdit_EditMode);
if (editmode != null) {
String szVal = editmode.toString();
EditMode em = EditMode.valueOf(szVal);
setMode(em);
}
arr.recycle();
}
示例9: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs){
LayoutInflater.from(context).inflate(R.layout.ease_widget_emojicon, this);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.EaseEmojiconMenu);
int defaultColumns = 7;
emojiconColumns = ta.getInt(R.styleable.EaseEmojiconMenu_emojiconColumns, defaultColumns);
int defaultBigColumns = 4;
bigEmojiconColumns = ta.getInt(R.styleable.EaseEmojiconMenu_bigEmojiconRows, defaultBigColumns);
ta.recycle();
pagerView = (EaseEmojiconPagerView) findViewById(R.id.pager_view);
indicatorView = (EaseEmojiconIndicatorView) findViewById(R.id.indicator_view);
tabBar = (EaseEmojiconScrollTabBar) findViewById(R.id.tab_bar);
}
示例10: RemindItem
import android.content.res.TypedArray; //导入方法依赖的package包/类
public RemindItem(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.lingju);
title=a.getString(R.styleable.lingju_item_title);
frequency=a.getInt(R.styleable.lingju_frequency, 0);
time=a.getInt(R.styleable.lingju_time, 0);
a.recycle();
init(context);
}
示例11: RoundCircleView
import android.content.res.TypedArray; //导入方法依赖的package包/类
public RoundCircleView(Context context, AttributeSet attrs) {
super(context, attrs);
boolean isSelected = false;
int color = UiUtils.getPrimaryColor(context);
final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.WeekPickerAttrs);
if(attrs!=null){
isSelected = array.getBoolean(R.styleable.WeekPickerAttrs_isSelected,false);
color = array.getColor(R.styleable.WeekPickerAttrs_pickerColor,UiUtils.getPrimaryColor(context));
array.recycle();
}
init(context,isSelected,color);
}
示例12: initView
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void initView(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.FunGameHitBlockHeader);
blockHorizontalNum = typedArray.getInt(R.styleable.FunGameHitBlockHeader_fgvBlockHorizontalNum, BLOCK_HORIZONTAL_NUM);
speed = typedArray.getInt(R.styleable.FunGameHitBlockHeader_fgvBallSpeed, DensityUtil.dp2px(SPEED));
typedArray.recycle();
blockPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
blockPaint.setStyle(Paint.Style.FILL);
BALL_RADIUS = DensityUtil.dp2px(4);
}
示例13: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
public static void init(TextView view, AttributeSet attrs, int defStyleAttr) {
Threed t = getThreed(view);
TypedArray a = view.getContext().obtainStyledAttributes(attrs, MoreTextView, 0, defStyleAttr);
t.moreText = a.getString(MoreTextView_moreText);
t.moreTextColor = a.getColor(MoreTextView_moreTextColor, view.getTextColors().getDefaultColor());
a.recycle();
view.setEllipsize(TruncateAt.END);
if (!isEmpty(t.moreText)) {
view.setOnClickListener(t);
}
}
示例14: DanmakuView
import android.content.res.TypedArray; //导入方法依赖的package包/类
public DanmakuView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
TypedArray a = mContext.obtainStyledAttributes(attrs, R.styleable.DanmakuView, 0, 0);
mMaxRow = a.getInteger(R.styleable.DanmakuView_max_row, 1);
mPickItemInterval = a.getInteger(R.styleable.DanmakuView_pick_interval, 1000);
mMaxRunningPerRow = a.getInteger(R.styleable.DanmakuView_max_running_per_row, 1);
mShowDebug = a.getBoolean(R.styleable.DanmakuView_show_debug, false);
mStartYOffset = a.getFloat(R.styleable.DanmakuView_start_Y_offset, 0.1f);
mEndYOffset = a.getFloat(R.styleable.DanmakuView_end_Y_offset, 0.9f);
a.recycle();
checkYOffset(mStartYOffset, mEndYOffset);
init();
}
示例15: setupAttributes
import android.content.res.TypedArray; //导入方法依赖的package包/类
private void setupAttributes(AttributeSet attrs) {
TypedArray array = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.PerformanceBarView, 0, 0);
//Now extract custom attributes into member variables
try {
DEFAULT_BAR_HEIGHT = UiUtils.dpToPx(22);
MIN_HEIGHT = UiUtils.dpToPx(14);
barBorderColor = array.getColor(
R.styleable.PerformanceBarView_barBorderColor, DEFAULT_BORDER_COLOR);
barPositiveColor = array.getColor(
R.styleable.PerformanceBarView_barPositiveColor, DEFAULT_BAR_POSITIVE_COLOR);
barNegativeColor = array.getColor(
R.styleable.PerformanceBarView_barNegativeColor, DEFAULT_BAR_NEGATIVE_COLOR);
barBorderThickness = array.getDimension(
R.styleable.PerformanceBarView_barBorderThickness, DEFAULT_BORDER_THICKNESS);
barHeight = array.getDimension(
R.styleable.PerformanceBarView_barHeight, DEFAULT_BAR_HEIGHT);
barWidth = array.getDimension(
R.styleable.PerformanceBarView_barWidth, DEFAULT_BAR_WIDTH);
cornerRadius = array.getDimension(
R.styleable.PerformanceBarView_cornerRadius, DEFAULT_CORNER_RADIUS);
shadowEnabled = array.getBoolean(
R.styleable.PerformanceBarView_shadowEnabled, DEFAULT_SHADOW_ENABLED);
progressAsDate = false;
textColor = Color.WHITE;
deadlineDate = -1;
startDate = -1;
goal = array.getFloat(R.styleable.PerformanceBarView_goal, DEFAULT_GOAL);
progress = array.getFloat(R.styleable.PerformanceBarView_progress, DEFAULT_PROGRESS);
calculateChange();
} finally {
array.recycle();
}
}