From 3a0126f17fe439c3115d8a1ed163a45f91f6f4db Mon Sep 17 00:00:00 2001
From: Taras Smakula <tarassmakula@gmail.com>
Date: Tue, 5 Mar 2024 13:18:36 +0200
Subject: [PATCH] Add scroll to create room

---
 .../layout/dialog_fragment_create_room.xml    | 353 +++++++++---------
 1 file changed, 180 insertions(+), 173 deletions(-)

diff --git a/core/src/main/res/layout/dialog_fragment_create_room.xml b/core/src/main/res/layout/dialog_fragment_create_room.xml
index f2b03c373..94b1b9cc9 100644
--- a/core/src/main/res/layout/dialog_fragment_create_room.xml
+++ b/core/src/main/res/layout/dialog_fragment_create_room.xml
@@ -1,215 +1,222 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView 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:fillViewport="true"
     android:orientation="vertical">
 
-
-    <com.google.android.material.appbar.MaterialToolbar
-        android:id="@+id/toolbar"
-        android:layout_width="match_parent"
-        android:layout_height="?attr/actionBarSize"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        app:navigationIcon="?attr/homeAsUpIndicator"
-        app:titleCentered="true"
-        app:titleMarginEnd="72dp">
-
-        <org.futo.circles.core.view.LoadingButton
-            android:id="@+id/btnCreate"
-            android:layout_width="56dp"
-            android:layout_height="match_parent"
-            android:layout_gravity="end"
-            android:layout_marginVertical="8dp"
-            android:layout_marginEnd="8dp"
-            android:enabled="false"
-            android:text="@string/create"
-            android:textSize="13sp"
-            app:textPadding="1dp" />
-
-    </com.google.android.material.appbar.MaterialToolbar>
-
-
-    <View
-        android:id="@+id/toolbarDivider"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/divider_height"
-        android:background="@color/divider_color"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/toolbar" />
-
-
-    <com.google.android.material.imageview.ShapeableImageView
-        android:id="@+id/ivCover"
-        android:layout_width="@dimen/group_icon_size"
-        android:layout_height="@dimen/group_icon_size"
-        android:layout_gravity="center_horizontal"
-        android:layout_marginTop="16dp"
-        android:clickable="true"
-        android:focusable="true"
-        android:scaleType="centerCrop"
-        android:src="@drawable/add_image_placeholder"
-        app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.GroupIconRadius" />
-
-
-    <TextView
-        android:id="@+id/tvNameHeader"
-        style="@style/headline"
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="16dp"
-        tools:text="Room name" />
+        android:orientation="vertical">
 
-    <com.google.android.material.textfield.TextInputLayout
-        android:id="@+id/tilName"
-        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="8dp"
-        app:hintEnabled="false">
 
-        <com.google.android.material.textfield.TextInputEditText
-            android:id="@+id/etName"
+        <com.google.android.material.appbar.MaterialToolbar
+            android:id="@+id/toolbar"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:imeOptions="actionNext"
-            android:inputType="textCapSentences"
-            android:maxLines="1"
-            android:padding="12dp" />
-
-    </com.google.android.material.textfield.TextInputLayout>
+            android:layout_height="?attr/actionBarSize"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:navigationIcon="?attr/homeAsUpIndicator"
+            app:titleCentered="true"
+            app:titleMarginEnd="72dp">
+
+            <org.futo.circles.core.view.LoadingButton
+                android:id="@+id/btnCreate"
+                android:layout_width="56dp"
+                android:layout_height="match_parent"
+                android:layout_gravity="end"
+                android:layout_marginVertical="8dp"
+                android:layout_marginEnd="8dp"
+                android:enabled="false"
+                android:text="@string/create"
+                android:textSize="13sp"
+                app:textPadding="1dp" />
+
+        </com.google.android.material.appbar.MaterialToolbar>
+
+
+        <View
+            android:id="@+id/toolbarDivider"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/divider_height"
+            android:background="@color/divider_color"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/toolbar" />
+
+
+        <com.google.android.material.imageview.ShapeableImageView
+            android:id="@+id/ivCover"
+            android:layout_width="@dimen/group_icon_size"
+            android:layout_height="@dimen/group_icon_size"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="16dp"
+            android:clickable="true"
+            android:focusable="true"
+            android:scaleType="centerCrop"
+            android:src="@drawable/add_image_placeholder"
+            app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.GroupIconRadius" />
 
-    <TextView
-        android:id="@+id/tvTopicHeader"
-        style="@style/headline"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="16dp"
-        android:text="@string/group_topic_optional" />
 
-    <com.google.android.material.textfield.TextInputLayout
-        android:id="@+id/tilTopic"
-        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="8dp"
-        app:hintEnabled="false">
-
-        <com.google.android.material.textfield.TextInputEditText
-            android:id="@+id/etTopic"
+        <TextView
+            android:id="@+id/tvNameHeader"
+            style="@style/headline"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:imeOptions="actionDone"
-            android:inputType="text"
-            android:maxLines="1"
-            android:padding="12dp" />
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="16dp"
+            tools:text="Room name" />
 
-    </com.google.android.material.textfield.TextInputLayout>
+        <com.google.android.material.textfield.TextInputLayout
+            android:id="@+id/tilName"
+            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="8dp"
+            app:hintEnabled="false">
 
