In pagerSlidindTabStrip text display incomplete for Moto G 4+ android 7

85 Views Asked by At

In my project I have used PagerSlidingTabStrip library .now in all other device it display proper text in PagerSlidingTabStrip . but in Moto G 4+ it displays incomplete text in PagerSlidingTabStrip. like it display only "Entertain” instead "Entertainment” . what need to change, plz help me. Thanks In advance.

 <com.astuetz.PagerSlidingTabStrip
        android:id="@+id/VideoTabs"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/toolbar_color"
        android:paddingLeft="11dp"
        android:layout_marginRight="0dp"
        android:paddingRight="0dp"
        android:textSize="15sp"
        app:pstsActivateTextColor="@color/white"
        app:pstsDeactivateTextColor="@color/white"
        app:pstsDividerColor="@color/toolbar_color"
        app:pstsIndicatorHeight="0dp"
        app:pstsTabBackground="@color/toolbar_color"
        app:pstsTextAllCaps="false"
        app:pstsUnderlineHeight="0dp"
        android:layout_toLeftOf="@+id/ivNextFragment"/>

In java file

   public void init(View rootview) {
      tabs = (PagerSlidingTabStrip) rootview.findViewById(R.id.VideoTabs);
      mTabsLinearLayout = ((LinearLayout) tabs.getChildAt(0));

      pager = (ViewPager) rootview.findViewById(R.id.viewpager);
     //        tabs.setShouldExpand(true);
     pager.setOffscreenPageLimit(listPublisherName.size());

     setupViewPager(pager);
     tabs.setViewPager(pager);
     tabs.setForegroundGravity(Gravity.CENTER);
     pager.setCurrentItem(0);
     tabs.setTabSwitch(true);

     TextView tv = (TextView) mTabsLinearLayout.getChildAt(pos);
     tv.setTextSize(16);
     tv.setTypeface(null, Typeface.BOLD);
   }

screen is like this right nowenter image description here

2

There are 2 best solutions below

0
Dharmishtha On BEST ANSWER

By doing some changes in code, it will work right now perfect. may be it help some one in future so post here changes.I made changes in xml file as below.

 app:pstsShouldExpand="false"

It will work fine .

1
Ahmed Bel Hadj On

add tabs.setDistributeEvenly(false);