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

[Don't merge] Connect ViewModel and the repository / ViewModel とリポジトリの関連付けの実装例 #17

Open
wants to merge 9 commits into
base: refactor_repository
Choose a base branch
from

Conversation

tomoya0x00
Copy link
Contributor

@tomoya0x00 tomoya0x00 commented Dec 29, 2018

Read the Connect ViewModel and the repository article. / データの取得 をご参照

  • Stop accessing the repository directly from Activity
  • Activity refers to ViewModel instead
    • Only the ViewModel directly calls the Repository

@tomoya0x00 tomoya0x00 changed the base branch from master to refactor_repository December 29, 2018 14:11

class MainViewModel : ViewModel() {

private val topStoriesRequest = MutableLiveData<Unit>()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ここらへんは
https://developer.android.com/topic/libraries/architecture/livedata#transform_livedata
で紹介されている書き方に倣っています。

@tomoya0x00 tomoya0x00 changed the title [Don't merge] ViewModelの導入例 [Don't merge] AACのViewModelの導入例 Dec 29, 2018
@tomoya0x00 tomoya0x00 changed the title [Don't merge] AACのViewModelの導入例 [Don't merge][WIP] AACのViewModelの導入例 Dec 29, 2018
@tomoya0x00
Copy link
Contributor Author

#14 をmasterにマージしたので、本ブランチはリベースして push -f した。

@tomoya0x00 tomoya0x00 changed the title [Don't merge][WIP] AACのViewModelの導入例 [Don't merge] AACのViewModelの導入例 Dec 30, 2018
@tomoya0x00 tomoya0x00 changed the title [Don't merge] AACのViewModelの導入例 [Don't merge] ViewModel とリポジトリの関連付けの導入例 Jan 14, 2019
@tomoya0x00 tomoya0x00 changed the title [Don't merge] ViewModel とリポジトリの関連付けの導入例 [Don't merge] ViewModel とリポジトリの関連付けの実装例 Feb 1, 2019
@tomoya0x00 tomoya0x00 changed the title [Don't merge] ViewModel とリポジトリの関連付けの実装例 [Don't merge] Connect ViewModel and the repository / ViewModel とリポジトリの関連付けの実装例 Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant