本文整理汇总了C#中android.obtainStyledAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# android.obtainStyledAttributes方法的具体用法?C# android.obtainStyledAttributes怎么用?C# android.obtainStyledAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android
的用法示例。
在下文中一共展示了android.obtainStyledAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RatingBar
public RatingBar(android.content.Context context, android.util.AttributeSet attrs
, int defStyle) : base(context, attrs, defStyle)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.RatingBar, defStyle, 0);
int numStars = a.getInt([email protected]_numStars, mNumStars
);
setIsIndicator(a.getBoolean([email protected]_isIndicator,
!mIsUserSeekable));
float rating = a.getFloat([email protected]_rating, -1);
float stepSize = a.getFloat([email protected]_stepSize, -1);
a.recycle();
if (numStars > 0 && numStars != mNumStars)
{
setNumStars(numStars);
}
if (stepSize >= 0)
{
setStepSize(stepSize);
}
else
{
setStepSize(0.5f);
}
if (rating >= 0)
{
setRating(rating);
}
// A touch inside a star fill up to that fractional area (slightly more
// than 1 so boundaries round up).
mTouchProgressOffset = 1.1f;
}
示例2: AnalogClock
public AnalogClock(android.content.Context context, android.util.AttributeSet attrs
, int defStyle) : base(context, attrs, defStyle)
{
mIntentReceiver = new _BroadcastReceiver_236(this);
android.content.res.Resources r = mContext.getResources();
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.AnalogClock, defStyle, 0);
mDial = a.getDrawable([email protected]_dial);
if (mDial == null)
{
mDial = r.getDrawable([email protected]_dial);
}
mHourHand = a.getDrawable([email protected]_hand_hour);
if (mHourHand == null)
{
mHourHand = r.getDrawable([email protected]_hand_hour);
}
mMinuteHand = a.getDrawable([email protected]_hand_minute
);
if (mMinuteHand == null)
{
mMinuteHand = r.getDrawable([email protected]_hand_minute);
}
mCalendar = new android.text.format.Time();
mDialWidth = mDial.getIntrinsicWidth();
mDialHeight = mDial.getIntrinsicHeight();
}
示例3: AnimationSet
/// <summary>Constructor used when an AnimationSet is loaded from a resource.</summary>
/// <remarks>Constructor used when an AnimationSet is loaded from a resource.</remarks>
/// <param name="context">Application context to use</param>
/// <param name="attrs">Attribute set from which to read values</param>
public AnimationSet(android.content.Context context, android.util.AttributeSet attrs
) : base(context, attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.AnimationSet);
setFlag(PROPERTY_SHARE_INTERPOLATOR_MASK, a.getBoolean([email protected]
.AnimationSet_shareInterpolator, true));
init();
if (context.getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES
.ICE_CREAM_SANDWICH)
{
if (a.hasValue([email protected]_duration))
{
mFlags |= PROPERTY_DURATION_MASK;
}
if (a.hasValue([email protected]_fillBefore))
{
mFlags |= PROPERTY_FILL_BEFORE_MASK;
}
if (a.hasValue([email protected]_fillAfter))
{
mFlags |= PROPERTY_FILL_AFTER_MASK;
}
if (a.hasValue([email protected]_repeatMode))
{
mFlags |= PROPERTY_REPEAT_MODE_MASK;
}
if (a.hasValue([email protected]_startOffset))
{
mFlags |= PROPERTY_START_OFFSET_MASK;
}
}
a.recycle();
}
示例4: TwoLineListItem
public TwoLineListItem(android.content.Context context, android.util.AttributeSet
attrs, int defStyle) : base(context, attrs, defStyle)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.TwoLineListItem, defStyle, 0);
a.recycle();
}
示例5: DecelerateInterpolator
public DecelerateInterpolator(android.content.Context context, android.util.AttributeSet
attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.DecelerateInterpolator);
mFactor = a.getFloat([email protected].R.styleable.DecelerateInterpolator_factor,
1.0f);
a.recycle();
}
示例6: AnticipateInterpolator
public AnticipateInterpolator(android.content.Context context, android.util.AttributeSet
attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.AnticipateInterpolator);
mTension = a.getFloat([email protected]_tension
, 2.0f);
a.recycle();
}
示例7: CycleInterpolator
public CycleInterpolator(android.content.Context context, android.util.AttributeSet
attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.CycleInterpolator);
mCycles = a.getFloat([email protected]_cycles, 1.0f
);
a.recycle();
}
示例8: AlphaAnimation
/// <summary>Constructor used when an AlphaAnimation is loaded from a resource.</summary>
/// <remarks>Constructor used when an AlphaAnimation is loaded from a resource.</remarks>
/// <param name="context">Application context to use</param>
/// <param name="attrs">Attribute set from which to read values</param>
public AlphaAnimation(android.content.Context context, android.util.AttributeSet
attrs) : base(context, attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.AlphaAnimation);
mFromAlpha = a.getFloat([email protected]_fromAlpha, 1.0f
);
mToAlpha = a.getFloat([email protected]_toAlpha, 1.0f);
a.recycle();
}
示例9: ExpandedMenuView
/// <summary>Instantiates the ExpandedMenuView that is linked with the provided MenuBuilder.
/// </summary>
/// <remarks>Instantiates the ExpandedMenuView that is linked with the provided MenuBuilder.
/// </remarks>
/// <param name="menu">The model for the menu which this MenuView will display</param>
public ExpandedMenuView(android.content.Context context, android.util.AttributeSet
attrs) : base(context, attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.MenuView, 0, 0);
mAnimations = a.getResourceId([email protected]_windowAnimationStyle
, 0);
a.recycle();
setOnItemClickListener(this);
}
示例10: ToggleButton
public ToggleButton(android.content.Context context, android.util.AttributeSet attrs
, int defStyle) : base(context, attrs, defStyle)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.ToggleButton, defStyle, 0);
mTextOn = a.getText([email protected]_textOn);
mTextOff = a.getText([email protected]_textOff);
mDisabledAlpha = a.getFloat([email protected]_disabledAlpha
, 0.5f);
syncTextState();
a.recycle();
}
示例11: ViewFlipper
public ViewFlipper(android.content.Context context, android.util.AttributeSet attrs
) : base(context, attrs)
{
mReceiver = new _BroadcastReceiver_69(this);
mHandler = new _Handler_201(this);
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.ViewFlipper);
mFlipInterval = a.getInt([email protected]_flipInterval,
DEFAULT_INTERVAL);
mAutoStart = a.getBoolean([email protected]_autoStart, false
);
a.recycle();
}
示例12: AbsSeekBar
public AbsSeekBar(android.content.Context context, android.util.AttributeSet attrs
, int defStyle) : base(context, attrs, defStyle)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.SeekBar, defStyle, 0);
android.graphics.drawable.Drawable thumb = a.getDrawable([email protected]
.SeekBar_thumb);
setThumb(thumb);
// will guess mThumbOffset if thumb != null...
// ...but allow layout to override this
int thumbOffset = a.getDimensionPixelOffset([email protected]_thumbOffset
, getThumbOffset());
setThumbOffset(thumbOffset);
a.recycle();
a = context.obtainStyledAttributes(attrs, [email protected], 0,
0);
mDisabledAlpha = a.getFloat([email protected]_disabledAlpha, 0.5f
);
a.recycle();
mScaledTouchSlop = android.view.ViewConfiguration.get(context).getScaledTouchSlop
();
}
示例13: TabWidget
public TabWidget(android.content.Context context, android.util.AttributeSet attrs
, int defStyle) : base(context, attrs, defStyle)
{
// This value will be set to 0 as soon as the first tab is added to TabHost.
// When positive, the widths and heights of tabs will be imposed so that they fit in parent
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.TabWidget, defStyle, 0);
setStripEnabled(a.getBoolean(android.R.styleable.TabWidget_tabStripEnabled, true)
);
setLeftStripDrawable(a.getDrawable(android.R.styleable.TabWidget_tabStripLeft));
setRightStripDrawable(a.getDrawable(android.R.styleable.TabWidget_tabStripRight));
a.recycle();
initTabWidget();
}
示例14: ListMenuItemView
public ListMenuItemView(android.content.Context context, android.util.AttributeSet
attrs, int defStyle) : base(context, attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.MenuView, defStyle, 0);
mBackground = a.getDrawable([email protected]_itemBackground
);
mTextAppearance = a.getResourceId([email protected]_itemTextAppearance
, -1);
mPreserveIconSpacing = a.getBoolean([email protected]_preserveIconSpacing
, false);
mTextAppearanceContext = context;
a.recycle();
}
示例15: WeightedLinearLayout
public WeightedLinearLayout(android.content.Context context, android.util.AttributeSet
attrs) : base(context, attrs)
{
android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
.styleable.WeightedLinearLayout);
mMajorWeightMin = a.getFloat([email protected]_majorWeightMin
, 0.0f);
mMinorWeightMin = a.getFloat([email protected]_minorWeightMin
, 0.0f);
mMajorWeightMax = a.getFloat([email protected]_majorWeightMax
, 0.0f);
mMinorWeightMax = a.getFloat([email protected]_minorWeightMax
, 0.0f);
a.recycle();
}