1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 13:26:59 +00:00

Fix viewmodels

This commit is contained in:
Ammar Githam 2020-09-03 18:44:02 +09:00
parent 65d19d860e
commit daa5a110f2
2 changed files with 7 additions and 10 deletions

View File

@ -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 {
}

View File

@ -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<>();
}