mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
修复词典数量过多导致的显示问题 (#5211)
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
update fork / build (push) Has been cancelled
Update Cronet / build (push) Has been cancelled
closeStaleIssue / stale (push) Has been cancelled
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
update fork / build (push) Has been cancelled
Update Cronet / build (push) Has been cancelled
closeStaleIssue / stale (push) Has been cancelled
This commit is contained in:
@@ -73,8 +73,19 @@ class DictDialog() : BaseDialogFragment(R.layout.dialog_dict) {
|
||||
tag = it
|
||||
})
|
||||
}
|
||||
|
||||
setupTabLayoutMode(it.size)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//根据已启用词典数动态选取布局
|
||||
private fun setupTabLayoutMode(dictCount: Int) {
|
||||
if (dictCount <= 4) {
|
||||
binding.tabLayout.tabMode = TabLayout.MODE_FIXED
|
||||
binding.tabLayout.tabGravity = TabLayout.GRAVITY_FILL
|
||||
} else {
|
||||
binding.tabLayout.tabMode = TabLayout.MODE_SCROLLABLE
|
||||
binding.tabLayout.tabGravity = TabLayout.GRAVITY_CENTER
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user