Ejemplo n.º 1
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();
		}
Ejemplo n.º 2
0
		/// <summary>Create a Scroller with the specified interpolator.</summary>
		/// <remarks>
		/// Create a Scroller with the specified interpolator. If the interpolator is
		/// null, the default (viscous) interpolator will be used. "Flywheel" behavior will
		/// be in effect for apps targeting Honeycomb or newer.
		/// </remarks>
		public Scroller(android.content.Context context, android.view.animation.Interpolator
			 interpolator) : this(context, interpolator, context.getApplicationInfo().targetSdkVersion
			 >= android.os.Build.VERSION_CODES.HONEYCOMB)
		{
		}
Ejemplo n.º 3
0
		private void init(android.content.Context context)
		{
			// Get both the scrollbar states drawables
			android.content.res.TypedArray ta = context.getTheme().obtainStyledAttributes(ATTRS
				);
			useThumbDrawable(context, ta.getDrawable(THUMB_DRAWABLE));
			mTrackDrawable = ta.getDrawable(TRACK_DRAWABLE);
			mOverlayDrawableLeft = ta.getDrawable(PREVIEW_BACKGROUND_LEFT);
			mOverlayDrawableRight = ta.getDrawable(PREVIEW_BACKGROUND_RIGHT);
			mOverlayPosition = ta.getInt(OVERLAY_POSITION, OVERLAY_FLOATING);
			mScrollCompleted = true;
			getSectionsFromIndexer();
			mOverlaySize = context.getResources().getDimensionPixelSize([email protected]
				.fastscroll_overlay_size);
			mOverlayPos = new android.graphics.RectF();
			mScrollFade = new android.widget.FastScroller.ScrollFade(this);
			mPaint = new android.graphics.Paint();
			mPaint.setAntiAlias(true);
			mPaint.setTextAlign(android.graphics.Paint.Align.CENTER);
			mPaint.setTextSize(mOverlaySize / 2);
			android.content.res.ColorStateList textColor = ta.getColorStateList(TEXT_COLOR);
			int textColorNormal = textColor.getDefaultColor();
			mPaint.setColor(textColorNormal);
			mPaint.setStyle(android.graphics.Paint.Style.FILL_AND_STROKE);
			// to show mOverlayDrawable properly
			if (mList.getWidth() > 0 && mList.getHeight() > 0)
			{
				onSizeChanged(mList.getWidth(), mList.getHeight(), 0, 0);
			}
			mState = STATE_NONE;
			refreshDrawableState();
			ta.recycle();
			mScaledTouchSlop = android.view.ViewConfiguration.get(context).getScaledTouchSlop
				();
			mMatchDragPosition = context.getApplicationInfo().targetSdkVersion >= android.os.Build
				.VERSION_CODES.HONEYCOMB;
			setScrollbarPosition(mList.getVerticalScrollbarPosition());
		}
Ejemplo n.º 4
0
		/// <summary>Creates a GestureDetector with the supplied listener.</summary>
		/// <remarks>
		/// Creates a GestureDetector with the supplied listener.
		/// You may only use this constructor from a UI thread (this is the usual situation).
		/// </remarks>
		/// <seealso cref="android.os.Handler.Handler()">android.os.Handler.Handler()</seealso>
		/// <param name="context">the application's context</param>
		/// <param name="listener">
		/// the listener invoked for all the callbacks, this must
		/// not be null.
		/// </param>
		/// <param name="handler">the handler to use</param>
		/// <exception cref="System.ArgumentNullException">
		/// if
		/// <code>listener</code>
		/// is null.
		/// </exception>
		public GestureDetector(android.content.Context context, android.view.GestureDetector
			.OnGestureListener listener, android.os.Handler handler) : this(context, listener
			, handler, context != null && context.getApplicationInfo().targetSdkVersion >= android.os.Build
			.VERSION_CODES.FROYO)
		{
			mInputEventConsistencyVerifier = android.view.InputEventConsistencyVerifier.isInstrumentationEnabled
				() ? new android.view.InputEventConsistencyVerifier(this, 0) : null;
		}