add project adins

This commit is contained in:
Alfrid Sanjaya Leo Putra 2024-07-25 14:44:22 +07:00
commit f8f85d679d
5299 changed files with 625430 additions and 0 deletions

View file

@ -0,0 +1,224 @@
package com.adins.mss.dao;
import com.adins.mss.base.util.ExcludeFromGson;
import com.google.gson.annotations.SerializedName;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
/**
* Entity mapped to table "TR_PAYMENTHISTORY_D".
*/
public class PaymentHistoryD {
/** Not-null value. */
@SerializedName("uuid_payment_history_d")
private String uuid_payment_history_d;
@SerializedName("uuid_task_h")
private String uuid_task_h;
@SerializedName("transactiontype")
private String transaction_type;
@SerializedName("receipt_no")
private String receipt_no;
@SerializedName("value_date")
private java.util.Date value_date;
@SerializedName("posting_date")
private java.util.Date posting_date;
@SerializedName("payment_amount")
private String payment_amount;
@SerializedName("installment_amount")
private String installment_amount;
@SerializedName("installment_number")
private String installment_number;
@SerializedName("wop_code")
private String wop_code;
@SerializedName("payment_allocation_name")
private String payment_allocation_name;
@SerializedName("os_amount_od")
private String os_amount_od;
@SerializedName("receive_amount")
private String receive_amount;
@SerializedName("dtm_upd")
private java.util.Date dtm_upd;
@SerializedName("usr_upd")
private String usr_upd;
@SerializedName("dtm_crt")
private java.util.Date dtm_crt;
@SerializedName("usr_crt")
private String usr_crt;
@SerializedName("uuid_payment_history_h")
private String uuid_payment_history_h;
public PaymentHistoryD() {
}
public PaymentHistoryD(String uuid_payment_history_d) {
this.uuid_payment_history_d = uuid_payment_history_d;
}
public PaymentHistoryD(String uuid_payment_history_d, String uuid_task_h, String transaction_type, String receipt_no, java.util.Date value_date, java.util.Date posting_date, String payment_amount, String installment_amount, String installment_number, String wop_code, String payment_allocation_name, String os_amount_od, String receive_amount, java.util.Date dtm_upd, String usr_upd, java.util.Date dtm_crt, String usr_crt, String uuid_payment_history_h) {
this.uuid_payment_history_d = uuid_payment_history_d;
this.uuid_task_h = uuid_task_h;
this.transaction_type = transaction_type;
this.receipt_no = receipt_no;
this.value_date = value_date;
this.posting_date = posting_date;
this.payment_amount = payment_amount;
this.installment_amount = installment_amount;
this.installment_number = installment_number;
this.wop_code = wop_code;
this.payment_allocation_name = payment_allocation_name;
this.os_amount_od = os_amount_od;
this.receive_amount = receive_amount;
this.dtm_upd = dtm_upd;
this.usr_upd = usr_upd;
this.dtm_crt = dtm_crt;
this.usr_crt = usr_crt;
this.uuid_payment_history_h = uuid_payment_history_h;
}
/** Not-null value. */
public String getUuid_payment_history_d() {
return uuid_payment_history_d;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_payment_history_d(String uuid_payment_history_d) {
this.uuid_payment_history_d = uuid_payment_history_d;
}
public String getUuid_task_h() {
return uuid_task_h;
}
public void setUuid_task_h(String uuid_task_h) {
this.uuid_task_h = uuid_task_h;
}
public String getTransaction_type() {
return transaction_type;
}
public void setTransaction_type(String transaction_type) {
this.transaction_type = transaction_type;
}
public String getReceipt_no() {
return receipt_no;
}
public void setReceipt_no(String receipt_no) {
this.receipt_no = receipt_no;
}
public java.util.Date getValue_date() {
return value_date;
}
public void setValue_date(java.util.Date value_date) {
this.value_date = value_date;
}
public java.util.Date getPosting_date() {
return posting_date;
}
public void setPosting_date(java.util.Date posting_date) {
this.posting_date = posting_date;
}
public String getPayment_amount() {
return payment_amount;
}
public void setPayment_amount(String payment_amount) {
this.payment_amount = payment_amount;
}
public String getInstallment_amount() {
return installment_amount;
}
public void setInstallment_amount(String installment_amount) {
this.installment_amount = installment_amount;
}
public String getInstallment_number() {
return installment_number;
}
public void setInstallment_number(String installment_number) {
this.installment_number = installment_number;
}
public String getWop_code() {
return wop_code;
}
public void setWop_code(String wop_code) {
this.wop_code = wop_code;
}
public String getPayment_allocation_name() {
return payment_allocation_name;
}
public void setPayment_allocation_name(String payment_allocation_name) {
this.payment_allocation_name = payment_allocation_name;
}
public String getOs_amount_od() {
return os_amount_od;
}
public void setOs_amount_od(String os_amount_od) {
this.os_amount_od = os_amount_od;
}
public String getReceive_amount() {
return receive_amount;
}
public void setReceive_amount(String receive_amount) {
this.receive_amount = receive_amount;
}
public java.util.Date getDtm_upd() {
return dtm_upd;
}
public void setDtm_upd(java.util.Date dtm_upd) {
this.dtm_upd = dtm_upd;
}
public String getUsr_upd() {
return usr_upd;
}
public void setUsr_upd(String usr_upd) {
this.usr_upd = usr_upd;
}
public java.util.Date getDtm_crt() {
return dtm_crt;
}
public void setDtm_crt(java.util.Date dtm_crt) {
this.dtm_crt = dtm_crt;
}
public String getUsr_crt() {
return usr_crt;
}
public void setUsr_crt(String usr_crt) {
this.usr_crt = usr_crt;
}
public String getUuid_payment_history_h() {
return uuid_payment_history_h;
}
public void setUuid_payment_history_h(String uuid_payment_history_h) {
this.uuid_payment_history_h = uuid_payment_history_h;
}
}

View file

@ -0,0 +1,10 @@
package com.adins.mss.base.api;
/**
* Created by adityapurwa on 30/03/15.
*/
public interface ChangePasswordApiCallback {
void onFailed(String message);
void onSuccess();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,198 @@
package com.adins.mss.coll.loyalti.pointacquisitionmonthly;
import com.adins.mss.coll.loyalti.pointacquisitionmonthly.contracts.MonthlyPointContract;
import com.adins.mss.coll.loyalti.pointacquisitionmonthly.contracts.ILoyaltyPointsDataSource;
import com.adins.mss.coll.models.loyaltymodels.GroupPointData;
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsRequest;
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsResponse;
import com.adins.mss.coll.models.loyaltymodels.PointDetail;
import com.adins.mss.coll.models.loyaltymodels.RankDetail;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
public class MonthlyPointsPresenter implements MonthlyPointContract.Presenter, ILoyaltyPointsDataSource.ReqPointsListener {
private MonthlyPointContract.View view;
private MonthlyPointsLogic monthlyPointsLogic;
//data hold
private LoyaltyPointsResponse pointsData;
public MonthlyPointsPresenter(MonthlyPointContract.View view, MonthlyPointsLogic logic) {
this.view = view;
this.monthlyPointsLogic = logic;
}
@Override
public void init() {
}
@Override
public void getMonthlyPointsData(LoyaltyPointsRequest reqData) {
monthlyPointsLogic.getMonthlyPointsData(reqData,this);
}
@Override
public float getAvgPoint() {
return monthlyPointsLogic.getAvgPoint(pointsData.dataDetail);
}
@Override
public int getMaxPoint() {
return monthlyPointsLogic.getMaxPoint(pointsData.dataDetail);
}
@Override
public int getTotalPoints() {
return monthlyPointsLogic.getTotalPoints(pointsData.dataDetail);
}
@Override
public int getCurrentMonth() {
Date now = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
int currMonth = calendar.get(Calendar.MONTH);
if(currMonth < 0)
return 0;//default use january when error
else if(currMonth >= 12)
currMonth = 11;
for (int i=0; i<pointsData.dataDetail.size(); i++) {
GroupPointData group = pointsData.dataDetail.get(i);
if(group == null)
continue;
int month = Integer.valueOf(group.getGroupPointValue()[0]);
if(month == currMonth+1){
currMonth = i;
break;
}
}
if(currMonth >= pointsData.dataDetail.size()){
currMonth = pointsData.dataDetail.size() - 1;
}
return currMonth;
}
@Override
public String[] getMonths() {
if(pointsData == null || pointsData.dataDetail.size() == 0)
return new String[]{};
String[] monthNames = new String[pointsData.dataDetail.size()];
Calendar calendar = Calendar.getInstance();
List<GroupPointData> groups = pointsData.dataDetail;
int monthIdx = 0;
for(int i=0; i<groups.size(); i++){
GroupPointData groupData = groups.get(i);
if(groupData.isMonth()){
monthIdx = Integer.valueOf(groupData.getGroupPointValue()[0]) - 1;
calendar.set(Calendar.MONTH,monthIdx);
monthNames[i] = calendar.getDisplayName(Calendar.MONTH,Calendar.LONG,Locale.getDefault());
}
}
return monthNames;
}
@Override
public GroupPointData getPointDataAt(int monthIdx) {
if(monthIdx >= pointsData.dataDetail.size()){
return null;
}
if(pointsData == null || pointsData.dataDetail.size() == 0)
return null;
return pointsData.dataDetail.get(monthIdx);
}
@Override
public List<PointDetail> getPointDetails() {
if(pointsData == null)
return null;
List<PointDetail> pointCategories = new ArrayList<>();
for (GroupPointData groupPoint:pointsData.dataDetail) {
if(groupPoint == null)
continue;
if(groupPoint.pointDetails == null || groupPoint.pointDetails.size() == 0)
continue;
for (PointDetail pointDetail:groupPoint.pointDetails) {
if(pointDetail == null)
continue;
if(isContainsPointDetails(pointCategories,pointDetail.rewardProgram)){
continue;
}
pointCategories.add(pointDetail);
}
}
return pointCategories;
}
private boolean isContainsPointDetails(List<PointDetail> list,String rewardProgram){
boolean result = false;
for (PointDetail pointDetail:list){
if(pointDetail.rewardProgram.equals(rewardProgram)){
result = true;
break;
}
}
return result;
}
@Override
public List<RankDetail> getRanks() {
if(pointsData == null || pointsData.dataDetail.size() == 0)
return null;
return pointsData.dataDetail.get(0).rankDetails;
}
@Override
public void onSuccess(LoyaltyPointsResponse pointsData) {
if(pointsData == null || pointsData.dataDetail.size() == 0){
view.onGetDataFailed("No data detail found");
return;
}
this.pointsData = pointsData;
//convert point and rank data to 2d array to satisfy view
float[][] pointDataSet = new float[pointsData.dataDetail.size()][];
RankDetail[][] rankDataSet = new RankDetail[pointsData.dataDetail.size()][pointsData.dataDetail.get(0).rankDetails.size()];
List<PointDetail> pointDetailsDataSet = new ArrayList<>();
for(int i=0; i<pointDataSet.length; i++){
float[] yVals = new float[pointsData.dataDetail.get(i).pointDetails.size()];
for (int j=0; j<yVals.length; j++){
yVals[j] = Integer.valueOf(pointsData.dataDetail.get(i).pointDetails.get(j).point);
pointDetailsDataSet.add(pointsData.dataDetail.get(i).pointDetails.get(j));
}
pointDataSet[i] = yVals;
}
for(int i=0; i<rankDataSet.length; i++){
for (int j=0; j<rankDataSet[i].length; j++){
rankDataSet[i][j] = pointsData.dataDetail.get(i).rankDetails.get(j);
}
}
view.onDataReceived(pointDataSet,rankDataSet,pointDetailsDataSet);
}
@Override
public void onFailed(String message) {
view.onGetDataFailed(message);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,19 @@
package com.adins.mss.base.util;
import com.gadberry.utility.expression.Argument;
import com.gadberry.utility.expression.Expression;
import com.gadberry.utility.expression.symbol.EqualSymbol;
public class NotEqualSymbol extends EqualSymbol {
public NotEqualSymbol(Expression expression) {
super(expression);
}
@Override
public Argument resolve() {
boolean result = super.resolve().toBoolean();
Argument argResult = new Argument(!result, getResolver());
return argResult;
}
}

View file

@ -0,0 +1,18 @@
package com.adins.mss.base.loyalti.mypointdashboard;
import com.adins.mss.foundation.http.MssResponseType;
import com.google.gson.annotations.SerializedName;
public class GetLogoKompetisiResponse extends MssResponseType {
@SerializedName("LOGO")
protected String LOGO;
public String getLOGO() {
return LOGO;
}
public void setLOGO(String LOGO) {
this.LOGO = LOGO;
}
}

View file

@ -0,0 +1,29 @@
package com.adins.mss.odr.products.api;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
public class ProductDetailViewPdfRequest extends MssRequestType {
@SerializedName("uuid_product")
private String uuid_product;
@SerializedName("dtm_upd")
private String dtm_upd;
public String getUuid_product() {
return uuid_product;
}
public void setUuid_product(String uuid_product) {
this.uuid_product = uuid_product;
}
public String getDtm_upd() {
return dtm_upd;
}
public void setDtm_upd(String dtm_upd) {
this.dtm_upd = dtm_upd;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

View file

@ -0,0 +1,87 @@
package com.adins.mss.foundation.oauth2.store;
import android.content.Context;
import android.util.Log;
import com.adins.mss.foundation.oauth2.Token;
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
import java.io.IOException;
/**
* Created by gigin.ginanjar on 13/05/2016.
*/
public class SharedPreferencesTokenStore {
public static final String TOKEN_PREFERENCES = "token_preferences";
public static final String TAG = "AndroidOauth2";
private static final String ACCESS_TOKEN = "_access_token";
private static final String EXPIRES_IN = "_expires_in";
private static final String EXPIRES_AT = "_expires_at";
private static final String REFRESH_TOKEN = "_refresh_token";
private static final String TOKEN_TYPE = "_token_type";
private static final String SCOPE = "_scope";
private ObscuredSharedPreferences prefs;
public SharedPreferencesTokenStore(ObscuredSharedPreferences prefs) {
this.prefs = prefs;
}
public SharedPreferencesTokenStore(Context context) {
ObscuredSharedPreferences sharedPref = ObscuredSharedPreferences.getPrefs(context, TOKEN_PREFERENCES, Context.MODE_PRIVATE);
this.prefs = sharedPref;
}
public Token load(String userId) throws IOException {
Log.i(TAG, "Loading credential for userId " + userId);
Log.i(TAG, "Loaded access token = " + prefs.getString(userId + ACCESS_TOKEN, ""));
/*String accessToken = prefs.getString(userId+ACCESS_TOKEN,null);
String refreshToken = prefs.getString(userId+REFRESH_TOKEN,null);
String tokenType = prefs.getString(userId+TOKEN_TYPE,null);
long expiresAt = prefs.getLong(userId+EXPIRES_AT, 0);
long expiresIn = prefs.getLong(userId+EXPIRES_IN, 0);*/
String accessToken = prefs.getString(ACCESS_TOKEN, null);
String refreshToken = prefs.getString(REFRESH_TOKEN, null);
String tokenType = prefs.getString(TOKEN_TYPE, null);
long expiresAt = prefs.getLong(EXPIRES_AT, 0);
long expiresIn = prefs.getLong(EXPIRES_IN, 0);
Token token = new Token(expiresIn, tokenType, refreshToken, accessToken, expiresAt);
return token;
}
public void store(String userId, Token token) throws IOException {
Log.i(TAG, "Storing credential for userId " + userId);
Log.i(TAG, "Access Token = " + token.getAccessToken());
ObscuredSharedPreferences.Editor editor = prefs.edit();
/*editor.putString(userId + ACCESS_TOKEN, token.getAccessToken());
editor.putString(userId + REFRESH_TOKEN, token.getRefreshToken());
editor.putString(userId + TOKEN_TYPE, token.getTokenType());
editor.putLong(userId + EXPIRES_IN, token.getExpiresIn());
editor.putLong(userId + EXPIRES_AT, token.getExpiresAt());*/
editor.putString(ACCESS_TOKEN, token.getAccessToken());
editor.putString(REFRESH_TOKEN, token.getRefreshToken());
editor.putString(TOKEN_TYPE, token.getTokenType());
editor.putLong(EXPIRES_IN, token.getExpiresIn());
editor.putLong(EXPIRES_AT, token.getExpiresAt());
editor.commit();
}
public void delete(String userId) throws IOException {
Log.i(TAG, "Deleting credential for userId " + userId);
ObscuredSharedPreferences.Editor editor = prefs.edit();
/*editor.remove(userId + ACCESS_TOKEN);
editor.remove(userId + EXPIRES_IN);
editor.remove(userId + REFRESH_TOKEN);
editor.remove(userId + TOKEN_TYPE);
editor.remove(userId + EXPIRES_AT);*/
editor.remove(ACCESS_TOKEN);
editor.remove(EXPIRES_IN);
editor.remove(REFRESH_TOKEN);
editor.remove(TOKEN_TYPE);
editor.remove(EXPIRES_AT);
editor.commit();
}
}

View file

@ -0,0 +1,188 @@
package com.adins.mss.dao;
import com.adins.mss.dao.DaoSession;
import de.greenrobot.dao.DaoException;
import com.adins.mss.base.util.ExcludeFromGson;
import com.google.gson.annotations.SerializedName;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
/**
* Entity mapped to table "TR_ERROR_LOG".
*/
public class ErrorLog {
/** Not-null value. */
@SerializedName("uuid_error_log")
private String uuid_error_log;
@SerializedName("description")
private String error_description;
@SerializedName("device_name")
private String device_name;
@SerializedName("dtm_activity")
private java.util.Date dtm_activity;
@SerializedName("uuid_user")
private String uuid_user;
@SerializedName("task_id")
private String task_id;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient ErrorLogDao myDao;
private User user;
private String user__resolvedKey;
private TaskH taskH;
private String taskH__resolvedKey;
public ErrorLog() {
}
public ErrorLog(String uuid_error_log) {
this.uuid_error_log = uuid_error_log;
}
public ErrorLog(String uuid_error_log, String error_description, String device_name, java.util.Date dtm_activity, String uuid_user, String task_id) {
this.uuid_error_log = uuid_error_log;
this.error_description = error_description;
this.device_name = device_name;
this.dtm_activity = dtm_activity;
this.uuid_user = uuid_user;
this.task_id = task_id;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getErrorLogDao() : null;
}
/** Not-null value. */
public String getUuid_error_log() {
return uuid_error_log;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_error_log(String uuid_error_log) {
this.uuid_error_log = uuid_error_log;
}
public String getError_description() {
return error_description;
}
public void setError_description(String error_description) {
this.error_description = error_description;
}
public String getDevice_name() {
return device_name;
}
public void setDevice_name(String device_name) {
this.device_name = device_name;
}
public java.util.Date getDtm_activity() {
return dtm_activity;
}
public void setDtm_activity(java.util.Date dtm_activity) {
this.dtm_activity = dtm_activity;
}
public String getUuid_user() {
return uuid_user;
}
public void setUuid_user(String uuid_user) {
this.uuid_user = uuid_user;
}
public String getTask_id() {
return task_id;
}
public void setTask_id(String task_id) {
this.task_id = task_id;
}
/** To-one relationship, resolved on first access. */
public User getUser() {
String __key = this.uuid_user;
if (user__resolvedKey == null || user__resolvedKey != __key) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
UserDao targetDao = daoSession.getUserDao();
User userNew = targetDao.load(__key);
synchronized (this) {
user = userNew;
user__resolvedKey = __key;
}
}
return user;
}
public void setUser(User user) {
synchronized (this) {
this.user = user;
uuid_user = user == null ? null : user.getUuid_user();
user__resolvedKey = uuid_user;
}
}
/** To-one relationship, resolved on first access. */
public TaskH getTaskH() {
String __key = this.task_id;
if (taskH__resolvedKey == null || taskH__resolvedKey != __key) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
TaskHDao targetDao = daoSession.getTaskHDao();
TaskH taskHNew = targetDao.load(__key);
synchronized (this) {
taskH = taskHNew;
taskH__resolvedKey = __key;
}
}
return taskH;
}
public void setTaskH(TaskH taskH) {
synchronized (this) {
this.taskH = taskH;
task_id = taskH == null ? null : taskH.getUuid_task_h();
taskH__resolvedKey = task_id;
}
}
/** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
}

View file

@ -0,0 +1,149 @@
package com.adins.mss.dao;
import com.adins.mss.dao.DaoSession;
import de.greenrobot.dao.DaoException;
import com.adins.mss.base.util.ExcludeFromGson;
import com.google.gson.annotations.SerializedName;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
/**
* Entity mapped to table "TR_APPLICATION_LOG".
*/
public class Logger {
/** Not-null value. */
@SerializedName("uuid_log")
private String uuid_log;
@SerializedName("screen")
private String screen;
@SerializedName("timestamp")
private java.util.Date timestamp;
@SerializedName("detail")
private String detail;
@SerializedName("uuid_user")
private String uuid_user;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient LoggerDao myDao;
private User user;
private String user__resolvedKey;
public Logger() {
}
public Logger(String uuid_log) {
this.uuid_log = uuid_log;
}
public Logger(String uuid_log, String screen, java.util.Date timestamp, String detail, String uuid_user) {
this.uuid_log = uuid_log;
this.screen = screen;
this.timestamp = timestamp;
this.detail = detail;
this.uuid_user = uuid_user;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getLoggerDao() : null;
}
/** Not-null value. */
public String getUuid_log() {
return uuid_log;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_log(String uuid_log) {
this.uuid_log = uuid_log;
}
public String getScreen() {
return screen;
}
public void setScreen(String screen) {
this.screen = screen;
}
public java.util.Date getTimestamp() {
return timestamp;
}
public void setTimestamp(java.util.Date timestamp) {
this.timestamp = timestamp;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public String getUuid_user() {
return uuid_user;
}
public void setUuid_user(String uuid_user) {
this.uuid_user = uuid_user;
}
/** To-one relationship, resolved on first access. */
public User getUser() {
String __key = this.uuid_user;
if (user__resolvedKey == null || user__resolvedKey != __key) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
UserDao targetDao = daoSession.getUserDao();
User userNew = targetDao.load(__key);
synchronized (this) {
user = userNew;
user__resolvedKey = __key;
}
}
return user;
}
public void setUser(User user) {
synchronized (this) {
this.user = user;
uuid_user = user == null ? null : user.getUuid_user();
user__resolvedKey = uuid_user;
}
}
/** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
}

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="@color/gradient_end"
android:endColor="@color/gradient_end"
android:angle="270"
/>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" />
</shape>
</item>
</selector>