Skip to content

Commit

Permalink
Layout to display the tasks list.
Browse files Browse the repository at this point in the history
  • Loading branch information
maisawr committed Feb 24, 2024
1 parent 77b903c commit b68f877
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 29 deletions.
84 changes: 55 additions & 29 deletions app/src/main/res/layout/fragment_tasks_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,67 @@
android:layout_height="match_parent"
tools:context=".ui.aigenerate.AiGenerateFragment">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tasks_list_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginTop="44dp"
android:text="@string/tasks_list_title"
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/aigenerate_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:textAlignment="center"
android:textSize="50sp"
android:text="@string/ai_generate_title" />
<TableRow
android:id="@+id/table_header"
android:layout_width="301dp"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
app:layout_constraintEnd_toEndOf="@+id/recyclerview_tasks_list"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/recyclerview_tasks_list"
app:layout_constraintTop_toBottomOf="@+id/tasks_list_title">

<TextView
android:id="@+id/ai_generate_topic_title"
android:layout_width="wrap_content"
android:id="@+id/textViewTask"
style="@style/Theme.PA"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@+id/aigenerate_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="@string/ai_generate_topic_title"
android:textSize="30sp" />
android:layout_column="0"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:text="@string/list_header_task"
android:textSize="20sp"
android:textStyle="bold"/>

<EditText
android:id="@+id/ai_generate_topic_input"
android:layout_width="wrap_content"
<TextView
android:id="@+id/textViewDueDate"
style="@style/Theme.PA"
android:layout_width="101dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:layout_below="@+id/ai_generate_topic_title"
android:textAlignment="center"
android:layout_column="1"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/textViewTask"
android:text="@string/list_header_end_date"
android:textSize="20sp"
android:gravity="center"
android:hint="@string/ai_generate_topic_input_hint" />
android:textStyle="bold" />

</TableRow>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview_tasks_list"
android:layout_width="301dp"
android:layout_height="530dp"
android:layout_below="@+id/tasks_list_title"
android:layout_alignParentEnd="true"
android:layout_marginTop="28dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/table_header"
tools:listitem="@layout/text_tasks_list_item" />

</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
33 changes: 33 additions & 0 deletions app/src/main/res/layout/text_tasks_list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TableRow
android:id="@+id/firstRow"
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<TextView
android:id="@+id/textViewTask"
style="@style/Theme.PA"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_centerVertical="true" />

<TextView
android:id="@+id/textViewDueDate"
style="@style/Theme.PA"
android:layout_width="101dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/textViewTask" />

</TableRow>

</LinearLayout>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@
<string name="ai_generate_duration_input_hint">Duration</string>
<string name="ai_generate_response_answer">Awaiting AI response...</string>

<string name="tasks_list_title">Check your next tasks</string>
<string name="list_header_task">Task</string>
<string name="list_header_end_date">Due Date</string>

</resources>

0 comments on commit b68f877

Please sign in to comment.