use of net.iGap.request.RequestInfoWallpaper in project iGap-Android by KianIranian-STDG.
the class UserProfileViewModel method getProfileWallpaperFromServer.
private void getProfileWallpaperFromServer() {
G.onGetProfileWallpaper = list -> {
G.isNeedToCheckProfileWallpaper = false;
DbManager.getInstance().doRealmTask(realm -> {
RealmWallpaper realmWallpaper = realm.where(RealmWallpaper.class).equalTo("type", ProtoInfoWallpaper.InfoWallpaper.Type.PROFILE_WALLPAPER_VALUE).findFirst();
if (realmWallpaper != null) {
int count = realmWallpaper.getWallPaperList().size();
assert realmWallpaper.getWallPaperList().get(count - 1) != null;
if (!realmWallpaper.getWallPaperList().get(count - 1).getFile().getToken().equals(list.get(0).getFile().getToken())) {
RealmWallpaper.updateWallpaper(list);
}
} else {
RealmWallpaper.updateField(list, "", ProtoInfoWallpaper.InfoWallpaper.Type.PROFILE_WALLPAPER_VALUE);
}
getProfileWallpaper(realm);
});
};
new RequestInfoWallpaper().infoWallpaper(ProtoInfoWallpaper.InfoWallpaper.Type.PROFILE_WALLPAPER);
}
use of net.iGap.request.RequestInfoWallpaper in project iGap-Android by KianIranian-STDG.
the class ChatBackgroundViewModel method getImageListFromServer.
private void getImageListFromServer() {
showLoadingView.set(View.VISIBLE);
G.onGetWallpaper = new OnGetWallpaper() {
@Override
public void onGetWallpaperList(final List<ProtoGlobal.Wallpaper> list) {
RealmWallpaper.updateField(list, "", ProtoInfoWallpaper.InfoWallpaper.Type.CHAT_BACKGROUND_VALUE);
fillList(false);
showLoadingView.set(View.GONE);
}
};
new RequestInfoWallpaper().infoWallpaper(ProtoInfoWallpaper.InfoWallpaper.Type.CHAT_BACKGROUND);
}
Aggregations