Skip to content

Commit

Permalink
[UI]#6 상단 바 레이아웃 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
nrj022 committed Feb 20, 2024
1 parent 0a78f35 commit 53df799
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 119 deletions.
224 changes: 105 additions & 119 deletions app/src/main/res/layout/fragment_card.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<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.card.CardFragment">
<layout>
<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.card.CardFragment">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
Expand All @@ -13,148 +14,133 @@
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
app:layout_constraintTop_toTopOf="parent"
app:contentInsetStart="0dp">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="@dimen/horizontal_padding">

<ImageView
android:layout_width="@dimen/app_bar_logo_width"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_logo_lavender" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:clickable="true"
android:fontFamily="@font/pretendard_medium"
android:text="@string/card_btn_select"
android:textColor="@color/lavender_500"
android:textSize="18dp"/>
</FrameLayout>
<include
android:id="@+id/include_card_toolbar"
layout="@layout/item_tool_bar"
app:isBackExist="@{true}"
app:isTextBtnExist="@{true}"
app:btnText="@{@string/card_btn_select}"/>
</androidx.appcompat.widget.Toolbar>

<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/toolbar">

<TextView
android:id="@+id/text_dashboard"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"/>

<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/horizontal_padding"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/pretendard_semibold"
android:text="@string/home_tv_word_card"
android:textColor="@color/gray_900"
android:textSize="22sp" />
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/toolbar">

<TextView
android:id="@+id/text_dashboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/pretendard_medium"
android:paddingVertical="10dp"
android:text="@string/home_tv_word_card_description"
android:textColor="@color/gray_700"
android:textSize="16sp" />
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_search_background"
android:paddingHorizontal="@dimen/horizontal_padding"
android:orientation="horizontal">
<EditText
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:backgroundTint="@android:color/transparent"
android:fontFamily="@font/pretendard_semibold"
android:text="@string/home_tv_word_card"
android:textColor="@color/gray_900"
android:textSize="22sp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/pretendard_medium"
android:textColor="@color/gray_500"
android:textSize="18sp"/>
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@null"
android:layout_gravity="left|center_vertical"
android:src="@drawable/ic_search_gray"/>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/activity_vertical_margin">
android:paddingVertical="10dp"
android:text="@string/home_tv_word_card_description"
android:textColor="@color/gray_700"
android:textSize="16sp" />

<LinearLayout
android:id="@+id/btn_card_align"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="?attr/selectableItemBackgroundBorderless"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_updown"/>
<TextView
android:id="@+id/tv_card_align_type"
android:background="@drawable/shape_search_background"
android:paddingHorizontal="@dimen/horizontal_padding"
android:orientation="horizontal">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:backgroundTint="@android:color/transparent"
android:fontFamily="@font/pretendard_medium"
android:text="@string/card_tv_align_alphabetical"
android:textColor="@color/gray_500"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="right"
android:gravity="center_vertical">
android:textSize="18sp"/>
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="14dp"
android:background="@null"
android:src="@drawable/ic_list_align_one"/>
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="14dp"
android:background="@null"
android:src="@drawable/ic_list_align_two"/>
<ImageButton
android:layout_gravity="left|center_vertical"
android:src="@drawable/ic_search_gray"/>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="@dimen/activity_vertical_margin">
<LinearLayout
android:id="@+id/btn_card_align"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="?attr/selectableItemBackgroundBorderless"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_updown"/>
<TextView
android:id="@+id/tv_card_align_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/pretendard_medium"
android:text="@string/card_tv_align_alphabetical"
android:textColor="@color/gray_500"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="right"
android:gravity="center_vertical">
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="14dp"
android:background="@null"
android:src="@drawable/ic_list_align_three"/>
</LinearLayout>
</FrameLayout>
android:src="@drawable/ic_list_align_one"/>
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="14dp"
android:background="@null"
android:src="@drawable/ic_list_align_two"/>
<ImageButton
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="14dp"
android:background="@null"
android:src="@drawable/ic_list_align_three"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
<androidx.compose.ui.platform.ComposeView
android:id="@+id/compose_view_word_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/main_list_bottom_padding" />
</LinearLayout>
<androidx.compose.ui.platform.ComposeView
android:id="@+id/compose_view_word_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/main_list_bottom_padding" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
46 changes: 46 additions & 0 deletions app/src/main/res/layout/item_tool_bar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View"/>
<variable
name="isBackExist"
type="Boolean" />
<variable
name="isTextBtnExist"
type="Boolean" />
<variable
name="btnText"
type="String" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="@dimen/horizontal_padding">

<ImageView
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:visibility="@{isBackExist ? View.VISIBLE : View.GONE}"
android:src="@drawable/ic_arrow_left" />

<ImageView
android:layout_width="@dimen/app_bar_logo_width"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_logo_lavender" />

<TextView
android:id="@+id/btn_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:clickable="true"
android:fontFamily="@font/pretendard_medium"
android:visibility="@{isTextBtnExist ? View.VISIBLE : View.GONE}"
android:text="@{btnText}"
android:textColor="@color/lavender_500"
android:textSize="18dp"/>
</FrameLayout>
</layout>

0 comments on commit 53df799

Please sign in to comment.