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
import android.arch.lifecycle.MutableLiveData | |
class Repository { | |
fun logout(actions: RepositoryActions) { | |
// Do logic to log out user | |
actions.onLoggedOut() | |
} | |
fun login(actions: RepositoryActions) { |
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
class Repository { | |
public void logout(RepositoryActions actions) { | |
if(userLoggedOut) { | |
actions.doLogoutAction(); | |
} | |
} | |
} | |
class ViewModel { | |
private RepositoryActions actions = new RepositoryActions() { |