Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #393 from leveme/master
Browse files Browse the repository at this point in the history
[TabPageIndicator] Set text alignment of CheckedTextView to gravity
  • Loading branch information
rey5137 authored Jun 23, 2018
2 parents 5141f7a + f68ab07 commit 9413f74
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ private void notifyDataSetChanged() {
tv.setCheckMarkDrawable(null);
tv.setText(title);
tv.setGravity(Gravity.CENTER);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
tv.setTextAlignment(CheckedTextView.TEXT_ALIGNMENT_GRAVITY);
}
tv.setTextAppearance(getContext(), mTextAppearance);
if(mTabSingleLine)
tv.setSingleLine(true);
Expand Down Expand Up @@ -526,6 +529,9 @@ else if (i == 2)
tv.setCheckMarkDrawable(null);
tv.setText(title);
tv.setGravity(Gravity.CENTER);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
tv.setTextAlignment(CheckedTextView.TEXT_ALIGNMENT_GRAVITY);
}
tv.setTextAppearance(getContext(), mTextAppearance);
tv.setSingleLine(true);
tv.setEllipsize(TruncateAt.END);
Expand Down

0 comments on commit 9413f74

Please sign in to comment.