Skip to content

Commit

Permalink
[UI] #15 - Init PrepareActivity Layout
Browse files Browse the repository at this point in the history
  • Loading branch information
onpyeong committed Jun 21, 2022
1 parent 18ab492 commit 4547ba4
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 0 deletions.
88 changes: 88 additions & 0 deletions features/prepare/src/main/res/layout/activity_prepare.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

<data>

</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.mascota.prepare.ui.view.PrepareActivity">

<TextView
android:id="@+id/tv_prepare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="24dp"
android:text="@string/prepare"
android:textAppearance="@style/h1_medium"
android:textColor="@color/maco_dark_orange"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageButton
android:id="@+id/ib_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="20dp"
android:background="@drawable/ic_home"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<org.mascota.prepare.ui.view.custom.QuestionView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="29dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="38dp"
app:layout_constraintBottom_toTopOf="@id/cl_skip"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_prepare" />

<!-- TODO: marginBottom -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginBottom="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">

<TextView
android:id="@+id/tv_skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="19dp"
android:layout_marginTop="13dp"
android:text="@string/skip"
android:textAppearance="@style/sub3"
android:textColor="@color/maco_orange"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageButton
android:id="@+id/ib_skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginTop="11dp"
android:layout_marginEnd="6dp"
android:layout_marginBottom="9dp"
android:background="@drawable/ic_arrow"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_skip"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
122 changes: 122 additions & 0 deletions features/prepare/src/main/res/layout/item_prepare.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

<data>

<import type="android.view.View" />

<variable
name="isWrite"
type="Boolean" />

<variable
name="isTopLineInvisible"
type="Boolean" />

<variable
name="isBottomLineInvisible"
type="Boolean" />

</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_question"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:background="@{isWrite? @drawable/rectangle_fill_light_ivory_radius_8 : @drawable/selector_prepare_question}"
android:paddingBottom="13dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_number"
app:layout_constraintTop_toTopOf="parent">

<!--TODO: FONT Ar-->
<TextView
android:id="@+id/tv_question_mark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:text="@string/question_mark"
android:textColor="@color/maco_dark_gray2"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/question_mark" />

<TextView
android:id="@+id/tv_question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/body2"
android:textColor="@color/maco_dark_gray2"
app:layout_constraintBottom_toBottomOf="@id/tv_question_mark"
app:layout_constraintStart_toEndOf="@id/tv_question_mark"
tools:text="@string/question" />

<!--TODO: margin이 이상해요..-->
<TextView
android:id="@+id/tv_question_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="12dp"
android:background="@{isWrite? @drawable/rectangle_fill_light_ivory_radius_8 : @drawable/selector_prepare_question_description}"
android:paddingStart="8dp"
android:paddingTop="2dp"
android:paddingBottom="4dp"
android:text="@{isWrite? @string/answer_read : @string/answer_write}"
android:textAppearance="@style/sub2"
android:textColor="@{isWrite? @color/maco_gray : @color/maco_light_gray4}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_question" />

</androidx.constraintlayout.widget.ConstraintLayout>

<!--TODO Font : Roboto medium // margin-->
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/oval_fill_dark_gray3"
android:paddingHorizontal="7dp"
android:paddingVertical="3dp"
android:textColor="@color/maco_white"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@id/cl_question"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/cl_question"
tools:text="@string/number_1" />

<View
android:id="@+id/line_top"
android:layout_width="1dp"
android:layout_height="0dp"
android:background="@color/maco_gray"
android:visibility="@{isTopLineInvisible? View.INVISIBLE : View.VISIBLE}"
app:layout_constraintBottom_toTopOf="@id/tv_number"
app:layout_constraintEnd_toEndOf="@id/tv_number"
app:layout_constraintStart_toStartOf="@id/tv_number"
app:layout_constraintTop_toTopOf="@id/cl_question" />

<View
android:id="@+id/line_bottom"
android:layout_width="1dp"
android:layout_height="0dp"
android:background="@color/maco_gray"
android:visibility="@{isBottomLineInvisible? View.INVISIBLE : View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/tv_number"
app:layout_constraintStart_toStartOf="@id/tv_number"
app:layout_constraintTop_toBottomOf="@id/tv_number" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

0 comments on commit 4547ba4

Please sign in to comment.