make icon fixed at the top when the number is too small

This commit is contained in:
stom79 2018-12-10 16:26:33 +01:00
parent 71a83ea35d
commit d48c627c3b
2 changed files with 9 additions and 0 deletions

View File

@ -725,6 +725,11 @@ public abstract class BaseMainActivity extends BaseActivity
tabPosition.put("art",i);
}
if( i > 3 && !Helper.isTablet(getApplicationContext())){
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
}else{
tabLayout.setTabMode(TabLayout.MODE_FIXED);
}
//Display filter for notification when long pressing the tab
final LinearLayout tabStrip = (LinearLayout) tabLayout.getChildAt(0);
tabStrip.getChildAt(1).setOnLongClickListener(new View.OnLongClickListener() {

View File

@ -3005,4 +3005,8 @@ public class Helper {
}
return false;
}
public static boolean isTablet(Context context){
return context.getResources().getBoolean(R.bool.isTablet);
}
}