Finally I found a solution to this. You are using TitlePageIndicator of the view pager indicator in your project. For achieving this effect you need to make few modification to the TitlePageIndicator class.
The idea is to shift the text on the left hand side toward left by an amount equal to half it's size(could be anything) and the text on the right hand side toward right by an amount equal to half it's size(could be anything).
For setting bounds to the texts on the left hand side clipViewOnTheLeft(...) method is used and for setting bounds to the text on the right hand side clipViewOnTheRight(...) method is used. Here you need to make these modifications.
Here is what you need to do:
/**
* Set bounds for the right textView including clip padding.
*
* @param curViewBound
* current bounds.
* @param curViewWidth
* width of the view.
*/
private void clipViewOnTheRight(RectF curViewBound, float curViewWidth, int right) {
curViewBound.right = right - mClipPadding + curViewWidth/2;
curViewBound.left = curViewBound.right - curViewWidth;
}
/**
* Set bounds for the left textView including clip padding.
*
* @param curViewBound
* current bounds.
* @param curViewWidth
* width of the view.
*/
private void clipViewOnTheLeft(RectF curViewBound, float curViewWidth, int left) {
curViewBound.left = left + mClipPadding - curViewWidth/2;
curViewBound.right = mClipPadding + curViewWidth;
}
You need to make these changes to the TitlePageIndicator.java file.