Exemplo n.º 1
0
            public virtual android.view.View createIndicatorView()
            {
                android.content.Context     context  = this._enclosing.getContext();
                android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService
                                                           (android.content.Context.LAYOUT_INFLATER_SERVICE);
                android.view.View tabIndicator = inflater.inflate(this._enclosing.mTabLayoutId, this
                                                                  ._enclosing.mTabWidget, false);
                // tab widget is the parent
                // no inflate params
                android.widget.TextView tv = (android.widget.TextView)tabIndicator.findViewById([email protected]
                                                                                                .id.title);
                android.widget.ImageView iconView = (android.widget.ImageView)tabIndicator.findViewById
                                                        ([email protected]);
                // when icon is gone by default, we're in exclusive mode
                bool exclusive = iconView.getVisibility() == android.view.View.GONE;
                bool bindIcon  = !exclusive || android.text.TextUtils.isEmpty(this.mLabel);

                tv.setText(this.mLabel);
                if (bindIcon && this.mIcon != null)
                {
                    iconView.setImageDrawable(this.mIcon);
                    iconView.setVisibility(android.view.View.VISIBLE);
                }
                if (context.getApplicationInfo().targetSdkVersion <= android.os.Build.VERSION_CODES
                    .DONUT)
                {
                    // Donut apps get old color scheme
                    tabIndicator.setBackgroundResource([email protected]_indicator_v4);
                    tv.setTextColor(context.getResources().getColorStateList([email protected]
                                                                             .tab_indicator_text_v4));
                }
                return(tabIndicator);
            }
Exemplo n.º 2
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();
 }
Exemplo n.º 3
0
 private void init(android.view.View decor)
 {
     mContext    = decor.getContext();
     mActionView = ([email protected])decor.findViewById([email protected]
                                                                              .id.action_bar);
     mContextView = ([email protected])decor.findViewById(
         [email protected]_context_bar);
     mContainerView = ([email protected])decor.findViewById(
         [email protected]_bar_container);
     mSplitView = ([email protected])decor.findViewById([email protected]
                                                                                  .id.split_action_bar);
     if (mActionView == null || mContextView == null || mContainerView == null)
     {
         throw new System.InvalidOperationException(GetType().Name + " can only be used "
                                                    + "with a compatible window decor layout");
     }
     mActionView.setContextView(mContextView);
     mContextDisplayMode = mActionView.isSplitActionBar() ? CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;
     // Older apps get the home button interaction enabled by default.
     // Newer apps need to enable it explicitly.
     setHomeButtonEnabled(mContext.getApplicationInfo().targetSdkVersion < android.os.Build
                          .VERSION_CODES.ICE_CREAM_SANDWICH);
     setHasEmbeddedTabs(mContext.getResources().getBoolean([email protected][email protected]_bar_embed_tabs
                                                           ));
 }
Exemplo n.º 4
0
 private void initTabWidget()
 {
     setChildrenDrawingOrderEnabled(true);
     android.content.Context       context   = mContext;
     android.content.res.Resources resources = context.getResources();
     // Tests the target Sdk version, as set in the Manifest. Could not be set using styles.xml
     // in a values-v? directory which targets the current platform Sdk version instead.
     if (context.getApplicationInfo().targetSdkVersion <= android.os.Build.VERSION_CODES
         .DONUT)
     {
         // Donut apps get old color scheme
         if (mLeftStrip == null)
         {
             mLeftStrip = resources.getDrawable([email protected]_bottom_left_v4
                                                );
         }
         if (mRightStrip == null)
         {
             mRightStrip = resources.getDrawable([email protected]_bottom_right_v4
                                                 );
         }
     }
     else
     {
         // Use modern color scheme for Eclair and beyond
         if (mLeftStrip == null)
         {
             mLeftStrip = resources.getDrawable([email protected]_bottom_left);
         }
         if (mRightStrip == null)
         {
             mRightStrip = resources.getDrawable([email protected]_bottom_right
                                                 );
         }
     }
     // Deal with focus, as we don't want the focus to go by default
     // to a tab other than the current tab
     setFocusable(true);
     setOnFocusChangeListener(this);
 }
Exemplo n.º 5
0
 public virtual android.view.View createIndicatorView()
 {
     android.content.Context     context  = this._enclosing.getContext();
     android.view.LayoutInflater inflater = (android.view.LayoutInflater)context.getSystemService
                                                (android.content.Context.LAYOUT_INFLATER_SERVICE);
     android.view.View tabIndicator = inflater.inflate(this._enclosing.mTabLayoutId, this
                                                       ._enclosing.mTabWidget, false);
     // tab widget is the parent
     // no inflate params
     android.widget.TextView tv = (android.widget.TextView)tabIndicator.findViewById([email protected]
                                                                                     .id.title);
     tv.setText(this.mLabel);
     if (context.getApplicationInfo().targetSdkVersion <= android.os.Build.VERSION_CODES
         .DONUT)
     {
         // Donut apps get old color scheme
         tabIndicator.setBackgroundResource([email protected]_indicator_v4);
         tv.setTextColor(context.getResources().getColorStateList([email protected]
                                                                  .tab_indicator_text_v4));
     }
     return(tabIndicator);
 }
Exemplo n.º 6
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());
        }
Exemplo n.º 7
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;
 }
Exemplo n.º 8
0
 public override android.content.pm.ApplicationInfo getApplicationInfo()
 {
     return(mBase.getApplicationInfo());
 }
Exemplo n.º 9
0
		private void init(android.view.View decor)
		{
			mContext = decor.getContext();
			mActionView = ([email protected])decor.findViewById([email protected]
				.id.action_bar);
			mContextView = ([email protected])decor.findViewById(
				[email protected]_context_bar);
			mContainerView = ([email protected])decor.findViewById(
				[email protected]_bar_container);
			mSplitView = ([email protected])decor.findViewById([email protected]
				.id.split_action_bar);
			if (mActionView == null || mContextView == null || mContainerView == null)
			{
				throw new System.InvalidOperationException(GetType().Name + " can only be used " 
					+ "with a compatible window decor layout");
			}
			mActionView.setContextView(mContextView);
			mContextDisplayMode = mActionView.isSplitActionBar() ? CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;
			// Older apps get the home button interaction enabled by default.
			// Newer apps need to enable it explicitly.
			setHomeButtonEnabled(mContext.getApplicationInfo().targetSdkVersion < android.os.Build
				.VERSION_CODES.ICE_CREAM_SANDWICH);
			setHasEmbeddedTabs(mContext.getResources().getBoolean([email protected][email protected]_bar_embed_tabs
				));
		}
Exemplo n.º 10
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)
 {
 }