Skip to content

Commit

Permalink
[add] 아이템 리스트 Fragment 및 RV ViewHolder 레이아웃 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
malibinYun committed Jun 19, 2020
1 parent 33ba663 commit ea45069
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/malibin/acnh/wiki/data/dao/MusicDao.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.malibin.acnh.wiki.data.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
Expand All @@ -10,6 +11,7 @@ import com.malibin.acnh.wiki.data.entity.Music
* on 6월 19, 2020
*/

@Dao
interface MusicDao {

@Query("SELECT * FROM music")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.malibin.acnh.wiki.data.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
Expand All @@ -11,6 +12,7 @@ import com.malibin.acnh.wiki.data.entity.Wearable
* on 6월 18, 2020
*/

@Dao
interface WearableDao {

@Query("SELECT itemType FROM wearable GROUP BY itemType")
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_pick_gift.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grayEF"
tools:context=".ui.gift.PickGiftActivity">

<TextView
Expand All @@ -22,8 +23,8 @@
app:layout_constraintTop_toTopOf="parent" />

<FrameLayout
android:layout_width="409dp"
android:layout_height="677dp"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
66 changes: 66 additions & 0 deletions app/src/main/res/layout/fragment_game_items.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?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">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grayEF">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout6"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
android:background="@drawable/circle_rectangle_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<EditText
android:id="@+id/et_search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@android:color/transparent"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_search"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/iv_search"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_launcher_background" />
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_items"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="9dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="9dp"
android:clipToPadding="false"
android:paddingTop="8dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout6"
app:spanCount="3"
tools:listitem="@layout/item_game_item" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
34 changes: 34 additions & 0 deletions app/src/main/res/layout/item_game_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/btn_item"
android:layout_width="match_parent"
android:layout_height="140dp"
android:layout_marginStart="7dp"
android:layout_marginEnd="7dp"
android:layout_marginBottom="15dp"
android:background="@drawable/round_rectangle_white_16dp">

<ImageView
android:id="@+id/iv_item_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_launcher_background" />

<TextView
android:id="@+id/tv_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:breakStrategy="simple"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_item_image" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 28 16:46:52 KST 2020
#Sat Jun 20 00:35:40 KST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

0 comments on commit ea45069

Please sign in to comment.