Browse Source

Fix viewmodels

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
daa5a110f2
  1. 8
      app/src/main/java/awais/instagrabber/fragments/main/viewmodels/BasePostViewModel.java
  2. 9
      app/src/main/java/awais/instagrabber/fragments/main/viewmodels/ViewerPostViewModel.java

8
app/src/main/java/awais/instagrabber/fragments/main/viewmodels/BasePostViewModel.java

@ -1,13 +1,9 @@
package awais.instagrabber.fragments.main.viewmodels;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import java.util.List;
import awais.instagrabber.models.BasePostModel;
public class BasePostViewModel extends ViewModel {
// this file was somehow identical to DiscoverItemViewModel
// pretty sure you didn't meant to do that
public class BasePostViewModel<T extends BasePostModel> extends ViewModel {
}

9
app/src/main/java/awais/instagrabber/fragments/main/viewmodels/ViewerPostViewModel.java

@ -1,15 +1,16 @@
package awais.instagrabber.fragments.main.viewmodels;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import java.util.List;
import awais.instagrabber.models.ViewerPostModel;
import awais.instagrabber.models.ViewerPostModelWrapper;
public class ViewerPostViewModel extends BasePostViewModel<ViewerPostModel> {
private MutableLiveData<List<ViewerPostModel>> list;
public class ViewerPostViewModel extends ViewModel {
private MutableLiveData<List<ViewerPostModelWrapper>> list;
public MutableLiveData<List<ViewerPostModel>> getList() {
public MutableLiveData<List<ViewerPostModelWrapper>> getList() {
if (list == null) {
list = new MutableLiveData<>();
}

Loading…
Cancel
Save