make icon fixed at the top when the number is too small
This commit is contained in:
parent
71a83ea35d
commit
d48c627c3b
|
@ -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() {
|
||||
|
|
|
@ -3005,4 +3005,8 @@ public class Helper {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isTablet(Context context){
|
||||
return context.getResources().getBoolean(R.bool.isTablet);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue