From 42532e17352da8b71a634d6a83fc62f14229066a Mon Sep 17 00:00:00 2001 From: Hyunji <24hyunji@naver.com> Date: Thu, 17 Feb 2022 21:58:46 +0900 Subject: [PATCH] =?UTF-8?q?[feature/#65]=20NEW=20PHOTOS=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=ED=95=B4=EA=B2=B0=EC=8B=9C?= =?UTF-8?q?=EB=8F=84(=EC=88=98=EC=A0=95=20=ED=95=84=EC=9A=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/home/NewPhotosAdapter.kt | 30 ++++++----- .../fillin/presentation/my/MyPageActivity.kt | 1 + app/src/main/res/drawable/ic_btn_more.xml | 13 +++++ app/src/main/res/layout/item_next_button.xml | 51 +++++++++++-------- 4 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 app/src/main/res/drawable/ic_btn_more.xml diff --git a/app/src/main/java/com/teamfillin/fillin/presentation/home/NewPhotosAdapter.kt b/app/src/main/java/com/teamfillin/fillin/presentation/home/NewPhotosAdapter.kt index 9cb9401..6852f6b 100644 --- a/app/src/main/java/com/teamfillin/fillin/presentation/home/NewPhotosAdapter.kt +++ b/app/src/main/java/com/teamfillin/fillin/presentation/home/NewPhotosAdapter.kt @@ -1,6 +1,7 @@ package com.teamfillin.fillin.presentation.home import android.content.Intent +import android.util.Log import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView @@ -25,7 +26,7 @@ class NewPhotosAdapter( } } - override fun getItemCount(): Int = photolist.size + 1 + override fun getItemCount(): Int = photolist.size override fun onCreateViewHolder( parent: ViewGroup, viewType: Int @@ -52,7 +53,6 @@ class NewPhotosAdapter( override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { when (position < photolist.size) { true -> { - Timber.d("Data ${photolist[position]}") (holder as NewPhotosViewHolder).bind(photolist[position]) } else -> { @@ -61,16 +61,6 @@ class NewPhotosAdapter( } } - fun replaceList(newList: List) { - photolist = newList.toList() - notifyDataSetChanged() - } - - fun interface ItemClickListener { - fun onClick(data: ResponseNewPhotoInfo.Photo) - } - - class NewPhotosViewHolder( private val binding: ItemNewPhotosListBinding, private val listener: ItemClickListener @@ -88,11 +78,23 @@ class NewPhotosAdapter( class NextButtonViewHolder(private val binding: ItemNextButtonBinding) : RecyclerView.ViewHolder(binding.root) { - fun bind() { - binding.root.setOnSingleClickListener { + fun bind() { //binding.ivNextButton? 안됨 + binding.ivNextButton.setOnSingleClickListener { val intent = Intent(itemView.context, FilmRollActivity::class.java) itemView.context.startActivity(intent) } } } + + fun replaceList(newList: List) { + photolist = newList.toList() + notifyDataSetChanged() + } + + fun interface ItemClickListener { + fun onClick(data: ResponseNewPhotoInfo.Photo) + } + + + } \ No newline at end of file diff --git a/app/src/main/java/com/teamfillin/fillin/presentation/my/MyPageActivity.kt b/app/src/main/java/com/teamfillin/fillin/presentation/my/MyPageActivity.kt index ddb404d..771bf6e 100644 --- a/app/src/main/java/com/teamfillin/fillin/presentation/my/MyPageActivity.kt +++ b/app/src/main/java/com/teamfillin/fillin/presentation/my/MyPageActivity.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.os.Bundle import androidx.lifecycle.lifecycleScope import com.bumptech.glide.Glide +import com.bumptech.glide.load.engine.DiskCacheStrategy import com.google.android.gms.oss.licenses.OssLicensesMenuActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.kakao.sdk.user.UserApiClient diff --git a/app/src/main/res/drawable/ic_btn_more.xml b/app/src/main/res/drawable/ic_btn_more.xml new file mode 100644 index 0000000..fbcaef2 --- /dev/null +++ b/app/src/main/res/drawable/ic_btn_more.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/layout/item_next_button.xml b/app/src/main/res/layout/item_next_button.xml index b75618d..af8b65b 100644 --- a/app/src/main/res/layout/item_next_button.xml +++ b/app/src/main/res/layout/item_next_button.xml @@ -1,29 +1,40 @@ - - + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + android:src="@drawable/ic_btn_more" + android:padding="12dp" + android:background="@android:color/transparent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file