Conversation
|
고생하셨습니다 :D |
| android:layout_width="170dp" | ||
| android:layout_height="172dp" |
There was a problem hiding this comment.
wrap과 0dp를 사용해서 container 크기를 조정해주세요!!
| android:layout_width="170dp" | ||
| android:layout_height="172dp" |
| android:layout_width="16dp" | ||
| android:layout_height="16dp" |
|
|
||
| <TextView | ||
| android:id="@+id/tv_home_to_do" |
There was a problem hiding this comment.
현재 fragment_home 에도 tv_home_to_do 라는 id가 사용되고 있습니다.
type_where_what 중 where 쪽을 구분해야 될 것 같습니다
There was a problem hiding this comment.
한가지 궁금한 점이 다른 layout인데 textView id값앞에 where을 다르게 해야하는 이유가 있을까요??
There was a problem hiding this comment.
@murjune 일단 늦어서 죄송합니다.
layout id를 달리하는 이유는 제가 안드로이드 처음 공부할 때 findVIewById 를 사용하다가 다른 레이아웃에 id가 같아서 오류가 생긴 기억 때문에 항상 그렇게 했습니다.
형 말 듣고 생각해보니까, dataBinding, ViewBinding 은 한 레이아웃만 보니까 굳이 달라야 할 이유가 없네요...?
그래서 컨벤션에 where 빼도 될 것 같다는 생각이 드네요..? 제가 컨벤션에 where은 넣을렸던 이유는 where을 넣으면 id 중복을 피할 수 있을 것 같다는 생각했기 때문에 넣었거든요..
다른분들 생각은 어떤가요??
| class ToDoViewHolder( | ||
| private val binding: ItemHomeToDoBinding | ||
| ) : RecyclerView.ViewHolder(binding.root) { | ||
| fun onBind(data: ToDoData) { | ||
| binding.tvHomeToDo.text = data.rules | ||
| } | ||
| } |
There was a problem hiding this comment.
item 쪽엔 data로 variable을 받는다고 선언했지만 사용하지 않았으며,
data class가 한개 일 때 굳이 data class를 만들지 않아도 String을 사용해도 recyclerview 동작이 가능합니다
현재로선 후자의 방식이 나아 보이지만, api가 나오면 data class 중 하나의 값을 바인딩할 것 같으니
전자의 방식으로 수정해주시면 좋을 것 같습니다
|
|
||
| class ToDoAdapter : RecyclerView.Adapter<ToDoAdapter.ToDoViewHolder>() { | ||
| val toDoList = mutableListOf<ToDoData>() |
There was a problem hiding this comment.
adapter는 model 패키지 보다 home 패키지 안에 있는 것이 좋을 것 같습니다
There was a problem hiding this comment.
아 맞아 이거 말해주고 싶었는데 ㅋㅋㅋ
첨언으로 model패키지는 ui패키지가 아니라 data패키지에 넣어주시면 좋을 것 같슴니다!!
MainActivity도 ui.home이 아닌 ui패키지에 넣어주시면 좋을 것 같숩니다 ㅎ ㅅ ㅎ
작업 사진
작업 개요
작업 설명
궁금한점
어려웠던점
android:button="@android:color/transparent"를 넣지 않으면 기존 체크박스가 없어지지 않는다.