-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add filtering projects #57
Conversation
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.
Необходимо переделать
@@ -9,7 +9,7 @@ import so.codex.hawk.ui.data.UiProject | |||
class ProjectCallback : DiffUtil.ItemCallback<UiProject>() { | |||
|
|||
override fun areItemsTheSame(oldItem: UiProject, newItem: UiProject): Boolean { | |||
return oldItem.id == newItem.id | |||
return oldItem.id === newItem.id |
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.
тут все таки лучше оставить ==
вместо ===
|
||
// ToDo make class more general for future uses (add generics for example) | ||
// ToDo add docs | ||
object FilterProjectUtils { |
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.
можно сделать обычным классом, создать инстанс во MainViewModel
и предоставить этот класс в активити, чтобы установить фильтрацию
@@ -58,6 +64,7 @@ class MainActivity : AppCompatActivity() { | |||
Timber.i("show loading") | |||
} else { | |||
projectAdapter.submitList(model.projects) | |||
FilterProjectUtils.filterableList = model.projects |
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.
как то странно получается, сабмитить список в адаптер, потом устанавливать его для фильтрации, где потом все равно будет перезаписан засабмиченный список, почему тогда данную фильтрацию не сделать в MainViewModel
?
No description provided.