Fixed tab page icons for some Android versions

pull/199/head
M66B 3 years ago
parent 4eee5f9e72
commit 21f7b95f4f

@ -495,6 +495,7 @@ public class FragmentOptions extends FragmentBase {
}
private CharSequence getTitle(int titleid, int iconid, int position) {
String title = getString(titleid).toUpperCase();
Drawable icon = getResources().getDrawable(iconid);
int iconSize = getResources().getDimensionPixelSize(R.dimen.menu_item_icon_size);
@ -507,7 +508,7 @@ public class FragmentOptions extends FragmentBase {
ImageSpan imageSpan = new ImageSpan(icon, DynamicDrawableSpan.ALIGN_BOTTOM);
SpannableStringBuilder ssb = new SpannableStringBuilder(getString(titleid));
SpannableStringBuilder ssb = new SpannableStringBuilder(title);
if (position > 0)
ssb.setSpan(new RelativeSizeSpan(0.85f), 0, ssb.length(), 0);
ssb.insert(0, "\uFFFC\u2002"); // object replacement character, en space

@ -15,6 +15,7 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
style="@style/tabLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="scrollable" />

@ -492,6 +492,14 @@
<item name="android:fadeScrollbars">false</item>
</style>
<style name="tabLayoutStyle" parent="Widget.Design.TabLayout">
<item name="tabTextAppearance">@style/tabLayoutStyleTextAppearance</item>
</style>
<style name="tabLayoutStyleTextAppearance" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
</style>
<style name="fullScreenDialog" parent="android:Theme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>

Loading…
Cancel
Save