Example #1
0
 protected internal override void dispatchDraw(android.graphics.Canvas canvas)
 {
     base.dispatchDraw(canvas);
     // Do nothing if there are no tabs.
     if (getTabCount() == 0)
     {
         return;
     }
     // If the user specified a custom view for the tab indicators, then
     // do not draw the bottom strips.
     if (!mDrawBottomStrips)
     {
         // Skip drawing the bottom strips.
         return;
     }
     android.view.View selectedChild = getChildTabViewAt(mSelectedTab);
     android.graphics.drawable.Drawable leftStrip  = mLeftStrip;
     android.graphics.drawable.Drawable rightStrip = mRightStrip;
     leftStrip.setState(selectedChild.getDrawableState());
     rightStrip.setState(selectedChild.getDrawableState());
     if (mStripMoved)
     {
         android.graphics.Rect bounds = mBounds;
         bounds.left  = selectedChild.getLeft();
         bounds.right = selectedChild.getRight();
         int myHeight = getHeight();
         leftStrip.setBounds(System.Math.Min(0, bounds.left - leftStrip.getIntrinsicWidth(
                                                 )), myHeight - leftStrip.getIntrinsicHeight(), bounds.left, myHeight);
         rightStrip.setBounds(bounds.right, myHeight - rightStrip.getIntrinsicHeight(), System.Math.Max
                                  (getWidth(), bounds.right + rightStrip.getIntrinsicWidth()), myHeight);
         mStripMoved = false;
     }
     leftStrip.draw(canvas);
     rightStrip.draw(canvas);
 }