+            <com.google.android.material.textfield.TextInputEditText
+                android:id="@+id/etName"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:imeOptions="actionNext"
+                android:inputType="textCapSentences"
+                android:maxLines="1"
+                android:padding="12dp" />
 
-    <TextView
-        android:id="@+id/tvTypeHeader"
-        style="@style/headline"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="16dp"
-        android:text="@string/circle_type" />
+        </com.google.android.material.textfield.TextInputLayout>
 
-    <RadioGroup
-        android:id="@+id/circleTypeGroup"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="8dp"
-        android:orientation="horizontal"
-        app:layout_constraintEnd_toEndOf="@id/guidelineEnd"
-        app:layout_constraintStart_toStartOf="@id/guidelineStart"
-        app:layout_constraintTop_toBottomOf="@id/tvTypeHeader">
-
-        <com.google.android.material.radiobutton.MaterialRadioButton
-            android:id="@+id/btnPublic"
+        <TextView
+            android:id="@+id/tvTopicHeader"
+            style="@style/headline"
             android:layout_width="match_parent"
-            android:layout_weight="0.5"
-            android:paddingVertical="12dp"
-            android:text="@string/public_type"
-            android:textAppearance="@style/body" />
-
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="16dp"
+            android:text="@string/group_topic_optional" />
 
-        <com.google.android.material.radiobutton.MaterialRadioButton
-            android:id="@+id/btnPrivate"
+        <com.google.android.material.textfield.TextInputLayout
+            android:id="@+id/tilTopic"
+            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
             android:layout_width="match_parent"
-            android:layout_weight="0.5"
-            android:checked="true"
-            android:paddingVertical="12dp"
-            android:text="@string/private_type"
-            android:textAppearance="@style/body" />
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="8dp"
+            app:hintEnabled="false">
 
-    </RadioGroup>
+            <com.google.android.material.textfield.TextInputEditText
+                android:id="@+id/etTopic"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:imeOptions="actionDone"
+                android:inputType="text"
+                android:maxLines="1"
+                android:padding="12dp" />
+
+        </com.google.android.material.textfield.TextInputLayout>
 
-    <LinearLayout
-        android:id="@+id/lCircleTypeExplanation"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:orientation="horizontal">
 
         <TextView
-            android:id="@+id/tvPublicHint"
+            android:id="@+id/tvTypeHeader"
+            style="@style/headline"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_weight="0.5"
-            android:text="@string/public_circle_explanation" />
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="16dp"
+            android:text="@string/circle_type" />
 
-        <TextView
-            android:id="@+id/tvPrivateHint"
+        <RadioGroup
+            android:id="@+id/circleTypeGroup"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="8dp"
+            android:orientation="horizontal"
+            app:layout_constraintEnd_toEndOf="@id/guidelineEnd"
+            app:layout_constraintStart_toStartOf="@id/guidelineStart"
+            app:layout_constraintTop_toBottomOf="@id/tvTypeHeader">
+
+            <com.google.android.material.radiobutton.MaterialRadioButton
+                android:id="@+id/btnPublic"
+                android:layout_width="match_parent"
+                android:layout_weight="0.5"
+                android:paddingVertical="12dp"
+                android:text="@string/public_type"
+                android:textAppearance="@style/body" />
+
+
+            <com.google.android.material.radiobutton.MaterialRadioButton
+                android:id="@+id/btnPrivate"
+                android:layout_width="match_parent"
+                android:layout_weight="0.5"
+                android:checked="true"
+                android:paddingVertical="12dp"
+                android:text="@string/private_type"
+                android:textAppearance="@style/body" />
+
+        </RadioGroup>
+
+        <LinearLayout
+            android:id="@+id/lCircleTypeExplanation"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_weight="0.5"
-            android:text="@string/private_circle_explanation" />
+            android:layout_marginHorizontal="8dp"
+            android:orientation="horizontal">
 
-    </LinearLayout>
+            <TextView
+                android:id="@+id/tvPublicHint"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="0.5"
+                android:text="@string/public_circle_explanation" />
 
+            <TextView
+                android:id="@+id/tvPrivateHint"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="0.5"
+                android:text="@string/private_circle_explanation" />
 
-    <TextView
-        android:id="@+id/tvRoleHeader"
-        style="@style/headline"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="16dp"
-        android:text="@string/default_user_role" />
+        </LinearLayout>
 
 
-    <Spinner
-        android:id="@+id/spUserRole"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="8dp" />
+        <TextView
+            android:id="@+id/tvRoleHeader"
+            style="@style/headline"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="16dp"
+            android:text="@string/default_user_role" />
 
 
-    <TextView
-        android:id="@+id/tvInviteUsers"
-        style="@style/headline"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginHorizontal="8dp"
-        android:layout_marginTop="16dp"
-        android:text="@string/invite_members" />
+        <Spinner
+            android:id="@+id/spUserRole"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="8dp" />
 
 
-    <FrameLayout
-        android:id="@+id/lContainer"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
+        <TextView
+            android:id="@+id/tvInviteUsers"
+            style="@style/headline"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginHorizontal="8dp"
+            android:layout_marginTop="16dp"
+            android:text="@string/invite_members" />
+
 
-</LinearLayout>
\ No newline at end of file
+        <FrameLayout
+            android:id="@+id/lContainer"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+    </LinearLayout>
+</ScrollView>
\ No newline at end of file
-- 
GitLab