Skip to content

Commit

Permalink
enh: Create separate landscape layouts for pin view and creation
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Sep 26, 2023
1 parent 9f69703 commit 18704f1
Show file tree
Hide file tree
Showing 3 changed files with 467 additions and 1 deletion.
282 changes: 282 additions & 0 deletions app/src/main/res/layout-land/fragment_pin_creator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright (c) 2023 Cyb3rKo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<androidx.constraintlayout.widget.ConstraintLayout
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">

<ScrollView
android:id="@+id/sideLeft"
android:layout_width="0dp"
android:layout_height="match_parent"
app:layout_constraintEnd_toStartOf="@id/sideRight"
app:layout_constraintStart_toStartOf="parent"
tools:context=".fragments.PinCreatorFragment">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="32dp"
android:paddingStart="32dp">

<include
layout="@layout/table_coordinates_hori"
android:id="@+id/coordinates_row1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="21dp"
android:layout_marginStart="21dp"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />

<include
layout="@layout/table_coordinates_vert"
android:id="@+id/coordinates_col1"
android:layout_width="@dimen/table_coordinate_size"
android:layout_height="0dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/table_view"
app:layout_constraintTop_toBottomOf="@id/coordinates_row1"
tools:visibility="visible" />

<com.cyb3rko.pincredible.views.PinTableView
android:id="@+id/table_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@id/coordinates_col2"
app:layout_constraintStart_toEndOf="@id/coordinates_col1"
app:layout_constraintTop_toBottomOf="@id/coordinates_row1" />

<include
layout="@layout/table_coordinates_vert"
android:id="@+id/coordinates_col2"
android:layout_width="@dimen/table_coordinate_size"
android:layout_height="0dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/table_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/table_view"
tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>

<ScrollView
android:id="@+id/sideRight"
android:layout_width="0dp"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/sideLeft">

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

<Button
android:id="@+id/button_generate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="12dp"
android:layout_marginTop="4dp"
android:text="@string/generate_new_pattern"
android:textSize="16sp" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/button_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:visibility="gone"
tools:visibility="visible">

<Button
android:id="@+id/button_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@id/button_2"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@id/button_3"
app:layout_constraintStart_toEndOf="@id/button_1"
app:layout_constraintTop_toTopOf="@id/button_1"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/button_2"
app:layout_constraintTop_toTopOf="@id/button_1"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@id/button_5"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_1"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@id/button_6"
app:layout_constraintStart_toEndOf="@id/button_4"
app:layout_constraintTop_toTopOf="@id/button_4"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/button_5"
app:layout_constraintTop_toTopOf="@id/button_4"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@id/button_8"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_4"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@id/button_9"
app:layout_constraintStart_toEndOf="@id/button_7"
app:layout_constraintTop_toTopOf="@id/button_7"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/button_8"
app:layout_constraintTop_toTopOf="@id/button_7"
tools:ignore="HardcodedText" />

<Button
android:id="@+id/button_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_8"
tools:ignore="HardcodedText" />

</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">

<Button
style="@style/Widget.Material3.Button.TonalButton"
android:id="@+id/button_fill"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Fill"
android:textSize="16sp"
tools:ignore="HardcodedText" />

<Button
style="@style/Widget.Material3.Button.TonalButton"
android:id="@+id/button_clear"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:text="Clear"
android:textSize="16sp"
tools:ignore="HardcodedText" />

</LinearLayout>

<Space
android:layout_width="0dp"
android:layout_height="80dp" />

</LinearLayout>

</ScrollView>

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
style="@style/Widget.Material3.ExtendedFloatingActionButton.Icon.Primary"
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
android:text="@string/save_pin"
android:visibility="gone"
app:icon="@android:drawable/ic_menu_save"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit 18704f1

Please sign in to comment.