<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <data>
        <variable name="config" type="io.github.chinosk.gakumas.localify.models.GakumasConfig" />
        <variable
            name="listener"
            type="io.github.chinosk.gakumas.localify.ConfigListener" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="6sp"
            tools:context=".MainActivity">

            <ScrollView
                android:id="@+id/scrollView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <TextView
                        android:id="@+id/textViewTitle"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/gakumas_localify"
                        android:textColor="@color/black"
                        android:textSize="20sp" />

                    <TextView
                        android:id="@+id/textViewResVersion"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textColor="@color/black" />

                    <Space
                        android:layout_width="match_parent"
                        android:layout_height="25sp" />

                    <TableLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:stretchColumns="0">

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/SwitchEnablePlugin"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:checked="@={config.enabled}"
                                android:onCheckedChanged="@{(view, value) -> listener.onEnabledChanged(value)}"
                                android:text="@string/enable_plugin" />
                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/replaceFontSwitch"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:checked="@={config.replaceFont}"
                                android:onCheckedChanged="@{(view, value) -> listener.onReplaceFontChanged(value)}"
                                android:text="@string/replace_font" />
                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/textTestMode"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:checked="@={config.textTest}"
                                android:onCheckedChanged="@{(view, value) -> listener.onTextTestChanged(value)}"
                                android:text="@string/text_hook_test_mode" />
                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/textExport"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:checked="@={config.dumpText}"
                                android:onCheckedChanged="@{(view, value) -> listener.onDumpTextChanged(value)}"
                                android:text="@string/export_text" />
                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/textForceExtract"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:checked="@={config.forceExportResource}"
                                android:onCheckedChanged="@{(view, value) -> listener.onForceExportResourceChanged(value)}"
                                android:text="@string/force_export_resource" />
                        </TableRow>


                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.textfield.TextInputLayout
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:background="@android:color/transparent"
                                android:hint="@string/setFpsTitle"
                                app:boxBackgroundColor="@android:color/transparent">

                                <com.google.android.material.textfield.TextInputEditText
                                    android:id="@+id/editTextTargetFps"
                                    android:layout_width="match_parent"
                                    android:layout_height="48dp"
                                    android:ems="10"
                                    android:inputType="numberSigned"
                                    android:onTextChanged="@{(s, st, b, a) -> listener.onTargetFpsChanged(s, st, b, a)}"
                                    android:paddingStart="0dp"
                                    android:paddingEnd="0dp"
                                    android:paddingBottom="0dp"
                                    android:text="@={`` + config.targetFrameRate}" />

                            </com.google.android.material.textfield.TextInputLayout>

                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/SwitchEnableFreeCameraPlugin"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:checked="@={config.enableFreeCamera}"
                                android:onCheckedChanged="@{(view, value) -> listener.onEnableFreeCameraChanged(value)}"
                                android:text="@string/enable_free_camera" />
                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.switchmaterial.SwitchMaterial
                                android:id="@+id/SwitchUnlockAllLive"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:visibility="@{config.dbgMode ? android.view.View.VISIBLE : android.view.View.GONE}"
                                android:checked="@={config.unlockAllLive}"
                                android:onCheckedChanged="@{(view, value) -> listener.onUnlockAllLiveChanged(value)}"
                                android:text="@string/unlockAllLive" />
                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:background="@drawable/table_row_border">

                            <TableLayout
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:orientation="vertical"
                                android:visibility="@{config.dbgMode ? android.view.View.VISIBLE : android.view.View.GONE}"
                                android:paddingLeft="10sp"
                                android:paddingRight="10sp"
                                android:paddingBottom="10sp"
                                android:stretchColumns="0">

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <com.google.android.material.switchmaterial.SwitchMaterial
                                        android:id="@+id/SwitchLiveUseCustomeDress"
                                        android:layout_width="match_parent"
                                        android:layout_height="48dp"
                                        android:checked="@={config.enableLiveCustomeDress}"
                                        android:onCheckedChanged="@{(view, value) -> listener.onLiveCustomeDressChanged(value)}"
                                        android:text="@string/liveUseCustomeDress" />
                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <com.google.android.material.textfield.TextInputLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="48dp"
                                        android:background="@android:color/transparent"
                                        android:hint="@string/live_costume_head_id"
                                        app:boxBackgroundColor="@android:color/transparent">

                                        <com.google.android.material.textfield.TextInputEditText
                                            android:id="@+id/editTextLiveCustomeCharaId"
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:ems="10"
                                            android:onTextChanged="@{(s, st, b, a) -> listener.onLiveCustomeHeadIdChanged(s, st, b, a)}"
                                            android:paddingStart="0dp"
                                            android:paddingEnd="0dp"
                                            android:paddingBottom="0dp"
                                            android:text="@={config.liveCustomeHeadId}" />

                                    </com.google.android.material.textfield.TextInputLayout>
                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <com.google.android.material.textfield.TextInputLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="48dp"
                                        android:background="@android:color/transparent"
                                        android:hint="@string/live_custome_dress_id"
                                        app:boxBackgroundColor="@android:color/transparent">

                                        <com.google.android.material.textfield.TextInputEditText
                                            android:id="@+id/editTextLiveCustomeCostumeId"
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:ems="10"
                                            android:onTextChanged="@{(s, st, b, a) -> listener.onLiveCustomeCostumeIdChanged(s, st, b, a)}"
                                            android:paddingStart="0dp"
                                            android:paddingEnd="0dp"
                                            android:paddingBottom="0dp"
                                            android:text="@={config.liveCustomeCostumeId}" />
                                    </com.google.android.material.textfield.TextInputLayout>
                                </TableRow>
                            </TableLayout>

                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"
                            android:layout_marginTop="4sp"
                            android:background="@drawable/table_row_border">

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:orientation="vertical"
                                android:paddingLeft="10sp"
                                android:paddingRight="10sp"
                                android:paddingTop="10sp">

                                <com.google.android.material.textview.MaterialTextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="@string/orientation_lock"
                                    android:textColor="#000000"/>

                                <RadioGroup
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:orientation="horizontal"
                                    android:weightSum="3"
                                    android:onCheckedChanged="@{(group, checkedId) -> listener.onGameOrientationChanged(checkedId)}">

                                    <com.google.android.material.radiobutton.MaterialRadioButton
                                        android:id="@+id/radioButtonGameDefault"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_weight="1"
                                        android:checked="@{config.gameOrientation == 0}"
                                        android:text="@string/orientation_orig" />

                                    <com.google.android.material.radiobutton.MaterialRadioButton
                                        android:id="@+id/radioButtonGamePortrait"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_weight="1"
                                        android:checked="@{config.gameOrientation == 1}"
                                        android:text="@string/orientation_portrait" />

                                    <com.google.android.material.radiobutton.MaterialRadioButton
                                        android:id="@+id/radioButtonGameLandscape"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_weight="1"
                                        android:checked="@{config.gameOrientation == 2}"
                                        android:text="@string/orientation_landscape" />

                                </RadioGroup>

                            </LinearLayout>

                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_marginTop="4sp"
                            android:background="@drawable/table_row_border">

                            <TableLayout
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:orientation="vertical"
                                android:paddingLeft="10sp"
                                android:paddingRight="10sp"
                                android:paddingBottom="10sp"
                                android:stretchColumns="0">

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <com.google.android.material.switchmaterial.SwitchMaterial
                                        android:id="@+id/SwitchUseCustomeGraphicSettings"
                                        android:layout_width="match_parent"
                                        android:layout_height="48dp"
                                        android:checked="@={config.useCustomeGraphicSettings}"
                                        android:onCheckedChanged="@{(view, value) -> listener.onUseCustomeGraphicSettingsChanged(value)}"
                                        android:text="@string/useCustomeGraphicSettings" />
                                </TableRow>


                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="match_parent"
                                        android:orientation="horizontal"
                                        app:layout_constraintBottom_toBottomOf="parent"
                                        app:layout_constraintEnd_toEndOf="parent"
                                        app:layout_constraintStart_toStartOf="parent"
                                        app:layout_constraintTop_toTopOf="parent">

                                        <com.google.android.material.button.MaterialButton
                                            android:id="@+id/qualityRecordButton"
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onChangePresetQuality(4)}"
                                            android:text="@string/max_high" />

                                        <com.google.android.material.button.MaterialButton
                                            android:id="@+id/qualityVeryHighButton"
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onChangePresetQuality(3)}"
                                            android:text="@string/very_high" />

                                        <com.google.android.material.button.MaterialButton
                                            android:id="@+id/qualityHighButton"
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onChangePresetQuality(2)}"
                                            android:text="@string/hign" />

                                        <com.google.android.material.button.MaterialButton
                                            android:id="@+id/qualityMidButton"
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onChangePresetQuality(1)}"
                                            android:text="@string/middle" />

                                        <com.google.android.material.button.MaterialButton
                                            android:id="@+id/qualityLowButton"
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onChangePresetQuality(0)}"
                                            android:text="@string/low" />

                                    </LinearLayout>

                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <TableLayout
                                        android:layout_width="wrap_content"
                                        android:layout_height="match_parent"
                                        android:orientation="vertical">

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="2">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:id="@+id/editTextRenderScaleLayout"
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/renderscale"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:id="@+id/editTextRenderScale"
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:hint="0.5/0.59/0.67/0.77/1.0"
                                                    android:inputType="numberDecimal"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onRenderScaleChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.renderScale}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:id="@+id/editTextQualitySettingsLevelLayout"
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="QualityLevel (1/1/2/3/5)"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:id="@+id/editTextQualitySettingsLevel"
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:hint="1/1/2/3/5"
                                                    android:inputType="number"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onQualitySettingsLevelChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.qualitySettingsLevel}" />

                                            </com.google.android.material.textfield.TextInputLayout>


                                        </TableRow>

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="2">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:id="@+id/editTextVolumeIndexLayout"
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="VolumeIndex (0/1/2/3/4)"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:id="@+id/editTextVolumeIndex"
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:hint="0/1/2/3/4"
                                                    android:inputType="number"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onVolumeIndexChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.volumeIndex}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:id="@+id/editTextMaxBufferPixelLayout"
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="MaxBufferPixel (1024/1440/2538/3384/8190)"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:id="@+id/editTextMaxBufferPixel"
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:hint="1024/1440/2538/3384/8190"
                                                    android:inputType="number"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onMaxBufferPixelChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.maxBufferPixel}" />

                                            </com.google.android.material.textfield.TextInputLayout>


                                        </TableRow>

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="2">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:id="@+id/editTextReflectionQualityLevelLayout"
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="ReflectionLevel (0~5)"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:id="@+id/editTextReflectionQualityLevel"
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:hint="0/1/2/3/4/5"
                                                    android:inputType="number"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onReflectionQualityLevelChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.reflectionQualityLevel}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:id="@+id/editTextLodQualityLevelLayout"
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="LOD Level (0~5)"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:id="@+id/editTextLodQualityLevel"
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:hint="0/1/2/3/4/5"
                                                    android:inputType="number"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onLodQualityLevelChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.lodQualityLevel}" />

                                            </com.google.android.material.textfield.TextInputLayout>


                                        </TableRow>

                                    </TableLayout>
                                </TableRow>
                            </TableLayout>

                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_marginTop="4sp"
                            android:background="@drawable/table_row_border">

                            <TableLayout
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:orientation="vertical"
                                android:paddingLeft="10sp"
                                android:paddingRight="10sp"
                                android:paddingBottom="10sp"
                                android:stretchColumns="0">

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent">

                                    <com.google.android.material.switchmaterial.SwitchMaterial
                                        android:id="@+id/SwitchEnableBreastParam"
                                        android:layout_width="match_parent"
                                        android:layout_height="48dp"
                                        android:checked="@={config.enableBreastParam}"
                                        android:onCheckedChanged="@{(view, value) -> listener.onEnableBreastParamChanged(value)}"
                                        android:text="@string/enable_breast_param" />
                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:visibility="@{config.enableBreastParam ? android.view.View.VISIBLE : android.view.View.GONE}">

                                    <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="match_parent"
                                        android:orientation="horizontal"
                                        app:layout_constraintBottom_toBottomOf="parent"
                                        app:layout_constraintEnd_toEndOf="parent"
                                        app:layout_constraintStart_toStartOf="parent"
                                        app:layout_constraintTop_toTopOf="parent">

                                        <com.google.android.material.button.MaterialButton
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onBClickPresetChanged(5)}"
                                            android:text="\??" />

                                        <com.google.android.material.button.MaterialButton
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onBClickPresetChanged(4)}"
                                            android:text="+5" />

                                        <com.google.android.material.button.MaterialButton
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onBClickPresetChanged(3)}"
                                            android:text="+4" />

                                        <com.google.android.material.button.MaterialButton
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_margin="1sp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onBClickPresetChanged(2)}"
                                            android:text="+3" />

                                        <com.google.android.material.button.MaterialButton
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_weight="1"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onBClickPresetChanged(1)}"
                                            android:text="+2" />

                                        <com.google.android.material.button.MaterialButton
                                            android:layout_width="wrap_content"
                                            android:layout_height="48dp"
                                            android:layout_weight="1"
                                            android:layout_marginStart="1sp"
                                            android:minWidth="1sp"
                                            android:onClick="@{() -> listener.onBClickPresetChanged(0)}"
                                            android:text="+1" />

                                    </LinearLayout>

                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:visibility="@{config.enableBreastParam ? android.view.View.VISIBLE : android.view.View.GONE}">

                                    <TableLayout
                                        android:layout_width="wrap_content"
                                        android:layout_height="match_parent"
                                        android:orientation="vertical">

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="2">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/damping"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBDampingChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bDamping}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/stiffness"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBStiffnessChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bStiffness}" />

                                            </com.google.android.material.textfield.TextInputLayout>


                                        </TableRow>

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="2">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/spring"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBSpringChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bSpring}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/pendulum"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBPendulumChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bPendulum}" />

                                            </com.google.android.material.textfield.TextInputLayout>


                                        </TableRow>

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="2">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/pendulumrange"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBPendulumRangeChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bPendulumRange}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/average"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBAverageChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bAverage}" />

                                            </com.google.android.material.textfield.TextInputLayout>

                                        </TableRow>

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:weightSum="1">

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/rootweight"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBRootWeightChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bRootWeight}" />

                                            </com.google.android.material.textfield.TextInputLayout>
                                        </TableRow>

                                    </TableLayout>
                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:visibility="@{config.enableBreastParam ? android.view.View.VISIBLE : android.view.View.GONE}">

                                    <TableLayout
                                        android:layout_width="wrap_content"
                                        android:layout_height="match_parent"
                                        android:orientation="vertical">

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent" >

                                            <com.google.android.material.textfield.TextInputLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="3"
                                                android:background="@android:color/transparent"
                                                android:hint="@string/breast_scale"
                                                app:boxBackgroundColor="@android:color/transparent">

                                                <com.google.android.material.textfield.TextInputEditText
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:ems="10"
                                                    android:inputType="numberDecimal|numberSigned"
                                                    android:onTextChanged="@{(s, st, b, a) -> listener.onBScaleChanged(s, st, b, a)}"
                                                    android:paddingStart="0dp"
                                                    android:paddingEnd="0dp"
                                                    android:paddingBottom="0dp"
                                                    android:text="@={`` + config.bScale}" />

                                            </com.google.android.material.textfield.TextInputLayout>


                                            <com.google.android.material.checkbox.MaterialCheckBox
                                                android:layout_width="match_parent"
                                                android:layout_height="48dp"
                                                android:layout_weight="1"
                                                android:checked="@={config.bUseScale}"
                                                android:onCheckedChanged="@{(view, value) -> listener.onBUseScaleChanged(value)}"
                                                android:text="@string/usescale" />

                                        </TableRow>

                                    </TableLayout>
                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:visibility="@{config.enableBreastParam ? android.view.View.VISIBLE : android.view.View.GONE}">

                                    <com.google.android.material.switchmaterial.SwitchMaterial
                                        android:layout_width="match_parent"
                                        android:layout_height="48dp"
                                        android:layout_weight="1"
                                        android:checked="@={config.bUseArmCorrection}"
                                        android:onCheckedChanged="@{(view, value) -> listener.onBUseArmCorrectionChanged(value)}"
                                        android:text="@string/usearmcorrection" />

                                </TableRow>

                                <TableRow
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:background="@drawable/table_row_border"
                                    android:visibility="@{config.enableBreastParam ? android.view.View.VISIBLE : android.view.View.GONE}">

                                    <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:paddingLeft="10sp"
                                        android:paddingRight="10sp"
                                        android:paddingBottom="10sp"
                                        android:orientation="vertical">

                                        <com.google.android.material.switchmaterial.SwitchMaterial
                                            android:layout_width="match_parent"
                                            android:layout_height="0dp"
                                            android:layout_weight="1"
                                            android:checked="@={config.bUseLimit}"
                                            android:onCheckedChanged="@{(view, value) -> listener.onBUseLimitChanged(value)}"
                                            android:text="@string/uselimitmultiplier" />

                                        <TableRow
                                            android:layout_width="match_parent"
                                            android:layout_height="match_parent"
                                            android:visibility="@{config.bUseLimit ? android.view.View.VISIBLE : android.view.View.GONE}">

                                            <TableLayout
                                                android:layout_width="match_parent"
                                                android:layout_height="match_parent"
                                                android:orientation="vertical">

                                                <TableRow
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:weightSum="3">

                                                    <com.google.android.material.textfield.TextInputLayout
                                                        android:layout_width="match_parent"
                                                        android:layout_height="48dp"
                                                        android:layout_weight="1"
                                                        android:background="@android:color/transparent"
                                                        android:hint="@string/axisx_x"
                                                        app:boxBackgroundColor="@android:color/transparent">

                                                        <com.google.android.material.textfield.TextInputEditText
                                                            android:layout_width="match_parent"
                                                            android:layout_height="match_parent"
                                                            android:ems="10"
                                                            android:inputType="numberDecimal|numberSigned"
                                                            android:onTextChanged="@{(s, st, b, a) -> listener.onBLimitXxChanged(s, st, b, a)}"
                                                            android:paddingStart="0dp"
                                                            android:paddingEnd="0dp"
                                                            android:paddingBottom="0dp"
                                                            android:text="@={`` + config.bLimitXx}" />

                                                    </com.google.android.material.textfield.TextInputLayout>

                                                    <com.google.android.material.textfield.TextInputLayout
                                                        android:layout_width="match_parent"
                                                        android:layout_height="48dp"
                                                        android:layout_weight="1"
                                                        android:background="@android:color/transparent"
                                                        android:hint="@string/axisy_x"
                                                        app:boxBackgroundColor="@android:color/transparent">

                                                        <com.google.android.material.textfield.TextInputEditText
                                                            android:layout_width="match_parent"
                                                            android:layout_height="match_parent"
                                                            android:ems="10"
                                                            android:inputType="numberDecimal|numberSigned"
                                                            android:onTextChanged="@{(s, st, b, a) -> listener.onBLimitYxChanged(s, st, b, a)}"
                                                            android:paddingStart="0dp"
                                                            android:paddingEnd="0dp"
                                                            android:paddingBottom="0dp"
                                                            android:text="@={`` + config.bLimitYx}" />

                                                    </com.google.android.material.textfield.TextInputLayout>

                                                    <com.google.android.material.textfield.TextInputLayout
                                                        android:layout_width="match_parent"
                                                        android:layout_height="48dp"
                                                        android:layout_weight="1"
                                                        android:background="@android:color/transparent"
                                                        android:hint="@string/axisz_x"
                                                        app:boxBackgroundColor="@android:color/transparent">

                                                        <com.google.android.material.textfield.TextInputEditText
                                                            android:layout_width="match_parent"
                                                            android:layout_height="match_parent"
                                                            android:ems="10"
                                                            android:inputType="numberDecimal|numberSigned"
                                                            android:onTextChanged="@{(s, st, b, a) -> listener.onBLimitZxChanged(s, st, b, a)}"
                                                            android:paddingStart="0dp"
                                                            android:paddingEnd="0dp"
                                                            android:paddingBottom="0dp"
                                                            android:text="@={`` + config.bLimitZx}" />

                                                    </com.google.android.material.textfield.TextInputLayout>


                                                </TableRow>

                                                <TableRow
                                                    android:layout_width="match_parent"
                                                    android:layout_height="match_parent"
                                                    android:weightSum="3">

                                                    <com.google.android.material.textfield.TextInputLayout
                                                        android:layout_width="match_parent"
                                                        android:layout_height="48dp"
                                                        android:layout_weight="1"
                                                        android:background="@android:color/transparent"
                                                        android:hint="@string/axisx_y"
                                                        app:boxBackgroundColor="@android:color/transparent">

                                                        <com.google.android.material.textfield.TextInputEditText
                                                            android:layout_width="match_parent"
                                                            android:layout_height="match_parent"
                                                            android:ems="10"
                                                            android:inputType="numberDecimal|numberSigned"
                                                            android:onTextChanged="@{(s, st, b, a) -> listener.onBLimitXyChanged(s, st, b, a)}"
                                                            android:paddingStart="0dp"
                                                            android:paddingEnd="0dp"
                                                            android:paddingBottom="0dp"
                                                            android:text="@={`` + config.bLimitXy}" />

                                                    </com.google.android.material.textfield.TextInputLayout>

                                                    <com.google.android.material.textfield.TextInputLayout
                                                        android:layout_width="match_parent"
                                                        android:layout_height="48dp"
                                                        android:layout_weight="1"
                                                        android:background="@android:color/transparent"
                                                        android:hint="@string/axisy_y"
                                                        app:boxBackgroundColor="@android:color/transparent">

                                                        <com.google.android.material.textfield.TextInputEditText
                                                            android:layout_width="match_parent"
                                                            android:layout_height="match_parent"
                                                            android:ems="10"
                                                            android:inputType="numberDecimal|numberSigned"
                                                            android:onTextChanged="@{(s, st, b, a) -> listener.onBLimitYyChanged(s, st, b, a)}"
                                                            android:paddingStart="0dp"
                                                            android:paddingEnd="0dp"
                                                            android:paddingBottom="0dp"
                                                            android:text="@={`` + config.bLimitYy}" />

                                                    </com.google.android.material.textfield.TextInputLayout>

                                                    <com.google.android.material.textfield.TextInputLayout
                                                        android:layout_width="match_parent"
                                                        android:layout_height="48dp"
                                                        android:layout_weight="1"
                                                        android:background="@android:color/transparent"
                                                        android:hint="@string/axisz_y"
                                                        app:boxBackgroundColor="@android:color/transparent">

                                                        <com.google.android.material.textfield.TextInputEditText
                                                            android:layout_width="match_parent"
                                                            android:layout_height="match_parent"
                                                            android:ems="10"
                                                            android:inputType="numberDecimal|numberSigned"
                                                            android:onTextChanged="@{(s, st, b, a) -> listener.onBLimitZyChanged(s, st, b, a)}"
                                                            android:paddingStart="0dp"
                                                            android:paddingEnd="0dp"
                                                            android:paddingBottom="0dp"
                                                            android:text="@={`` + config.bLimitZy}" />

                                                    </com.google.android.material.textfield.TextInputLayout>


                                                </TableRow>

                                            </TableLayout>
                                        </TableRow>

                                    </LinearLayout>

                                </TableRow>



                            </TableLayout>

                        </TableRow>

                        <TableRow
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <com.google.android.material.button.MaterialButton
                                android:id="@+id/StartGameButton"
                                android:layout_width="match_parent"
                                android:layout_height="48dp"
                                android:onClick="@{() -> listener.onClickStartGame()}"
                                android:text="@string/start_game" />
                        </TableRow>

                    </TableLayout>
                </LinearLayout>

            </ScrollView>
        </androidx.constraintlayout.widget.ConstraintLayout>

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/fabStartGame"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="16dp"
            android:src="@drawable/start_game"
            android:visibility="gone"
            android:onClick="@{() -> listener.onClickStartGame()}"
            android:contentDescription="startGameFab" />

        </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
