Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

YorkIsMine
Copy link
Contributor

No description provided.

@Shiplayer Shiplayer linked an issue Dec 27, 2020 that may be closed by this pull request
2 tasks
Copy link
Contributor

@Shiplayer Shiplayer left a 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
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как то странно получается, сабмитить список в адаптер, потом устанавливать его для фильтрации, где потом все равно будет перезаписан засабмиченный список, почему тогда данную фильтрацию не сделать в MainViewModel?

@Shiplayer Shiplayer closed this Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Фильтровать проекты по поиску
3 participants