Beispiel #1
0
		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;
		}
Beispiel #2
0
		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();
		}
Beispiel #3
0
		/// <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();
		}
Beispiel #4
0
		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();
		}
		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]_factor, 
				1.0f);
			a.recycle();
		}
		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();
		}
Beispiel #7
0
		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();
		}
Beispiel #8
0
		/// <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();
		}
Beispiel #9
0
		/// <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);
		}
Beispiel #10
0
		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();
		}
Beispiel #11
0
		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();
		}
Beispiel #12
0
		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
				();
		}
Beispiel #13
0
		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();
		}
Beispiel #14
0
		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();
		}
		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();
		}
Beispiel #16
0
		public AdapterViewFlipper(android.content.Context context, android.util.AttributeSet
			 attrs) : base(context, attrs)
		{
			mReceiver = new _BroadcastReceiver_77(this);
			mHandler = new _Handler_249(this);
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.AdapterViewFlipper);
			mFlipInterval = a.getInt([email protected]_flipInterval
				, DEFAULT_INTERVAL);
			mAutoStart = a.getBoolean([email protected]_autoStart
				, false);
			// A view flipper should cycle through the views
			mLoopViews = true;
			a.recycle();
		}
Beispiel #17
0
		public TabHost(android.content.Context context, android.util.AttributeSet attrs) : 
			base(context, attrs)
		{
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.TabWidget, [email protected], 0);
			mTabLayoutId = a.getResourceId([email protected]_tabLayout, 
				0);
			a.recycle();
			if (mTabLayoutId == 0)
			{
				// In case the tabWidgetStyle does not inherit from Widget.TabWidget and tabLayout is
				// not defined.
				mTabLayoutId = [email protected]_indicator_holo;
			}
			initTabHost();
		}
Beispiel #18
0
		public ViewStub(android.content.Context context, android.util.AttributeSet attrs, 
			int defStyle)
		{
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.ViewStub, defStyle, 0);
			mInflatedId = a.getResourceId([email protected]_inflatedId, 
				NO_ID);
			mLayoutResource = a.getResourceId([email protected]_layout, 
				0);
			a.recycle();
			a = context.obtainStyledAttributes(attrs, [email protected], defStyle
				, 0);
			mID = a.getResourceId([email protected]_id, NO_ID);
			a.recycle();
			initialize(context);
		}
Beispiel #19
0
		public CheckedTextView(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.CheckedTextView, defStyle, 0);
			android.graphics.drawable.Drawable d = a.getDrawable([email protected]
				.CheckedTextView_checkMark);
			if (d != null)
			{
				setCheckMarkDrawable(d);
			}
			bool @checked = a.getBoolean([email protected]_checked
				, false);
			setChecked(@checked);
			a.recycle();
		}
Beispiel #20
0
		public IconMenuItemView(android.content.Context context, android.util.AttributeSet
			 attrs, int defStyle) : base(context, attrs)
		{
			if (sPrependShortcutLabel == null)
			{
				sPrependShortcutLabel = getResources().getString([email protected][email protected]_shortcut_label
					);
			}
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.MenuView, defStyle, 0);
			mDisabledAlpha = a.getFloat([email protected]_itemIconDisabledAlpha
				, 0.8f);
			mTextAppearance = a.getResourceId([email protected]_itemTextAppearance
				, -1);
			mTextAppearanceContext = context;
			a.recycle();
		}
		public ActionBarContextView(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.ActionMode, defStyle, 0);
			setBackgroundDrawable(a.getDrawable([email protected]_background
				));
			mTitleStyleRes = a.getResourceId([email protected]_titleTextStyle
				, 0);
			mSubtitleStyleRes = a.getResourceId([email protected]_subtitleTextStyle
				, 0);
			mContentHeight = a.getLayoutDimension([email protected]_height
				, 0);
			mSplitBackground = a.getDrawable([email protected]_backgroundSplit
				);
			a.recycle();
		}
Beispiel #22
0
		/// <summary>
		/// Initialize this
		/// <see cref="ViewAnimator">ViewAnimator</see>
		/// , possibly setting
		/// <see cref="FrameLayout.setMeasureAllChildren(bool)">FrameLayout.setMeasureAllChildren(bool)
		/// 	</see>
		/// based on
		/// <see cref="FrameLayout">FrameLayout</see>
		/// flags.
		/// </summary>
		private void initViewAnimator(android.content.Context context, android.util.AttributeSet
			 attrs)
		{
			if (attrs == null)
			{
				// For compatibility, always measure children when undefined.
				mMeasureAllChildren = true;
				return;
			}
			// For compatibility, default to measure children, but allow XML
			// attribute to override.
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.FrameLayout);
			bool measureAllChildren = a.getBoolean([email protected]_measureAllChildren
				, true);
			setMeasureAllChildren(measureAllChildren);
			a.recycle();
		}
Beispiel #23
0
		public ActionBarContainer(android.content.Context context, android.util.AttributeSet
			 attrs) : base(context, attrs)
		{
			setBackgroundDrawable(null);
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.ActionBar);
			mBackground = a.getDrawable([email protected]_background);
			mStackedBackground = a.getDrawable([email protected]_backgroundStacked
				);
			if (getId() == [email protected]_action_bar)
			{
				mIsSplit = true;
				mSplitBackground = a.getDrawable([email protected]_backgroundSplit
					);
			}
			a.recycle();
			setWillNotDraw(mIsSplit ? mSplitBackground == null : mBackground == null && mStackedBackground
				 == null);
		}
