-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REFACTOR/#185] OurTodo, MyTodo 뷰 / 코드 리팩토링만 #186
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a97c3c9
[FIX/#185] OurTodo colorOf 설정, when 활용
Marchbreeze c8bd0ec
[FIX/#185] 친구초대 dialog intent 해제
Marchbreeze 6f33bc0
[FIX/#185] initOffsetChangedListener 합치기
Marchbreeze 1d841b8
[FIX/#185] OurTodo 생성뷰 intent 변경
Marchbreeze a779de4
[FIX/#185] nameList 뷰홀더 수정
Marchbreeze a07cfcd
[FIX/#185] nameList 뷰홀더 수정
Marchbreeze e238172
[FIX/#185] MyTodo 전체적인 수정
Marchbreeze d304617
Merge branch 'develop' of https://github.com/Team-Going/Going-Android…
Marchbreeze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package com.going.presentation.todo.mytodo.todolist | ||
|
||
import androidx.core.content.ContextCompat | ||
import androidx.core.view.isVisible | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.going.domain.entity.response.TodoModel | ||
import com.going.presentation.R | ||
import com.going.presentation.databinding.ItemMyTodoBinding | ||
import com.going.presentation.todo.name.TodoNameAdapter | ||
import com.going.ui.extension.colorOf | ||
import com.going.ui.extension.setOnSingleClickListener | ||
|
||
class MyTodoListViewHolder( | ||
|
@@ -20,7 +20,7 @@ class MyTodoListViewHolder( | |
fun onBind(item: TodoModel) { | ||
binding.run { | ||
tvMyTodoItemTitle.text = item.title | ||
tvMyTodoItemDate.text = item.endDate.replace("-", ".") + "까지" | ||
tvMyTodoItemDate.text = item.endDate.replace("-", ".") + "까지" | ||
|
||
layoutMyTodoLock.isVisible = item.secret | ||
rvMyTodoName.isVisible = !item.secret | ||
|
@@ -33,17 +33,17 @@ class MyTodoListViewHolder( | |
} | ||
|
||
if (isCompleted) { | ||
tvMyTodoItemTitle.setTextColor(ContextCompat.getColor(binding.root.context, R.color.gray_300)) | ||
tvMyTodoItemDate.setTextColor(ContextCompat.getColor(binding.root.context, R.color.gray_200)) | ||
tvMyTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.gray_300)) | ||
tvMyTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_200)) | ||
Comment on lines
+36
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 확장함수 야무지다!! |
||
layoutMyTodoLock.setBackgroundResource(R.drawable.shape_rect_2_gray300_line) | ||
ivMyTodoLock.setImageResource(R.drawable.ic_lock_complete) | ||
tvMyTodoLock.setTextColor(ContextCompat.getColor(binding.root.context, R.color.gray_300)) | ||
tvMyTodoLock.setTextColor(binding.root.context.colorOf(R.color.gray_300)) | ||
} else { | ||
tvMyTodoItemTitle.setTextColor(ContextCompat.getColor(binding.root.context, R.color.black_000)) | ||
tvMyTodoItemDate.setTextColor(ContextCompat.getColor(binding.root.context, R.color.gray_300)) | ||
tvMyTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.black_000)) | ||
tvMyTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_300)) | ||
layoutMyTodoLock.setBackgroundResource(R.drawable.shape_rect_2_gray400_line) | ||
ivMyTodoLock.setImageResource(R.drawable.ic_lock_uncomplete) | ||
tvMyTodoLock.setTextColor(ContextCompat.getColor(binding.root.context, R.color.gray_400)) | ||
tvMyTodoLock.setTextColor(binding.root.context.colorOf(R.color.gray_400)) | ||
} | ||
|
||
cbMyTodoUnselected.setOnSingleClickListener { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 18 additions & 17 deletions
35
presentation/src/main/java/com/going/presentation/todo/name/TodoNameViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
package com.going.presentation.todo.name | ||
|
||
import androidx.core.content.ContextCompat | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.going.domain.entity.response.TodoAllocatorModel | ||
import com.going.presentation.R | ||
import com.going.presentation.databinding.ItemTodoNameBinding | ||
import com.going.ui.extension.colorOf | ||
|
||
class TodoNameViewHolder( | ||
val binding: ItemTodoNameBinding, private val isCompleted: Boolean | ||
val binding: ItemTodoNameBinding, | ||
private val isCompleted: Boolean | ||
) : RecyclerView.ViewHolder(binding.root) { | ||
|
||
private val redColor = ContextCompat.getColor(binding.root.context, R.color.red_500) | ||
private val grayColor = ContextCompat.getColor(binding.root.context, R.color.gray_400) | ||
private val completedColor = ContextCompat.getColor(binding.root.context, R.color.gray_300) | ||
|
||
fun onBind(item: TodoAllocatorModel) { | ||
binding.run { | ||
tvTodoName.text = item.name | ||
if (isCompleted) { | ||
tvTodoName.setTextColor(completedColor) | ||
tvTodoName.setBackgroundResource(R.drawable.shape_rect_2_gray300_line) | ||
} else { | ||
if (item.isOwner) { | ||
tvTodoName.setTextColor(redColor) | ||
tvTodoName.isSelected = true | ||
} else { | ||
tvTodoName.setTextColor(grayColor) | ||
with(binding.tvTodoName) { | ||
text = item.name | ||
when { | ||
isCompleted -> { | ||
setTextColor(binding.root.context.colorOf(R.color.gray_300)) | ||
setBackgroundResource(R.drawable.shape_rect_2_gray300_line) | ||
} | ||
|
||
item.isOwner -> { | ||
setTextColor(binding.root.context.colorOf(R.color.red_500)) | ||
isSelected = true | ||
} | ||
Comment on lines
+17
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if문 말고 이렇게 바꿀 수도 있군용 |
||
|
||
else -> { | ||
setTextColor(binding.root.context.colorOf(R.color.gray_400)) | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 이렇게 리팩해보겠습니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 이 방법 알고는 감탄했는데 아주 굿이에요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...미쳤다!!>...저도 이거 이용해서 리팩해볼게요 역시 그는 김상호...