Increase height of Compact Tab and Profile/TT row

This commit is contained in:
Philoul 2020-12-24 11:06:50 +01:00
parent 8b86489499
commit 554b14e9ef
2 changed files with 11 additions and 7 deletions

View file

@ -225,7 +225,11 @@ class MainActivity : NoSplashAppCompatActivity() {
if (sp.getBoolean(R.string.key_short_tabtitles, false)) { if (sp.getBoolean(R.string.key_short_tabtitles, false)) {
tabs_normal.visibility = View.GONE tabs_normal.visibility = View.GONE
tabs_compact.visibility = View.VISIBLE tabs_compact.visibility = View.VISIBLE
toolbar.layoutParams = LinearLayout.LayoutParams(Toolbar.LayoutParams.MATCH_PARENT, resources.getDimension(R.dimen.compact_height).toInt()) val typedValue = TypedValue()
if (theme.resolveAttribute(R.attr.actionBarSize, typedValue, true)) {
toolbar.layoutParams = LinearLayout.LayoutParams(Toolbar.LayoutParams.MATCH_PARENT,
TypedValue.complexToDimensionPixelSize(typedValue.data, resources.displayMetrics))
}
TabLayoutMediator(tabs_compact, main_pager) { tab, position -> TabLayoutMediator(tabs_compact, main_pager) { tab, position ->
tab.text = (main_pager.adapter as TabPageAdapter).getPluginAt(position).nameShort tab.text = (main_pager.adapter as TabPageAdapter).getPluginAt(position).nameShort
}.attach() }.attach()

View file

@ -19,8 +19,8 @@
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:paddingTop="3dp" android:paddingTop="6dp"
android:paddingBottom="3dp" android:paddingBottom="6dp"
android:text="Profile" android:text="Profile"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
@ -31,8 +31,8 @@
android:layout_gravity="end" android:layout_gravity="end"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:paddingTop="3dp" android:paddingTop="6dp"
android:paddingBottom="3dp" android:paddingBottom="6dp"
android:text="TempTarget" android:text="TempTarget"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/mdtp_white" /> android:textColor="@color/mdtp_white" />
@ -53,8 +53,8 @@
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:paddingTop="3dp" android:paddingTop="6dp"
android:paddingBottom="3dp" android:paddingBottom="6dp"
android:text="@string/initializing" android:text="@string/initializing"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />