<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@drawable/action_bar_bg"
        android:elevation="4dp"
        app:navigationIcon="?attr/homeAsUpIndicator" />

    <LinearLayout
        android:id="@+id/llContent"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:paddingEnd="12dp"
            android:paddingStart="12dp"
            android:text="@string/preview" />

        <TextView
            android:id="@+id/tvPreview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:paddingBottom="6dp"
            android:paddingEnd="12dp"
            android:paddingStart="12dp"
            android:paddingTop="6dp"
            android:textSize="20sp"
            tools:text="preview..." />

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:fadeScrollbars="false"
            android:fillViewport="true"
            tools:ignore="NestedWeights">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="12dp">

                <View style="@style/setting_divider" />

                <TextView
                    style="@style/setting_row_label"
                    android:text="@string/acct" />

                <LinearLayout style="@style/setting_row_form">

                    <TextView
                        android:id="@+id/tvAcct"
                        style="@style/setting_horizontal_stretch" />

                </LinearLayout>

                <View style="@style/setting_divider" />

                <TextView
                    style="@style/setting_row_label"
                    android:labelFor="@+id/etNickname"
                    android:text="@string/nickname" />

                <LinearLayout style="@style/setting_row_form">

                    <EditText
                        android:id="@+id/etNickname"
                        style="@style/setting_horizontal_stretch"
                        android:importantForAutofill="no"
                        android:inputType="text"
                        android:maxLines="1" />

                </LinearLayout>

                <View style="@style/setting_divider" />

                <TextView
                    style="@style/setting_row_label"
                    android:text="@string/text_color" />

                <LinearLayout style="@style/setting_row_form">

                    <Button
                        android:id="@+id/btnTextColorEdit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/edit"
                        android:textAllCaps="false" />

                    <Button
                        android:id="@+id/btnTextColorReset"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/reset"
                        android:textAllCaps="false" />

                </LinearLayout>

                <View style="@style/setting_divider" />

                <TextView
                    style="@style/setting_row_label"
                    android:text="@string/background_color" />

                <LinearLayout style="@style/setting_row_form">

                    <Button
                        android:id="@+id/btnBackgroundColorEdit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/edit"
                        android:textAllCaps="false" />

                    <Button
                        android:id="@+id/btnBackgroundColorReset"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/reset"
                        android:textAllCaps="false" />

                </LinearLayout>

                <View style="@style/setting_divider" />

                <LinearLayout
                    android:id="@+id/llNotificationSound"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <TextView
                        style="@style/setting_row_label"
                        android:text="@string/notification_sound" />

                    <LinearLayout style="@style/setting_row_form">

                        <Button
                            android:id="@+id/btnNotificationSoundEdit"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/edit"
                            android:textAllCaps="false" />

                        <Button
                            android:id="@+id/btnNotificationSoundReset"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/reset"
                            android:textAllCaps="false" />

                    </LinearLayout>

                    <View style="@style/setting_divider" />
                </LinearLayout>
            </LinearLayout>
        </ScrollView>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/nickname_applied_after_reload"
            android:textSize="12sp" />

        <LinearLayout
            style="?android:attr/buttonBarStyle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:measureWithLargestChild="true">


            <Button
                android:id="@+id/btnDiscard"
                style="?android:attr/buttonBarButtonStyle"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/discard"
                android:textAllCaps="false" />

            <Button
                android:id="@+id/btnSave"
                style="?android:attr/buttonBarButtonStyle"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/save"
                android:textAllCaps="false" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
