Adds functional dashboard based on recycler view that picks the number of columns based on screen width.

This commit is contained in:
Tom Hicks
2021-07-05 00:01:37 -07:00
parent ea13e38402
commit 1a487f950d
5 changed files with 290 additions and 518 deletions

View File

@@ -1,145 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<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"
tools:context=".ui.dashboard.DashboardFragment">
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:orientation="vertical">
<GridLayout
android:id="@+id/monsterCards"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2">
<!-- <include-->
<!-- layout="@layout/card_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/card_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/card_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/card_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
</GridLayout>
<GridLayout
android:id="@+id/monsterShortCards"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2">
<!-- <include-->
<!-- layout="@layout/card_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/card_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/card_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/card_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
</GridLayout>
<GridLayout
android:id="@+id/monsterTiles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2">
<!-- <include-->
<!-- layout="@layout/tile_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/tile_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp" />-->
<!-- <include-->
<!-- layout="@layout/tile_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp"/>-->
<!-- <include-->
<!-- layout="@layout/tile_monster"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp" />-->
</GridLayout>
<GridLayout
android:id="@+id/monsterShortTiles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2">
<!-- <include-->
<!-- layout="@layout/tile_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp" />-->
<!-- <include-->
<!-- layout="@layout/tile_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp" />-->
<!-- <include-->
<!-- layout="@layout/tile_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp" />-->
<!-- <include-->
<!-- layout="@layout/tile_monster_short"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_columnWeight="1"-->
<!-- android:layout_marginVertical="8dp" />-->
</GridLayout>
</LinearLayout>
</ScrollView>
android:layout_height="match_parent"
android:divider="?android:attr/dividerVertical"
android:dividerPadding="@dimen/text_margin"
app:layoutManager="LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/card_monster" />
</androidx.constraintlayout.widget.ConstraintLayout>