mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,348 @@
|
|||
package com.adins.mss.base.dynamicform.form.questions;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ScaleGestureDetector;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.adins.mss.foundation.camerainapp.helper.Logger;
|
||||
|
||||
/**
|
||||
* Created by gigin.ginanjar on 06/08/2016.
|
||||
*/
|
||||
public class TouchImageView extends ImageView {
|
||||
// We can be in one of these 3 states
|
||||
static final int NONE = 0;
|
||||
static final int DRAG = 1;
|
||||
static final int ZOOM = 2;
|
||||
static final int CLICK = 3;
|
||||
protected float origWidth, origHeight;
|
||||
Matrix matrix;
|
||||
int mode = NONE;
|
||||
// Remember some things for zooming
|
||||
PointF last = new PointF();
|
||||
PointF start = new PointF();
|
||||
float minScale = 1f;
|
||||
float maxScale = 3f;
|
||||
float[] m;
|
||||
int viewWidth, viewHeight;
|
||||
float saveScale = 1f;
|
||||
int oldMeasuredWidth, oldMeasuredHeight;
|
||||
|
||||
ScaleGestureDetector mScaleDetector;
|
||||
|
||||
Context context;
|
||||
|
||||
public TouchImageView(Context context) {
|
||||
super(context);
|
||||
sharedConstructing(context);
|
||||
}
|
||||
|
||||
public TouchImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
sharedConstructing(context);
|
||||
}
|
||||
|
||||
private void sharedConstructing(Context context) {
|
||||
|
||||
super.setClickable(true);
|
||||
|
||||
this.context = context;
|
||||
|
||||
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
|
||||
|
||||
matrix = new Matrix();
|
||||
|
||||
m = new float[9];
|
||||
|
||||
setImageMatrix(matrix);
|
||||
|
||||
setScaleType(ScaleType.MATRIX);
|
||||
|
||||
setOnTouchListener(new OnTouchListener() {
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
|
||||
mScaleDetector.onTouchEvent(event);
|
||||
|
||||
PointF curr = new PointF(event.getX(), event.getY());
|
||||
|
||||
switch (event.getAction()) {
|
||||
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
|
||||
last.set(curr);
|
||||
|
||||
start.set(last);
|
||||
|
||||
mode = DRAG;
|
||||
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
|
||||
if (mode == DRAG) {
|
||||
|
||||
float deltaX = curr.x - last.x;
|
||||
|
||||
float deltaY = curr.y - last.y;
|
||||
|
||||
float fixTransX = getFixDragTrans(deltaX, viewWidth, origWidth * saveScale);
|
||||
|
||||
float fixTransY = getFixDragTrans(deltaY, viewHeight, origHeight * saveScale);
|
||||
|
||||
matrix.postTranslate(fixTransX, fixTransY);
|
||||
|
||||
fixTrans();
|
||||
|
||||
last.set(curr.x, curr.y);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
|
||||
mode = NONE;
|
||||
|
||||
int xDiff = (int) Math.abs(curr.x - start.x);
|
||||
|
||||
int yDiff = (int) Math.abs(curr.y - start.y);
|
||||
|
||||
if (xDiff < CLICK && yDiff < CLICK)
|
||||
|
||||
performClick();
|
||||
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
|
||||
mode = NONE;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
setImageMatrix(matrix);
|
||||
|
||||
invalidate();
|
||||
|
||||
return true; // indicate event was handled
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void setMaxZoom(float x) {
|
||||
|
||||
maxScale = x;
|
||||
|
||||
}
|
||||
|
||||
void fixTrans() {
|
||||
|
||||
matrix.getValues(m);
|
||||
|
||||
float transX = m[Matrix.MTRANS_X];
|
||||
|
||||
float transY = m[Matrix.MTRANS_Y];
|
||||
|
||||
float fixTransX = getFixTrans(transX, viewWidth, origWidth * saveScale);
|
||||
|
||||
float fixTransY = getFixTrans(transY, viewHeight, origHeight * saveScale);
|
||||
|
||||
if (fixTransX != 0 || fixTransY != 0)
|
||||
|
||||
matrix.postTranslate(fixTransX, fixTransY);
|
||||
|
||||
}
|
||||
|
||||
float getFixTrans(float trans, float viewSize, float contentSize) {
|
||||
|
||||
float minTrans, maxTrans;
|
||||
|
||||
if (contentSize <= viewSize) {
|
||||
|
||||
minTrans = 0;
|
||||
|
||||
maxTrans = viewSize - contentSize;
|
||||
|
||||
} else {
|
||||
|
||||
minTrans = viewSize - contentSize;
|
||||
|
||||
maxTrans = 0;
|
||||
|
||||
}
|
||||
|
||||
if (trans < minTrans)
|
||||
|
||||
return -trans + minTrans;
|
||||
|
||||
if (trans > maxTrans)
|
||||
|
||||
return -trans + maxTrans;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
float getFixDragTrans(float delta, float viewSize, float contentSize) {
|
||||
|
||||
if (contentSize <= viewSize) {
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
return delta;
|
||||
|
||||
}
|
||||
|
||||
void rescalingImage() {
|
||||
sharedConstructing(context);
|
||||
saveScale = 1f;
|
||||
// viewWidth = oldMeasuredWidth;
|
||||
// viewHeight = oldMeasuredHeight;
|
||||
// rescaleImage();
|
||||
}
|
||||
|
||||
private void rescaleImage() {
|
||||
//Fit to screen.
|
||||
|
||||
float scale;
|
||||
|
||||
Drawable drawable = getDrawable();
|
||||
|
||||
if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0)
|
||||
|
||||
return;
|
||||
|
||||
int bmWidth = drawable.getIntrinsicWidth();
|
||||
|
||||
int bmHeight = drawable.getIntrinsicHeight();
|
||||
|
||||
Logger.d("bmSize", "bmWidth: " + bmWidth + " bmHeight : " + bmHeight);
|
||||
|
||||
float scaleX = (float) viewWidth / (float) bmWidth;
|
||||
|
||||
float scaleY = (float) viewHeight / (float) bmHeight;
|
||||
|
||||
scale = Math.min(scaleX, scaleY);
|
||||
|
||||
matrix.setScale(scale, scale);
|
||||
|
||||
// Center the image
|
||||
|
||||
float redundantYSpace = (float) viewHeight - (scale * (float) bmHeight);
|
||||
|
||||
float redundantXSpace = (float) viewWidth - (scale * (float) bmWidth);
|
||||
|
||||
redundantYSpace /= (float) 2;
|
||||
|
||||
redundantXSpace /= (float) 2;
|
||||
|
||||
matrix.postTranslate(redundantXSpace, redundantYSpace);
|
||||
|
||||
origWidth = viewWidth - 2 * redundantXSpace;
|
||||
|
||||
origHeight = viewHeight - 2 * redundantYSpace;
|
||||
|
||||
setImageMatrix(matrix);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
viewWidth = MeasureSpec.getSize(widthMeasureSpec);
|
||||
|
||||
viewHeight = MeasureSpec.getSize(heightMeasureSpec);
|
||||
|
||||
//
|
||||
// Rescales image on rotation
|
||||
//
|
||||
if (oldMeasuredHeight == viewWidth && oldMeasuredHeight == viewHeight
|
||||
|
||||
|| viewWidth == 0 || viewHeight == 0)
|
||||
|
||||
return;
|
||||
|
||||
oldMeasuredHeight = viewHeight;
|
||||
|
||||
oldMeasuredWidth = viewWidth;
|
||||
|
||||
if (saveScale == 1) {
|
||||
|
||||
rescaleImage();
|
||||
|
||||
}
|
||||
|
||||
fixTrans();
|
||||
|
||||
}
|
||||
|
||||
private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
|
||||
|
||||
@Override
|
||||
public boolean onScaleBegin(ScaleGestureDetector detector) {
|
||||
|
||||
mode = ZOOM;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScale(ScaleGestureDetector detector) {
|
||||
|
||||
float mScaleFactor = detector.getScaleFactor();
|
||||
|
||||
float origScale = saveScale;
|
||||
|
||||
saveScale *= mScaleFactor;
|
||||
|
||||
if (saveScale > maxScale) {
|
||||
|
||||
saveScale = maxScale;
|
||||
|
||||
mScaleFactor = maxScale / origScale;
|
||||
|
||||
} else if (saveScale < minScale) {
|
||||
|
||||
saveScale = minScale;
|
||||
|
||||
mScaleFactor = minScale / origScale;
|
||||
|
||||
}
|
||||
|
||||
if (origWidth * saveScale <= viewWidth || origHeight * saveScale <= viewHeight)
|
||||
|
||||
matrix.postScale(mScaleFactor, mScaleFactor, (float)viewWidth / 2, (float)viewHeight / 2);
|
||||
|
||||
else
|
||||
|
||||
matrix.postScale(mScaleFactor, mScaleFactor, detector.getFocusX(), detector.getFocusY());
|
||||
|
||||
fixTrans();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.adins.mss.coll.models.loyaltymodels;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GuidelineFaqResponse extends MssResponseType {
|
||||
@SerializedName("base64Pdf")
|
||||
String base64pdf;
|
||||
|
||||
public String getBase64pdf() {
|
||||
return base64pdf;
|
||||
}
|
||||
|
||||
public void setBase64pdf(String base64pdf) {
|
||||
this.base64pdf = base64pdf;
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,251 @@
|
|||
package com.adins.mss.base.syncfile;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.authentication.AuthenticationTask;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.base.errorhandler.ErrorMessageHandler;
|
||||
import com.adins.mss.base.errorhandler.IShowError;
|
||||
import com.adins.mss.base.login.DefaultLoginModel;
|
||||
import com.adins.mss.base.util.GsonHelper;
|
||||
import com.adins.mss.base.util.Utility;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.MobileDataFile;
|
||||
import com.adins.mss.foundation.http.AuditDataType;
|
||||
import com.adins.mss.foundation.http.AuditDataTypeGenerator;
|
||||
import com.adins.mss.foundation.http.HttpConnectionResult;
|
||||
import com.adins.mss.foundation.http.HttpCryptedConnection;
|
||||
import com.google.firebase.perf.FirebasePerformance;
|
||||
import com.google.firebase.perf.metrics.HttpMetric;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by loise on 10/19/2017.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class untuk menampung context, counter ,data , dan method untuk keseluruhan proses import external db
|
||||
* mulai dari get list file, download, decrypt, extract, dan insert.
|
||||
*/
|
||||
public class FileSyncHelper {
|
||||
private static List<MobileDataFile> data;
|
||||
public static List<MobileDataFile> activeData;
|
||||
public static int currentidx = 0;
|
||||
public static MobileDataFile metadata;
|
||||
public static Context instance;
|
||||
//untuk menentukan menggunakan handler yang mana
|
||||
//0= login activity, 1= main activity
|
||||
public static int senderID = -1;
|
||||
static String link, savePath, message;
|
||||
|
||||
public static List<MobileDataFile> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public static void setData(List<MobileDataFile> data) {
|
||||
FileSyncHelper.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Untuk memulai proses panggil method ini
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void startFileSync(Context context) {
|
||||
instance = context;
|
||||
getDownloadList();
|
||||
}
|
||||
|
||||
/**
|
||||
* method untuk melakukan request ke WS untuk list file yang butuh didownload
|
||||
*/
|
||||
|
||||
private static void getDownloadList() {
|
||||
|
||||
new AsyncTask<Void, Void, HttpConnectionResult>() {
|
||||
boolean success;
|
||||
ErrorMessageHandler errorMessageHandler;
|
||||
ProgressDialog pDialog;
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
pDialog = new ProgressDialog(instance);
|
||||
pDialog.setMessage(instance.getString(R.string.getting_file_list));
|
||||
success = true;
|
||||
pDialog.setIndeterminate(true);
|
||||
pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
pDialog.setCancelable(false);
|
||||
pDialog.show();
|
||||
//error handler initialization
|
||||
errorMessageHandler = new ErrorMessageHandler();
|
||||
errorMessageHandler.setiShowError(new IShowError() {
|
||||
@Override
|
||||
public void showError(String errorSubject, String errorMsg, int notifType) {
|
||||
if (errorSubject == null || errorSubject.equals("")) {
|
||||
Toast.makeText(instance, errorMsg, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(instance, errorSubject + ": " + errorMsg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected HttpConnectionResult doInBackground(Void... params) {
|
||||
AuditDataType audit = AuditDataTypeGenerator.generateActiveUserAuditData();
|
||||
//GlobalData.getSharedGlobalData().loadFromProperties(instance);
|
||||
GlobalData.getSharedGlobalData().setAuditData(audit);
|
||||
SyncFileRequest request = new SyncFileRequest();
|
||||
request.setAudit(audit);
|
||||
request.setImei(audit.getDeviceId());
|
||||
Date maxdtm = MobileDataFileDataAccess.getMaxTimestamp(instance);
|
||||
request.setDtm_upd(maxdtm);
|
||||
String json = GsonHelper.toJson(request);
|
||||
String url = GlobalData.getSharedGlobalData().getUrlSyncFiles();
|
||||
boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
|
||||
boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
|
||||
HttpCryptedConnection httpConn = new HttpCryptedConnection(instance, encrypt, decrypt);
|
||||
HttpConnectionResult serverResult = null;
|
||||
|
||||
//Firebase Performance Trace HTTP Request
|
||||
HttpMetric networkMetric = FirebasePerformance.getInstance().newHttpMetric(url, FirebasePerformance.HttpMethod.POST);
|
||||
Utility.metricStart(networkMetric, json);
|
||||
|
||||
try {
|
||||
serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
|
||||
Utility.metricStop(networkMetric, serverResult);
|
||||
if (!serverResult.isOK()) {
|
||||
success = false;
|
||||
return serverResult;
|
||||
}
|
||||
JsonResponseSyncFile response = GsonHelper.fromJson(serverResult.getResult(), JsonResponseSyncFile.class);
|
||||
if (response.getStatus().getCode() == 0) {
|
||||
setData(response.getListMobileDataFile());
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
success = false;
|
||||
e.printStackTrace();
|
||||
}
|
||||
return serverResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(HttpConnectionResult connectionResult) {
|
||||
super.onPostExecute(connectionResult);
|
||||
try {
|
||||
if (pDialog.isShowing()) {
|
||||
pDialog.dismiss();
|
||||
pDialog = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
//reset index counter
|
||||
currentidx = -1;
|
||||
|
||||
//jika list tidak kosong maka masuk proses download file
|
||||
if (success) {
|
||||
if (getData() == null || getData().size() == 0) {
|
||||
Toast.makeText(instance, instance.getString(R.string.no_new_files), Toast.LENGTH_SHORT).show();
|
||||
synchronizeCallback();
|
||||
} else {
|
||||
downloadFiles();
|
||||
}
|
||||
} else {
|
||||
if (GlobalData.isRequireRelogin()) {
|
||||
com.adins.mss.foundation.dialog.DialogManager.showForceExitAlert(instance, instance.getString(com.adins.mss.base.R.string.msgLogout));
|
||||
return;
|
||||
}
|
||||
|
||||
errorMessageHandler.processError(connectionResult, instance.getString(R.string.failed_to_get_file), ErrorMessageHandler.TOAST_TYPE);
|
||||
}
|
||||
if (instance != null) {
|
||||
instance = null;
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* method untuk proses download file
|
||||
*/
|
||||
public static void downloadFiles() {
|
||||
currentidx++;
|
||||
int i = currentidx;
|
||||
metadata = getData().get(i);
|
||||
message = instance.getString(R.string.downloading_file, (i + 1), getData().size());
|
||||
link = getData().get(i).getFile_url();
|
||||
savePath = GlobalData.getSharedGlobalData().getSavePath();
|
||||
if (link == null || link.isEmpty()) {
|
||||
link = getData().get(i).getAlternate_file_url();
|
||||
if (link == null || link.isEmpty()) {
|
||||
//popup message bila link kosong
|
||||
Toast.makeText(instance, instance.getString(R.string.no_links_found, getData().get(i).getId_datafile()), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
//memanggil asynctask filedownloader
|
||||
DownloadParams parameters = new DownloadParams(savePath, instance, message, metadata);
|
||||
FileDownloader downloader = new FileDownloader(instance);
|
||||
downloader.execute(parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* method untuk memanggil proses import file
|
||||
*/
|
||||
public static void importFiles() {
|
||||
currentidx++;
|
||||
int i = currentidx;
|
||||
metadata = activeData.get(i);
|
||||
message = instance.getResources().getString(R.string.import_file_to, i + 1, activeData.size());
|
||||
ImportDbParams importParams = new ImportDbParams(instance, message, metadata);
|
||||
new ImportDbFromCsv(instance).execute(importParams);
|
||||
}
|
||||
|
||||
public static void synchronizeCallback() {
|
||||
Message msg = new Message();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("importSuccess", true);
|
||||
msg.setData(bundle);
|
||||
if (instance != null) {
|
||||
instance = null;
|
||||
}
|
||||
try {
|
||||
switch (senderID) {
|
||||
case 0:
|
||||
DefaultLoginModel.importSuccess.sendMessage(msg);
|
||||
break;
|
||||
case 1:
|
||||
AuthenticationTask.importSuccess.sendMessage(msg);
|
||||
break;
|
||||
case 2:
|
||||
DefaultLoginModel.importSuccess.sendMessage(msg);
|
||||
break;
|
||||
default:
|
||||
break; //handle kalau belum dikirim idnya
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
try {
|
||||
AuthenticationTask.importSuccess.sendMessage(msg);
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.adins.mss.base.dynamicform.form.models;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TableAnswerResponse {
|
||||
@SerializedName("tableAnswer")
|
||||
private List<TableAnswer> tableAnswer = null;
|
||||
|
||||
public List<TableAnswer> getTableAnswer() {
|
||||
return tableAnswer;
|
||||
}
|
||||
|
||||
public void setTableAnswer(List<TableAnswer> tableAnswer) {
|
||||
this.tableAnswer = tableAnswer;
|
||||
}
|
||||
|
||||
public class TableAnswer {
|
||||
|
||||
@SerializedName("owner")
|
||||
private String owner;
|
||||
|
||||
@SerializedName("data")
|
||||
private SummaryAnswerBean summaryAnswer;
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public SummaryAnswerBean getSummaryAnswer() {
|
||||
return summaryAnswer;
|
||||
}
|
||||
|
||||
public void setSummaryAnswer(SummaryAnswerBean summaryAnswer) {
|
||||
this.summaryAnswer = summaryAnswer;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.adins.mss.base.errorloghelper;
|
||||
|
||||
import com.adins.mss.dao.ErrorLog;
|
||||
import com.adins.mss.foundation.db.dataaccess.ErrorLogDataAccess;
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
|
||||
/**
|
||||
* Created by ACER 471 on 3/30/2017.
|
||||
*/
|
||||
|
||||
public class ErrorLogHelper {
|
||||
|
||||
private String uuidUser;
|
||||
private String errorMessage;
|
||||
private String deviceModel;
|
||||
|
||||
public ErrorLogHelper(String uuidUser, String errorMessage, String deviceModel) {
|
||||
this.uuidUser = uuidUser;
|
||||
this.errorMessage = errorMessage;
|
||||
this.deviceModel = deviceModel;
|
||||
}
|
||||
|
||||
public void addToTableLogError() {
|
||||
ErrorLog errorLog = new ErrorLog();
|
||||
errorLog.setUuid_error_log(Tool.getUUID());
|
||||
errorLog.setError_description(getErrorMessage());
|
||||
errorLog.setDevice_name(getDeviceModel());
|
||||
errorLog.setDtm_activity(Tool.getSystemDateTime());
|
||||
errorLog.setUuid_user(getUuidUser());
|
||||
ErrorLogDataAccess.addOrReplace(null, errorLog);
|
||||
}
|
||||
|
||||
public String getUuidUser() {
|
||||
return uuidUser;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public String getDeviceModel() {
|
||||
return deviceModel;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,313 @@
|
|||
package com.adins.mss.dao;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteDatabase.CursorFactory;
|
||||
import android.util.Log;
|
||||
|
||||
import de.greenrobot.dao.AbstractDaoMaster;
|
||||
import de.greenrobot.dao.database.StandardDatabase;
|
||||
import de.greenrobot.dao.database.Database;
|
||||
import de.greenrobot.dao.database.EncryptedDatabaseOpenHelper;
|
||||
import de.greenrobot.dao.database.DatabaseOpenHelper;
|
||||
import de.greenrobot.dao.identityscope.IdentityScopeType;
|
||||
|
||||
import com.adins.mss.dao.CollectionActivityDao;
|
||||
import com.adins.mss.dao.InstallmentScheduleDao;
|
||||
import com.adins.mss.dao.MobileDataFileDao;
|
||||
import com.adins.mss.dao.GeneralParameterDao;
|
||||
import com.adins.mss.dao.GroupUserDao;
|
||||
import com.adins.mss.dao.LookupDao;
|
||||
import com.adins.mss.dao.SyncDao;
|
||||
import com.adins.mss.dao.MenuDao;
|
||||
import com.adins.mss.dao.PrintItemDao;
|
||||
import com.adins.mss.dao.QuestionSetDao;
|
||||
import com.adins.mss.dao.SchemeDao;
|
||||
import com.adins.mss.dao.TimelineTypeDao;
|
||||
import com.adins.mss.dao.UserDao;
|
||||
import com.adins.mss.dao.KompetisiDao;
|
||||
import com.adins.mss.dao.LoggerDao;
|
||||
import com.adins.mss.dao.CollectionHistoryDao;
|
||||
import com.adins.mss.dao.CommentDao;
|
||||
import com.adins.mss.dao.DepositReportDDao;
|
||||
import com.adins.mss.dao.DepositReportHDao;
|
||||
import com.adins.mss.dao.ImageResultDao;
|
||||
import com.adins.mss.dao.LocationInfoDao;
|
||||
import com.adins.mss.dao.MessageDao;
|
||||
import com.adins.mss.dao.PaymentHistoryDDao;
|
||||
import com.adins.mss.dao.PaymentHistoryHDao;
|
||||
import com.adins.mss.dao.PaymentChannelDao;
|
||||
import com.adins.mss.dao.PrintResultDao;
|
||||
import com.adins.mss.dao.ReceiptVoucherDao;
|
||||
import com.adins.mss.dao.TaskSummaryDao;
|
||||
import com.adins.mss.dao.TaskDDao;
|
||||
import com.adins.mss.dao.TaskHDao;
|
||||
import com.adins.mss.dao.TaskHSequenceDao;
|
||||
import com.adins.mss.dao.PlanTaskDao;
|
||||
import com.adins.mss.dao.TimelineDao;
|
||||
import com.adins.mss.dao.MobileContentDDao;
|
||||
import com.adins.mss.dao.MobileContentHDao;
|
||||
import com.adins.mss.dao.HolidayDao;
|
||||
import com.adins.mss.dao.PrintDateDao;
|
||||
import com.adins.mss.dao.ErrorLogDao;
|
||||
import com.adins.mss.dao.AccountDao;
|
||||
import com.adins.mss.dao.ProductDao;
|
||||
import com.adins.mss.dao.ContactDao;
|
||||
import com.adins.mss.dao.GroupTaskDao;
|
||||
import com.adins.mss.dao.CatalogueDao;
|
||||
import com.adins.mss.dao.ThemeItemDao;
|
||||
import com.adins.mss.dao.ThemeDao;
|
||||
import com.adins.mss.dao.LogoPrintDao;
|
||||
import com.adins.mss.dao.EmergencyDao;
|
||||
import com.adins.mss.dao.LastSyncDao;
|
||||
import com.adins.mss.dao.BankAccountOfBranchDao;
|
||||
import com.adins.mss.dao.BroadcastDao;
|
||||
import com.adins.mss.dao.ReceiptHistoryDao;
|
||||
import com.adins.mss.migration.MigrationV12toV13;
|
||||
|
||||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
|
||||
/**
|
||||
* Master of DAO (schema version 13): knows all DAOs.
|
||||
*/
|
||||
public class DaoMaster extends AbstractDaoMaster {
|
||||
public static final int SCHEMA_VERSION = 13;
|
||||
|
||||
/** Creates underlying database table using DAOs. */
|
||||
public static void createAllTables(Database db, boolean ifNotExists) {
|
||||
CollectionActivityDao.createTable(db, ifNotExists);
|
||||
InstallmentScheduleDao.createTable(db, ifNotExists);
|
||||
MobileDataFileDao.createTable(db, ifNotExists);
|
||||
GeneralParameterDao.createTable(db, ifNotExists);
|
||||
GroupUserDao.createTable(db, ifNotExists);
|
||||
LookupDao.createTable(db, ifNotExists);
|
||||
SyncDao.createTable(db, ifNotExists);
|
||||
MenuDao.createTable(db, ifNotExists);
|
||||
PrintItemDao.createTable(db, ifNotExists);
|
||||
QuestionSetDao.createTable(db, ifNotExists);
|
||||
SchemeDao.createTable(db, ifNotExists);
|
||||
TimelineTypeDao.createTable(db, ifNotExists);
|
||||
UserDao.createTable(db, ifNotExists);
|
||||
KompetisiDao.createTable(db, ifNotExists);
|
||||
LoggerDao.createTable(db, ifNotExists);
|
||||
CollectionHistoryDao.createTable(db, ifNotExists);
|
||||
CommentDao.createTable(db, ifNotExists);
|
||||
DepositReportDDao.createTable(db, ifNotExists);
|
||||
DepositReportHDao.createTable(db, ifNotExists);
|
||||
ImageResultDao.createTable(db, ifNotExists);
|
||||
LocationInfoDao.createTable(db, ifNotExists);
|
||||
MessageDao.createTable(db, ifNotExists);
|
||||
PaymentHistoryDDao.createTable(db, ifNotExists);
|
||||
PaymentHistoryHDao.createTable(db, ifNotExists);
|
||||
PaymentChannelDao.createTable(db, ifNotExists);
|
||||
PrintResultDao.createTable(db, ifNotExists);
|
||||
ReceiptVoucherDao.createTable(db, ifNotExists);
|
||||
TaskSummaryDao.createTable(db, ifNotExists);
|
||||
TaskDDao.createTable(db, ifNotExists);
|
||||
TaskHDao.createTable(db, ifNotExists);
|
||||
TaskHSequenceDao.createTable(db, ifNotExists);
|
||||
PlanTaskDao.createTable(db, ifNotExists);
|
||||
TimelineDao.createTable(db, ifNotExists);
|
||||
MobileContentDDao.createTable(db, ifNotExists);
|
||||
MobileContentHDao.createTable(db, ifNotExists);
|
||||
HolidayDao.createTable(db, ifNotExists);
|
||||
PrintDateDao.createTable(db, ifNotExists);
|
||||
ErrorLogDao.createTable(db, ifNotExists);
|
||||
AccountDao.createTable(db, ifNotExists);
|
||||
ProductDao.createTable(db, ifNotExists);
|
||||
ContactDao.createTable(db, ifNotExists);
|
||||
GroupTaskDao.createTable(db, ifNotExists);
|
||||
CatalogueDao.createTable(db, ifNotExists);
|
||||
ThemeItemDao.createTable(db, ifNotExists);
|
||||
ThemeDao.createTable(db, ifNotExists);
|
||||
LogoPrintDao.createTable(db, ifNotExists);
|
||||
EmergencyDao.createTable(db, ifNotExists);
|
||||
LastSyncDao.createTable(db, ifNotExists);
|
||||
BankAccountOfBranchDao.createTable(db, ifNotExists);
|
||||
BroadcastDao.createTable(db, ifNotExists);
|
||||
ReceiptHistoryDao.createTable(db, ifNotExists);
|
||||
}
|
||||
|
||||
/** Drops underlying database table using DAOs. */
|
||||
public static void dropAllTables(Database db, boolean ifExists) {
|
||||
CollectionActivityDao.dropTable(db, ifExists);
|
||||
InstallmentScheduleDao.dropTable(db, ifExists);
|
||||
MobileDataFileDao.dropTable(db, ifExists);
|
||||
GeneralParameterDao.dropTable(db, ifExists);
|
||||
GroupUserDao.dropTable(db, ifExists);
|
||||
LookupDao.dropTable(db, ifExists);
|
||||
SyncDao.dropTable(db, ifExists);
|
||||
MenuDao.dropTable(db, ifExists);
|
||||
PrintItemDao.dropTable(db, ifExists);
|
||||
QuestionSetDao.dropTable(db, ifExists);
|
||||
SchemeDao.dropTable(db, ifExists);
|
||||
TimelineTypeDao.dropTable(db, ifExists);
|
||||
UserDao.dropTable(db, ifExists);
|
||||
KompetisiDao.dropTable(db, ifExists);
|
||||
LoggerDao.dropTable(db, ifExists);
|
||||
CollectionHistoryDao.dropTable(db, ifExists);
|
||||
CommentDao.dropTable(db, ifExists);
|
||||
DepositReportDDao.dropTable(db, ifExists);
|
||||
DepositReportHDao.dropTable(db, ifExists);
|
||||
ImageResultDao.dropTable(db, ifExists);
|
||||
LocationInfoDao.dropTable(db, ifExists);
|
||||
MessageDao.dropTable(db, ifExists);
|
||||
PaymentHistoryDDao.dropTable(db, ifExists);
|
||||
PaymentHistoryHDao.dropTable(db, ifExists);
|
||||
PaymentChannelDao.dropTable(db, ifExists);
|
||||
PrintResultDao.dropTable(db, ifExists);
|
||||
ReceiptVoucherDao.dropTable(db, ifExists);
|
||||
TaskSummaryDao.dropTable(db, ifExists);
|
||||
TaskDDao.dropTable(db, ifExists);
|
||||
TaskHDao.dropTable(db, ifExists);
|
||||
TaskHSequenceDao.dropTable(db, ifExists);
|
||||
PlanTaskDao.dropTable(db, ifExists);
|
||||
TimelineDao.dropTable(db, ifExists);
|
||||
MobileContentDDao.dropTable(db, ifExists);
|
||||
MobileContentHDao.dropTable(db, ifExists);
|
||||
HolidayDao.dropTable(db, ifExists);
|
||||
PrintDateDao.dropTable(db, ifExists);
|
||||
ErrorLogDao.dropTable(db, ifExists);
|
||||
AccountDao.dropTable(db, ifExists);
|
||||
ProductDao.dropTable(db, ifExists);
|
||||
ContactDao.dropTable(db, ifExists);
|
||||
GroupTaskDao.dropTable(db, ifExists);
|
||||
CatalogueDao.dropTable(db, ifExists);
|
||||
ThemeItemDao.dropTable(db, ifExists);
|
||||
ThemeDao.dropTable(db, ifExists);
|
||||
LogoPrintDao.dropTable(db, ifExists);
|
||||
EmergencyDao.dropTable(db, ifExists);
|
||||
LastSyncDao.dropTable(db, ifExists);
|
||||
BankAccountOfBranchDao.dropTable(db, ifExists);
|
||||
BroadcastDao.dropTable(db, ifExists);
|
||||
ReceiptHistoryDao.dropTable(db, ifExists);
|
||||
}
|
||||
|
||||
public static abstract class OpenHelper extends DatabaseOpenHelper {
|
||||
public OpenHelper(Context context, String name) {
|
||||
super(context, name, SCHEMA_VERSION);
|
||||
}
|
||||
public OpenHelper(Context context, String name, CursorFactory factory) {
|
||||
super(context, name, factory, SCHEMA_VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Database db) {
|
||||
Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
|
||||
createAllTables(db, false);
|
||||
}
|
||||
}
|
||||
|
||||
/** WARNING: Drops all table on Upgrade! Use only during development. */
|
||||
public static class DevOpenHelper extends OpenHelper {
|
||||
public DevOpenHelper(Context context, String name) {
|
||||
super(context, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(Database db, int oldVersion, int newVersion) {
|
||||
Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
|
||||
MigrationV12toV13.execute(db, oldVersion);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class EncryptedOpenHelper extends EncryptedDatabaseOpenHelper {
|
||||
public EncryptedOpenHelper(Context context, String name) {
|
||||
super(context, name, SCHEMA_VERSION);
|
||||
}
|
||||
|
||||
public EncryptedOpenHelper(Context context, String name, Object cursorFactory, boolean loadNativeLibs) {
|
||||
super(context, name, cursorFactory, SCHEMA_VERSION, loadNativeLibs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Database db) {
|
||||
Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
|
||||
createAllTables(db, false);
|
||||
}
|
||||
}
|
||||
|
||||
/** WARNING: Drops all table on Upgrade! Use only during development. */
|
||||
public static class EncryptedDevOpenHelper extends EncryptedOpenHelper {
|
||||
public EncryptedDevOpenHelper(Context context, String name) {
|
||||
super(context, name);
|
||||
}
|
||||
|
||||
public EncryptedDevOpenHelper(Context context, String name, Object cursorFactory, boolean loadNativeLibs) {
|
||||
super(context, name, cursorFactory, loadNativeLibs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(Database db, int oldVersion, int newVersion) {
|
||||
Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
|
||||
MigrationV12toV13.execute(db, oldVersion);
|
||||
}
|
||||
}
|
||||
|
||||
public DaoMaster(SQLiteDatabase db) {
|
||||
this(new StandardDatabase(db));
|
||||
}
|
||||
|
||||
public DaoMaster(Database db) {
|
||||
super(db, SCHEMA_VERSION);
|
||||
registerDaoClass(CollectionActivityDao.class);
|
||||
registerDaoClass(InstallmentScheduleDao.class);
|
||||
registerDaoClass(MobileDataFileDao.class);
|
||||
registerDaoClass(GeneralParameterDao.class);
|
||||
registerDaoClass(GroupUserDao.class);
|
||||
registerDaoClass(LookupDao.class);
|
||||
registerDaoClass(SyncDao.class);
|
||||
registerDaoClass(MenuDao.class);
|
||||
registerDaoClass(PrintItemDao.class);
|
||||
registerDaoClass(QuestionSetDao.class);
|
||||
registerDaoClass(SchemeDao.class);
|
||||
registerDaoClass(TimelineTypeDao.class);
|
||||
registerDaoClass(UserDao.class);
|
||||
registerDaoClass(KompetisiDao.class);
|
||||
registerDaoClass(LoggerDao.class);
|
||||
registerDaoClass(CollectionHistoryDao.class);
|
||||
registerDaoClass(CommentDao.class);
|
||||
registerDaoClass(DepositReportDDao.class);
|
||||
registerDaoClass(DepositReportHDao.class);
|
||||
registerDaoClass(ImageResultDao.class);
|
||||
registerDaoClass(LocationInfoDao.class);
|
||||
registerDaoClass(MessageDao.class);
|
||||
registerDaoClass(PaymentHistoryDDao.class);
|
||||
registerDaoClass(PaymentHistoryHDao.class);
|
||||
registerDaoClass(PaymentChannelDao.class);
|
||||
registerDaoClass(PrintResultDao.class);
|
||||
registerDaoClass(ReceiptVoucherDao.class);
|
||||
registerDaoClass(TaskSummaryDao.class);
|
||||
registerDaoClass(TaskDDao.class);
|
||||
registerDaoClass(TaskHDao.class);
|
||||
registerDaoClass(TaskHSequenceDao.class);
|
||||
registerDaoClass(PlanTaskDao.class);
|
||||
registerDaoClass(TimelineDao.class);
|
||||
registerDaoClass(MobileContentDDao.class);
|
||||
registerDaoClass(MobileContentHDao.class);
|
||||
registerDaoClass(HolidayDao.class);
|
||||
registerDaoClass(PrintDateDao.class);
|
||||
registerDaoClass(ErrorLogDao.class);
|
||||
registerDaoClass(AccountDao.class);
|
||||
registerDaoClass(ProductDao.class);
|
||||
registerDaoClass(ContactDao.class);
|
||||
registerDaoClass(GroupTaskDao.class);
|
||||
registerDaoClass(CatalogueDao.class);
|
||||
registerDaoClass(ThemeItemDao.class);
|
||||
registerDaoClass(ThemeDao.class);
|
||||
registerDaoClass(LogoPrintDao.class);
|
||||
registerDaoClass(EmergencyDao.class);
|
||||
registerDaoClass(LastSyncDao.class);
|
||||
registerDaoClass(BankAccountOfBranchDao.class);
|
||||
registerDaoClass(BroadcastDao.class);
|
||||
registerDaoClass(ReceiptHistoryDao.class);
|
||||
}
|
||||
|
||||
public DaoSession newSession() {
|
||||
return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
|
||||
}
|
||||
|
||||
public DaoSession newSession(IdentityScopeType type) {
|
||||
return new DaoSession(db, type, daoConfigMap);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.adins.mss.base.todolist.form;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class JsonRequestTaskList extends MssRequestType {
|
||||
@SerializedName("username")
|
||||
String username;
|
||||
@SerializedName("password")
|
||||
String password;
|
||||
@SerializedName("flagFreshInstall")
|
||||
String flagFreshInstall;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getFlagFreshInstall() {
|
||||
return flagFreshInstall;
|
||||
}
|
||||
|
||||
public void setFlagFreshInstall(String flagFreshInstall) {
|
||||
this.flagFreshInstall = flagFreshInstall;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/txtLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/title"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextAnswer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10">
|
||||
</EditText>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradient_end"
|
||||
android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"/>
|
||||
</vector>
|
Loading…
Add table
Add a link
Reference in a new issue