Second verion (only increase a little bit Compact height)

This commit is contained in:
Philoul 2020-12-25 17:05:41 +01:00
parent 33e13748ca
commit 363fe638af
2 changed files with 2 additions and 6 deletions

View file

@ -225,11 +225,7 @@ 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
val typedValue = TypedValue() toolbar.layoutParams = LinearLayout.LayoutParams(Toolbar.LayoutParams.MATCH_PARENT, resources.getDimension(R.dimen.compact_height).toInt())
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

@ -2,7 +2,7 @@
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="compact_height">30dp</dimen> <dimen name="compact_height">42dp</dimen>
<dimen name="fab_margin">16dp</dimen> <dimen name="fab_margin">16dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen> <dimen name="appbar_padding_top">8dp</dimen>
</resources> </resources>