Code example for TextView

Methods: setTextColor, getBottom, getTop, layout

0
                leftMin = Math.min(0,
                        center - (nextViewWidth / 2) - mPaddingPush - viewWidth);
            } 
            int leftMax = center - (viewWidth / 2);
            int newLeft = map(positionOffset, 1, 0, leftMin, leftMax);
            view.layout(newLeft, view.getTop(), newLeft + viewWidth, view.getBottom());
            view.setTextColor(Color.rgb(
                    map(positionOffset, 1, 0, mInactiveTextColor.red, mActiveTextColor.red),
                    map(positionOffset, 1, 0, mInactiveTextColor.green, mActiveTextColor.green),
                    map(positionOffset, 1, 0, mInactiveTextColor.blue, mActiveTextColor.blue)));
        } 
 
        // Move the view at position + 1. This will be the label for the 
        // right of the two fragments that may be visible on screen 
        if ((position + 1) < getChildCount()) {
            TextView view = (TextView) getChildAt(position + 1);
            int viewWidth = view.getWidth();
            int prevViewWidth = getChildAt(position).getWidth();
            int leftMin = center - (viewWidth / 2);
            int leftMax = Math.max(width - viewWidth,
                    center + (prevViewWidth / 2) + mPaddingPush);