Beispiel #24
0
		/// <summary><inheritDoc></inheritDoc></summary>
		public RadioGroup(android.content.Context context, android.util.AttributeSet attrs
			) : base(context, attrs)
		{
			// retrieve selected radio button as requested by the user in the
			// XML layout file
			android.content.res.TypedArray attributes = context.obtainStyledAttributes(attrs, 
				[email protected], [email protected]
				, 0);
			int value = attributes.getResourceId([email protected]_checkedButton
				, android.view.View.NO_ID);
			if (value != android.view.View.NO_ID)
			{
				mCheckedId = value;
			}
			int index = attributes.getInt([email protected]_orientation
				, VERTICAL);
			setOrientation(index);
			attributes.recycle();
			init();
		}
Beispiel #25
0
		/// <summary>Constructor used when a RotateAnimation is loaded from a resource.</summary>
		/// <remarks>Constructor used when a RotateAnimation 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 RotateAnimation(android.content.Context context, android.util.AttributeSet
			 attrs) : base(context, attrs)
		{
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.RotateAnimation);
			mFromDegrees = a.getFloat([email protected]_fromDegrees
				, 0.0f);
			mToDegrees = a.getFloat([email protected]_toDegrees, 
				0.0f);
			android.view.animation.Animation.Description d = android.view.animation.Animation
				.Description.parseValue(a.peekValue([email protected]_pivotX
				));
			mPivotXType = d.type;
			mPivotXValue = d.value;
			d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected]
				.styleable.RotateAnimation_pivotY));
			mPivotYType = d.type;
			mPivotYValue = d.value;
			a.recycle();
		}
Beispiel #26
0
		public FrameLayout(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.FrameLayout, defStyle, 0);
			mForegroundGravity = a.getInt([email protected]_foregroundGravity
				, mForegroundGravity);
			android.graphics.drawable.Drawable d = a.getDrawable([email protected]
				.FrameLayout_foreground);
			if (d != null)
			{
				setForeground(d);
			}
			if (a.getBoolean([email protected]_measureAllChildren, false
				))
			{
				setMeasureAllChildren(true);
			}
			mForegroundInPadding = a.getBoolean([email protected]_foregroundInsidePadding
				, true);
			a.recycle();
		}
Beispiel #27
0
		public ViewAnimator(android.content.Context context, android.util.AttributeSet attrs
			) : base(context, attrs)
		{
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.ViewAnimator);
			int resource = a.getResourceId([email protected]_inAnimation
				, 0);
			if (resource > 0)
			{
				setInAnimation(context, resource);
			}
			resource = a.getResourceId([email protected]_outAnimation
				, 0);
			if (resource > 0)
			{
				setOutAnimation(context, resource);
			}
			bool flag = a.getBoolean([email protected]_animateFirstView
				, true);
			setAnimateFirstView(flag);
			a.recycle();
			initViewAnimator(context, attrs);
		}
Beispiel #28
0
		/// <summary>Constructor used when a TranslateAnimation is loaded from a resource.</summary>
		/// <remarks>Constructor used when a TranslateAnimation 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 TranslateAnimation(android.content.Context context, android.util.AttributeSet
			 attrs) : base(context, attrs)
		{
			android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected]
				.styleable.TranslateAnimation);
			android.view.animation.Animation.Description d = android.view.animation.Animation
				.Description.parseValue(a.peekValue([email protected]_fromXDelta
				));
			mFromXType = d.type;
			mFromXValue = d.value;
			d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected]
				.styleable.TranslateAnimation_toXDelta));
			mToXType = d.type;
			mToXValue = d.value;
			d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected]
				.styleable.TranslateAnimation_fromYDelta));
			mFromYType = d.type;
			mFromYValue = d.value;
			d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected]
				.styleable.TranslateAnimation_toYDelta));
			mToYType = d.type;
			mToYValue = d.value;
			a.recycle();
		}
Beispiel #29
0
			/// <summary><inheritDoc></inheritDoc></summary>
			public LayoutParams(android.content.Context c, android.util.AttributeSet attrs) : 
				base(c, attrs)
			{
				android.content.res.TypedArray a = c.obtainStyledAttributes(attrs, [email protected]
					.styleable.LinearLayout_Layout);
				weight = a.getFloat([email protected]_Layout_layout_weight
					, 0);
				gravity = a.getInt([email protected]_Layout_layout_gravity
					, -1);
				a.recycle();
			}
Beispiel #30
0
		public LinearLayout(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.LinearLayout, defStyle, 0);
			int index = a.getInt([email protected]_orientation, -1);
			if (index >= 0)
			{
				setOrientation(index);
			}
			index = a.getInt([email protected]_gravity, -1);
			if (index >= 0)
			{
				setGravity(index);
			}
			bool baselineAligned = a.getBoolean([email protected]_baselineAligned
				, true);
			if (!baselineAligned)
			{
				setBaselineAligned(baselineAligned);
			}
			mWeightSum = a.getFloat([email protected]_weightSum, -1.0f
				);
			mBaselineAlignedChildIndex = a.getInt([email protected]_baselineAlignedChildIndex
				, -1);
			mUseLargestChild = a.getBoolean([email protected]_measureWithLargestChild
				, false);
			setDividerDrawable(a.getDrawable([email protected]_divider
				));
			mShowDividers = a.getInt([email protected]_showDividers, 
				SHOW_DIVIDER_NONE);
			mDividerPadding = a.getDimensionPixelSize([email protected]_dividerPadding
				, 0);
			a.recycle();
		}