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
Binary file not shown.
|
@ -0,0 +1,93 @@
|
|||
package com.adins.mss.odr.accounts.adapter;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.TaskH;
|
||||
import com.adins.mss.foundation.formatter.Formatter;
|
||||
import com.adins.mss.odr.R;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by olivia.dg on 11/21/2017.
|
||||
*/
|
||||
|
||||
public class ActivityTodoAdapter extends RecyclerView.Adapter<ActivityTodoAdapter.ActivityTodoViewholder> {
|
||||
private static FragmentActivity activity;
|
||||
private List<TaskH> listTask;
|
||||
|
||||
public ActivityTodoAdapter(FragmentActivity activity, List<TaskH> listTask) {
|
||||
this.activity = activity;
|
||||
this.listTask = listTask;
|
||||
}
|
||||
|
||||
public class ActivityTodoViewholder extends RecyclerView.ViewHolder {
|
||||
public final TextView txtId;
|
||||
public final TextView txtDate;
|
||||
public final TextView txtStatus;
|
||||
public final TextView txtNotes;
|
||||
|
||||
public ActivityTodoViewholder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
txtId = (TextView) itemView.findViewById(R.id.txtId);
|
||||
txtDate = (TextView) itemView.findViewById(R.id.txtDate);
|
||||
txtStatus = (TextView) itemView.findViewById(R.id.txtStatus);
|
||||
txtNotes = (TextView) itemView.findViewById(R.id.txtNotes);
|
||||
}
|
||||
|
||||
public void bind(TaskH taskH) {
|
||||
txtId.setText(taskH.getTask_id());
|
||||
txtStatus.setText(taskH.getStatus_code());
|
||||
txtNotes.setText(taskH.getNotes());
|
||||
|
||||
String str_dtm_crt = "";
|
||||
Date date;
|
||||
|
||||
if (taskH.getSubmit_date() == null) {
|
||||
if (taskH.getPts_date() != null)
|
||||
date = taskH.getPts_date();
|
||||
else
|
||||
date = taskH.getAssignment_date();
|
||||
|
||||
if (date != null)
|
||||
str_dtm_crt = Formatter.formatDate(date, Global.DATE_STR_FORMAT5);
|
||||
|
||||
txtStatus.setVisibility(View.GONE );
|
||||
} else {
|
||||
date = taskH.getSubmit_date();
|
||||
if (date != null)
|
||||
str_dtm_crt = Formatter.formatDate(date, Global.DATE_TIMESEC_TIMELINE_FORMAT_OLD);
|
||||
}
|
||||
|
||||
txtDate.setText(str_dtm_crt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityTodoViewholder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.opportunity_detail_item, parent, false);
|
||||
ActivityTodoViewholder viewHolder = new ActivityTodoViewholder(v);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ActivityTodoViewholder holder, int position) {
|
||||
holder.bind(listTask.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (listTask == null || listTask.size() == 0)
|
||||
return 0;
|
||||
else
|
||||
return listTask.size();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.adins.mss.foundation.image;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class ThumbnailBitmapWorkerTask extends AsyncTask<Void, Void, Bitmap> {
|
||||
private final WeakReference<ImageView> imageViewReference;
|
||||
private final byte[] data;
|
||||
private final Activity mContext;
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
public ThumbnailBitmapWorkerTask(Activity context, ImageView imageView, byte[] data) {
|
||||
imageViewReference = new WeakReference<ImageView>(imageView);
|
||||
this.data = data;
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uncomment if using progress bar
|
||||
* /* @Override
|
||||
* protected void onPreExecute() {
|
||||
* super.onPreExecute();
|
||||
* progressDialog = ProgressDialog.show(mContext, "", mContext.getString(R.string.processing_image), true);
|
||||
* }
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected Bitmap doInBackground(Void... params) {
|
||||
try {
|
||||
if (data != null) {
|
||||
Bitmap bm = Utils.byteToBitmap(data);
|
||||
int[] res = new int[2];
|
||||
res[0] = bm.getWidth();
|
||||
res[1] = bm.getHeight();
|
||||
int[] thumbRes = Utils.getSmallResolution(bm.getWidth(), bm.getHeight());
|
||||
Bitmap thumbnail = Bitmap.createScaledBitmap(bm, thumbRes[0], thumbRes[1], true);
|
||||
return thumbnail;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(final Bitmap bitmap) {
|
||||
super.onPostExecute(bitmap);
|
||||
/**Uncomment if using progress bar
|
||||
/*if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}*/
|
||||
if (imageViewReference != null) {
|
||||
final ImageView imageView = imageViewReference.get();
|
||||
if (imageView != null) {
|
||||
if (bitmap != null)
|
||||
imageView.setImageBitmap(bitmap);
|
||||
else
|
||||
imageView.setImageResource(R.drawable.ic_camera);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.adins.mss.foundation.sync.api.model;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adityapurwa on 11/03/15.
|
||||
*/
|
||||
public class SynchronizeRequestModel extends MssRequestType {
|
||||
@SerializedName("tableName")
|
||||
protected String tableName;
|
||||
@SerializedName("dtm_upd")
|
||||
protected Date dtm_upd;
|
||||
@SerializedName("list")
|
||||
protected List list;
|
||||
@SerializedName("init")
|
||||
protected int init;
|
||||
@SerializedName("LOGIN_ID")
|
||||
public String loginId;
|
||||
|
||||
public String getLoginId() {
|
||||
return loginId;
|
||||
}
|
||||
|
||||
public void setLoginId(String loginId) {
|
||||
this.loginId = loginId;
|
||||
}
|
||||
|
||||
public SynchronizeRequestModel() {
|
||||
}
|
||||
|
||||
public SynchronizeRequestModel(SynchronizeRequestModel requestModel) {
|
||||
this.tableName = requestModel.getTableName();
|
||||
if (requestModel.getDtm_upd() != null)
|
||||
this.dtm_upd = requestModel.getDtm_upd();
|
||||
if (requestModel.getList() != null)
|
||||
this.list = requestModel.getList();
|
||||
this.init = requestModel.getInit();
|
||||
}
|
||||
|
||||
public List getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public Date getDtm_upd() {
|
||||
return dtm_upd;
|
||||
}
|
||||
|
||||
public void setDtm_upd(Date dtm_upd) {
|
||||
this.dtm_upd = dtm_upd;
|
||||
}
|
||||
|
||||
public int getInit() {
|
||||
return init;
|
||||
}
|
||||
|
||||
public void setInit(int init) {
|
||||
this.init = init;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package com.adins.mss.coll.loyalti.barchart;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import com.adins.mss.coll.models.loyaltymodels.RankDetail;
|
||||
|
||||
import com.github.mikephil.charting.buffer.BarBuffer;
|
||||
import com.github.mikephil.charting.charts.BarChart;
|
||||
import com.github.mikephil.charting.data.BarEntry;
|
||||
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
|
||||
import com.github.mikephil.charting.renderer.BarChartRenderer;
|
||||
|
||||
public class LoyaltyBarChartRenderer extends BarChartRenderer {
|
||||
|
||||
private RankDetail[][] rankDataSet;
|
||||
private Paint textPaint;
|
||||
private float textSizeMultiplier;
|
||||
private float textOffset;
|
||||
|
||||
public LoyaltyBarChartRenderer(BarChart chart, RankDetail[][] rankDataSet, float textSizeMultiplier, float textOffset) {
|
||||
super(chart, chart.getAnimator(), chart.getViewPortHandler());
|
||||
this.rankDataSet = rankDataSet;
|
||||
this.textPaint = new Paint();
|
||||
this.textSizeMultiplier = textSizeMultiplier;
|
||||
this.textOffset = textOffset;
|
||||
textPaint.setColor(Color.BLACK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawDataSet(Canvas c, IBarDataSet dataSet, int index) {
|
||||
super.drawDataSet(c, dataSet, index);//draw default bar
|
||||
drawRanksText(c,dataSet,index);//tambah draw rank disini
|
||||
}
|
||||
|
||||
private void drawRanksText(Canvas canvas,IBarDataSet dataSet,int index){
|
||||
BarBuffer buffer = mBarBuffers[index];
|
||||
|
||||
float left;//simpan pos kiri bar
|
||||
float right;//simpan pos kanan bar
|
||||
float top;//simpan pos atas bar
|
||||
float bottom;//simpan pos bawah bar
|
||||
float offsetLeft;
|
||||
float marginPerRank;
|
||||
|
||||
BarEntry entry = dataSet.getEntryForIndex(index);
|
||||
int stackLength = entry.getYVals().length;//dapatkan length stack
|
||||
|
||||
for (int j = 0,rankIdx = 0; j < buffer.buffer.length * mAnimator.getPhaseX(); j += (4*stackLength)) {
|
||||
left = buffer.buffer[j];
|
||||
right = buffer.buffer[j + 2];
|
||||
top = buffer.buffer[j + 1];
|
||||
bottom = buffer.buffer[j + 3];
|
||||
|
||||
float x = (left + right) / 2f;
|
||||
float barWidth = right-left;
|
||||
textPaint.setTextSize(barWidth * textSizeMultiplier);
|
||||
marginPerRank = textPaint.getTextSize();
|
||||
offsetLeft = barWidth + textOffset;
|
||||
|
||||
if (!mViewPortHandler.isInBoundsRight(x) || !mViewPortHandler.isInBoundsLeft(x)){
|
||||
rankIdx += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
//draw ranks text from bottom to top of bar
|
||||
if(rankDataSet == null)
|
||||
break;
|
||||
|
||||
if(rankIdx >= rankDataSet.length)
|
||||
continue;
|
||||
|
||||
for (int r=0; r<rankDataSet[rankIdx].length; r++) {
|
||||
drawText(rankDataSet[rankIdx][r],canvas,x-offsetLeft,bottom - ((r+1)*marginPerRank) - (r*textPaint.getTextSize()));
|
||||
}
|
||||
rankIdx += 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void drawText(RankDetail rankData,Canvas c,float x, float y){
|
||||
textPaint.setColor(rankData.colorValue);
|
||||
c.drawText(String.valueOf(rankData.rank),x,y,textPaint);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.adins.mss.dummy.userhelp_dummy.Adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.constant.Global;
|
||||
|
||||
public class PriorityDummyAdapter extends RecyclerView.Adapter<PriorityDummyAdapter.PriorityDummyHolder> {
|
||||
@NonNull
|
||||
@Override
|
||||
public PriorityDummyHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
||||
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.dummy_userhelp_task_list_item,viewGroup,false);
|
||||
PriorityDummyHolder viewHolder = new PriorityDummyHolder(v);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull PriorityDummyHolder priorityDummyHolder, int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public class PriorityDummyHolder extends RecyclerView.ViewHolder {
|
||||
public PriorityDummyHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
TextView txtSla = itemView.findViewById(R.id.txtslatime);
|
||||
if(Global.APPLICATION_SURVEY.equalsIgnoreCase(GlobalData.getSharedGlobalData().getAuditData().getApplication())){
|
||||
txtSla.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,320 @@
|
|||
package com.adins.mss.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import android.database.Cursor;
|
||||
|
||||
import de.greenrobot.dao.AbstractDao;
|
||||
import de.greenrobot.dao.Property;
|
||||
import de.greenrobot.dao.internal.SqlUtils;
|
||||
import de.greenrobot.dao.internal.DaoConfig;
|
||||
import de.greenrobot.dao.database.Database;
|
||||
import de.greenrobot.dao.database.DatabaseStatement;
|
||||
import de.greenrobot.dao.query.Query;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
import com.adins.mss.dao.ImageResult;
|
||||
|
||||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
|
||||
/**
|
||||
* DAO for table "TR_IMAGERESULT".
|
||||
*/
|
||||
public class ImageResultDao extends AbstractDao<ImageResult, String> {
|
||||
|
||||
public static final String TABLENAME = "TR_IMAGERESULT";
|
||||
|
||||
/**
|
||||
* Properties of entity ImageResult.<br/>
|
||||
* Can be used for QueryBuilder and for referencing column names.
|
||||
*/
|
||||
public static class Properties {
|
||||
public final static Property Uuid_image_result = new Property(0, String.class, "uuid_image_result", true, "UUID_IMAGE_RESULT");
|
||||
public final static Property Question_id = new Property(1, String.class, "question_id", false, "QUESTION_ID");
|
||||
public final static Property Submit_duration = new Property(2, String.class, "submit_duration", false, "SUBMIT_DURATION");
|
||||
public final static Property Submit_size = new Property(3, String.class, "submit_size", false, "SUBMIT_SIZE");
|
||||
public final static Property Total_image = new Property(4, Integer.class, "total_image", false, "TOTAL_IMAGE");
|
||||
public final static Property Count_image = new Property(5, Integer.class, "count_image", false, "COUNT_IMAGE");
|
||||
public final static Property Submit_date = new Property(6, java.util.Date.class, "submit_date", false, "SUBMIT_DATE");
|
||||
public final static Property Submit_result = new Property(7, String.class, "submit_result", false, "SUBMIT_RESULT");
|
||||
public final static Property Question_group_id = new Property(8, String.class, "question_group_id", false, "QUESTION_GROUP_ID");
|
||||
public final static Property Usr_crt = new Property(9, String.class, "usr_crt", false, "USR_CRT");
|
||||
public final static Property Dtm_crt = new Property(10, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
|
||||
public final static Property Uuid_task_h = new Property(11, String.class, "uuid_task_h", false, "UUID_TASK_H");
|
||||
};
|
||||
|
||||
private DaoSession daoSession;
|
||||
|
||||
private Query<ImageResult> taskH_ImageResultListQuery;
|
||||
|
||||
public ImageResultDao(DaoConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
public ImageResultDao(DaoConfig config, DaoSession daoSession) {
|
||||
super(config, daoSession);
|
||||
this.daoSession = daoSession;
|
||||
}
|
||||
|
||||
/** Creates the underlying database table. */
|
||||
public static void createTable(Database db, boolean ifNotExists) {
|
||||
String constraint = ifNotExists? "IF NOT EXISTS ": "";
|
||||
db.execSQL("CREATE TABLE " + constraint + "\"TR_IMAGERESULT\" (" + //
|
||||
"\"UUID_IMAGE_RESULT\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_image_result
|
||||
"\"QUESTION_ID\" TEXT," + // 1: question_id
|
||||
"\"SUBMIT_DURATION\" TEXT," + // 2: submit_duration
|
||||
"\"SUBMIT_SIZE\" TEXT," + // 3: submit_size
|
||||
"\"TOTAL_IMAGE\" INTEGER," + // 4: total_image
|
||||
"\"COUNT_IMAGE\" INTEGER," + // 5: count_image
|
||||
"\"SUBMIT_DATE\" INTEGER," + // 6: submit_date
|
||||
"\"SUBMIT_RESULT\" TEXT," + // 7: submit_result
|
||||
"\"QUESTION_GROUP_ID\" TEXT," + // 8: question_group_id
|
||||
"\"USR_CRT\" TEXT," + // 9: usr_crt
|
||||
"\"DTM_CRT\" INTEGER," + // 10: dtm_crt
|
||||
"\"UUID_TASK_H\" TEXT);"); // 11: uuid_task_h
|
||||
}
|
||||
|
||||
/** Drops the underlying database table. */
|
||||
public static void dropTable(Database db, boolean ifExists) {
|
||||
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TR_IMAGERESULT\"";
|
||||
db.execSQL(sql);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected void bindValues(DatabaseStatement stmt, ImageResult entity) {
|
||||
stmt.clearBindings();
|
||||
stmt.bindString(1, entity.getUuid_image_result());
|
||||
|
||||
String question_id = entity.getQuestion_id();
|
||||
if (question_id != null) {
|
||||
stmt.bindString(2, question_id);
|
||||
}
|
||||
|
||||
String submit_duration = entity.getSubmit_duration();
|
||||
if (submit_duration != null) {
|
||||
stmt.bindString(3, submit_duration);
|
||||
}
|
||||
|
||||
String submit_size = entity.getSubmit_size();
|
||||
if (submit_size != null) {
|
||||
stmt.bindString(4, submit_size);
|
||||
}
|
||||
|
||||
Integer total_image = entity.getTotal_image();
|
||||
if (total_image != null) {
|
||||
stmt.bindLong(5, total_image);
|
||||
}
|
||||
|
||||
Integer count_image = entity.getCount_image();
|
||||
if (count_image != null) {
|
||||
stmt.bindLong(6, count_image);
|
||||
}
|
||||
|
||||
java.util.Date submit_date = entity.getSubmit_date();
|
||||
if (submit_date != null) {
|
||||
stmt.bindLong(7, submit_date.getTime());
|
||||
}
|
||||
|
||||
String submit_result = entity.getSubmit_result();
|
||||
if (submit_result != null) {
|
||||
stmt.bindString(8, submit_result);
|
||||
}
|
||||
|
||||
String question_group_id = entity.getQuestion_group_id();
|
||||
if (question_group_id != null) {
|
||||
stmt.bindString(9, question_group_id);
|
||||
}
|
||||
|
||||
String usr_crt = entity.getUsr_crt();
|
||||
if (usr_crt != null) {
|
||||
stmt.bindString(10, usr_crt);
|
||||
}
|
||||
|
||||
java.util.Date dtm_crt = entity.getDtm_crt();
|
||||
if (dtm_crt != null) {
|
||||
stmt.bindLong(11, dtm_crt.getTime());
|
||||
}
|
||||
|
||||
String uuid_task_h = entity.getUuid_task_h();
|
||||
if (uuid_task_h != null) {
|
||||
stmt.bindString(12, uuid_task_h);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachEntity(ImageResult entity) {
|
||||
super.attachEntity(entity);
|
||||
entity.__setDaoSession(daoSession);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public String readKey(Cursor cursor, int offset) {
|
||||
return cursor.getString(offset + 0);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public ImageResult readEntity(Cursor cursor, int offset) {
|
||||
ImageResult entity = new ImageResult( //
|
||||
cursor.getString(offset + 0), // uuid_image_result
|
||||
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // question_id
|
||||
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // submit_duration
|
||||
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // submit_size
|
||||
cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // total_image
|
||||
cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // count_image
|
||||
cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6)), // submit_date
|
||||
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // submit_result
|
||||
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // question_group_id
|
||||
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // usr_crt
|
||||
cursor.isNull(offset + 10) ? null : new java.util.Date(cursor.getLong(offset + 10)), // dtm_crt
|
||||
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // uuid_task_h
|
||||
);
|
||||
return entity;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public void readEntity(Cursor cursor, ImageResult entity, int offset) {
|
||||
entity.setUuid_image_result(cursor.getString(offset + 0));
|
||||
entity.setQuestion_id(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
|
||||
entity.setSubmit_duration(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
|
||||
entity.setSubmit_size(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
|
||||
entity.setTotal_image(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4));
|
||||
entity.setCount_image(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
|
||||
entity.setSubmit_date(cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6)));
|
||||
entity.setSubmit_result(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
|
||||
entity.setQuestion_group_id(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
|
||||
entity.setUsr_crt(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
|
||||
entity.setDtm_crt(cursor.isNull(offset + 10) ? null : new java.util.Date(cursor.getLong(offset + 10)));
|
||||
entity.setUuid_task_h(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected String updateKeyAfterInsert(ImageResult entity, long rowId) {
|
||||
return entity.getUuid_image_result();
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public String getKey(ImageResult entity) {
|
||||
if(entity != null) {
|
||||
return entity.getUuid_image_result();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected boolean isEntityUpdateable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Internal query to resolve the "imageResultList" to-many relationship of TaskH. */
|
||||
public List<ImageResult> _queryTaskH_ImageResultList(String uuid_task_h) {
|
||||
synchronized (this) {
|
||||
if (taskH_ImageResultListQuery == null) {
|
||||
QueryBuilder<ImageResult> queryBuilder = queryBuilder();
|
||||
queryBuilder.where(Properties.Uuid_task_h.eq(null));
|
||||
taskH_ImageResultListQuery = queryBuilder.build();
|
||||
}
|
||||
}
|
||||
Query<ImageResult> query = taskH_ImageResultListQuery.forCurrentThread();
|
||||
query.setParameter(0, uuid_task_h);
|
||||
return query.list();
|
||||
}
|
||||
|
||||
private String selectDeep;
|
||||
|
||||
protected String getSelectDeep() {
|
||||
if (selectDeep == null) {
|
||||
StringBuilder builder = new StringBuilder("SELECT ");
|
||||
SqlUtils.appendColumns(builder, "T", getAllColumns());
|
||||
builder.append(',');
|
||||
SqlUtils.appendColumns(builder, "T0", daoSession.getTaskHDao().getAllColumns());
|
||||
builder.append(" FROM TR_IMAGERESULT T");
|
||||
builder.append(" LEFT JOIN TR_TASK_H T0 ON T.\"UUID_TASK_H\"=T0.\"UUID_TASK_H\"");
|
||||
builder.append(' ');
|
||||
selectDeep = builder.toString();
|
||||
}
|
||||
return selectDeep;
|
||||
}
|
||||
|
||||
protected ImageResult loadCurrentDeep(Cursor cursor, boolean lock) {
|
||||
ImageResult entity = loadCurrent(cursor, 0, lock);
|
||||
int offset = getAllColumns().length;
|
||||
|
||||
TaskH taskH = loadCurrentOther(daoSession.getTaskHDao(), cursor, offset);
|
||||
entity.setTaskH(taskH);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public ImageResult loadDeep(Long key) {
|
||||
assertSinglePk();
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder(getSelectDeep());
|
||||
builder.append("WHERE ");
|
||||
SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
|
||||
String sql = builder.toString();
|
||||
|
||||
String[] keyArray = new String[] { key.toString() };
|
||||
Cursor cursor = db.rawQuery(sql, keyArray);
|
||||
|
||||
try {
|
||||
boolean available = cursor.moveToFirst();
|
||||
if (!available) {
|
||||
return null;
|
||||
} else if (!cursor.isLast()) {
|
||||
throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
|
||||
}
|
||||
return loadCurrentDeep(cursor, true);
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
/** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
|
||||
public List<ImageResult> loadAllDeepFromCursor(Cursor cursor) {
|
||||
int count = cursor.getCount();
|
||||
List<ImageResult> list = new ArrayList<ImageResult>(count);
|
||||
|
||||
if (cursor.moveToFirst()) {
|
||||
if (identityScope != null) {
|
||||
identityScope.lock();
|
||||
identityScope.reserveRoom(count);
|
||||
}
|
||||
try {
|
||||
do {
|
||||
list.add(loadCurrentDeep(cursor, false));
|
||||
} while (cursor.moveToNext());
|
||||
} finally {
|
||||
if (identityScope != null) {
|
||||
identityScope.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
protected List<ImageResult> loadDeepAllAndCloseCursor(Cursor cursor) {
|
||||
try {
|
||||
return loadAllDeepFromCursor(cursor);
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** A raw-style query where you can pass any WHERE clause and arguments. */
|
||||
public List<ImageResult> queryDeep(String where, String... selectionArg) {
|
||||
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
|
||||
return loadDeepAllAndCloseCursor(cursor);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package org.acra.util;
|
||||
|
||||
/**
|
||||
* Thrown when an error occurs during reflection.
|
||||
*/
|
||||
public final class ReflectionException extends Exception {
|
||||
|
||||
public ReflectionException(String msg, Throwable th) {
|
||||
super(msg, th);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding= "utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<translate android:fromXDelta="0"
|
||||
android:fromYDelta="-750%"
|
||||
android:toXDelta="0"
|
||||
android:toYDelta="0"
|
||||
android:duration="500"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:startOffset="100"
|
||||
android:interpolator="@android:anim/anticipate_overshoot_interpolator" />
|
||||
</set>
|
Loading…
Add table
Add a link
Reference in a new issue