Skip to content

Commit

Permalink
[feature/#65] NEW PHOTOS 버튼 클릭 해결시도(수정 필요)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunji24 committed Feb 17, 2022
1 parent 9239e8b commit 42532e1
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 -> {
Expand All @@ -61,16 +61,6 @@ class NewPhotosAdapter(
}
}

fun replaceList(newList: List<ResponseNewPhotoInfo.Photo>) {
photolist = newList.toList()
notifyDataSetChanged()
}

fun interface ItemClickListener {
fun onClick(data: ResponseNewPhotoInfo.Photo)
}


class NewPhotosViewHolder(
private val binding: ItemNewPhotosListBinding,
private val listener: ItemClickListener
Expand All @@ -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<ResponseNewPhotoInfo.Photo>) {
photolist = newList.toList()
notifyDataSetChanged()
}

fun interface ItemClickListener {
fun onClick(data: ResponseNewPhotoInfo.Photo)
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_btn_more.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="38dp"
android:height="38dp"
android:viewportWidth="38"
android:viewportHeight="38">
<path
android:pathData="M19,19m-19,0a19,19 0,1 1,38 0a19,19 0,1 1,-38 0"
android:fillColor="#DC4F1C"/>
<path
android:pathData="M20.0245,27.9412L27.9412,19.5905L27.9412,18.4095L20.0245,10.0588L18.9049,11.2398L25.4701,18.1649L8.9412,18.1649L8.9412,19.8351L25.4701,19.8351L18.9049,26.7602L20.0245,27.9412Z"
android:fillColor="#010101"
android:fillType="evenOdd"/>
</vector>
51 changes: 31 additions & 20 deletions app/src/main/res/layout/item_next_button.xml
Original file line number Diff line number Diff line change
@@ -1,29 +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"
android:layout_width="100dp"
android:layout_height="100dp">

<ImageView
android:id="@+id/iv_next_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/nextbutton"
android:padding="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageButton
android:id="@+id/btn_next"
android:id="@+id/iv_next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@android:color/transparent"
android:src="@drawable/ic_next"
app:layout_constraintBottom_toBottomOf="@+id/iv_next_button"
app:layout_constraintEnd_toEndOf="@+id/iv_next_button"
app:layout_constraintStart_toStartOf="@+id/iv_next_button"
app:layout_constraintTop_toTopOf="@+id/iv_next_button" />
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"/>

<!-- <ImageView-->
<!-- android:id="@+id/iv_next_button"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- android:background="@drawable/nextbutton"-->
<!-- android:padding="5dp"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->

<!-- <ImageButton-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:backgroundTint="@android:color/transparent"-->
<!-- android:src="@drawable/ic_next"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/iv_next_button"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/iv_next_button"-->
<!-- app:layout_constraintStart_toStartOf="@+id/iv_next_button"-->
<!-- app:layout_constraintTop_toTopOf="@+id/iv_next_button" />-->

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 42532e1

Please sign in to comment.