This commit is contained in:
Tommaso Berlose 2021-05-11 20:56:21 +02:00
parent 61fc0da8d0
commit 2578566659
3 changed files with 11 additions and 10 deletions

View File

@ -180,14 +180,15 @@ class TypographyFragment : Fragment() {
} }
binding.actionSecondTextSize.setOnClickListener { binding.actionSecondTextSize.setOnClickListener {
val dialog = BottomSheetMenu<Float>(requireContext(), header = getString(R.string.title_second_text_size)).setSelectedValue( BottomSheetPicker(
Preferences.textSecondSize) requireContext(),
(40 downTo 10).forEach { items = (40 downTo 10).map { BottomSheetPicker.MenuItem("${it}sp", it.toFloat()) },
dialog.addItem("${it}sp", it.toFloat()) getSelected = { Preferences.textSecondSize },
header = getString(R.string.title_second_text_size),
onItemSelected = {value ->
if (value != null) Preferences.textSecondSize = value
} }
dialog.addOnSelectItemListener { value -> ).show()
Preferences.textSecondSize = value
}.show()
} }
binding.actionFontColor.setOnClickListener { binding.actionFontColor.setOnClickListener {

View File

@ -12,6 +12,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center_vertical|start"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
android:id="@+id/main_layout" android:id="@+id/main_layout"

View File

@ -12,10 +12,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center_vertical|end"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:id="@+id/main_layout" android:id="@+id/main_layout"
android:animateLayoutChanges="true"> android:animateLayoutChanges="true">
<LinearLayout <LinearLayout