use of com.zype.fire.api.Model.ZobjectContentResponse in project zype-firebuilder by zype.
the class ZypeApi method getZobjectContents.
public ZobjectContentResponse getZobjectContents() {
try {
HashMap<String, String> params = new HashMap<>();
params.put(APP_KEY, ZypeSettings.APP_KEY);
params.put(PER_PAGE, String.valueOf(PER_PAGE_DEFAULT));
Response response = apiImpl.getZobjectContent(params).execute();
if (response.isSuccessful()) {
return (ZobjectContentResponse) response.body();
} else {
return null;
}
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
use of com.zype.fire.api.Model.ZobjectContentResponse in project zype-firebuilder by zype.
the class ZypeDataDownloader method loadZobjectContents.
private void loadZobjectContents() {
ZobjectContentResponse response = ZypeApi.getInstance().getZobjectContents();
if (response != null) {
Log.d(TAG, "loadZobjectContents(): size=" + response.zobjectContents.size());
for (ZobjectContentData item : response.zobjectContents) {
if (item.friendlyTitle.equals("privacy_policy")) {
Preferences.setString(PREFERENCE_TERMS, item.description);
return;
}
}
Preferences.setString(PREFERENCE_TERMS, null);
} else {
Log.e(TAG, "loadZobjectContents(): failed");
Preferences.setString(PREFERENCE_TERMS, null);
}
}
Aggregations