Skip to content

Commit

Permalink
feat : searchFragment 뷰 #7
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonHwan-Kim committed May 10, 2023
1 parent 67a65ec commit 1c3f24c
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 7 deletions.
45 changes: 38 additions & 7 deletions app/src/main/res/layout/fragment_search.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:paddingBottom="56dp"
tools:context=".presentation.main.search.SearchFragment">

<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="검색 뷰" />
<EditText
android:id="@+id/et_search_search_video"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="영상 검색"
android:paddingVertical="20dp"
android:paddingStart="20dp"
android:paddingEnd="50dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</FrameLayout>
<ImageButton
android:id="@+id/ib_search_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="@android:color/transparent"
android:padding="10dp"
android:src="@drawable/ic_search"
app:layout_constraintBottom_toBottomOf="@id/et_search_search_video"
app:layout_constraintEnd_toEndOf="@id/et_search_search_video"
app:layout_constraintTop_toTopOf="@id/et_search_search_video" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_search_list"
android:layout_width="0dp"
android:layout_height="0dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/et_search_search_video"
tools:listitem="@layout/item_search" />

</androidx.constraintlayout.widget.ConstraintLayout>
40 changes: 40 additions & 0 deletions app/src/main/res/layout/item_search.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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="wrap_content">

<ImageView
android:id="@+id/iv_search_item_thumbnail"
android:layout_width="150dp"
android:layout_height="0dp"
android:layout_marginStart="10dp"
app:layout_constraintDimensionRatio="1.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_search_item_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:textSize="15sp"
app:layout_constraintBottom_toTopOf="@id/tv_search_item_author"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_search_item_thumbnail"
app:layout_constraintTop_toTopOf="@id/iv_search_item_thumbnail"
tools:text="AOA 지민·김용만, 돼지꼬리 맛에 정신혼미 ‘극찬세례’" />

<TextView
android:id="@+id/tv_search_item_author"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@id/iv_search_item_thumbnail"
app:layout_constraintStart_toEndOf="@id/iv_search_item_thumbnail"
app:layout_constraintTop_toBottomOf="@id/tv_search_item_title"
tools:text="_sbs" />

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 1c3f24c

Please sign in to comment.