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,57 @@
|
|||
package com.adins.mss.base.loyalti.barchart.pointlegends;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.loyalti.model.PointDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PointLegendsAdapter extends BaseAdapter {
|
||||
|
||||
private Context context;
|
||||
private List<PointDetail> dataset;
|
||||
|
||||
public PointLegendsAdapter(Context context, List<PointDetail> dataset) {
|
||||
this.context = context;
|
||||
this.dataset = dataset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return dataset.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return dataset.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if(convertView == null){
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.point_legend_item,parent,false);
|
||||
}
|
||||
|
||||
PointDetail item = dataset.get(position);
|
||||
ImageView colorRect = convertView.findViewById(R.id.legendColorRect);
|
||||
colorRect.setColorFilter(item.colorValue);
|
||||
TextView legendText = convertView.findViewById(R.id.legendText);
|
||||
legendText.setText(item.rewardProgram);
|
||||
|
||||
return convertView;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.adins.mss.base.dynamicform.form.questions.TouchImageView
|
||||
android:id="@+id/imageViewer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/btnLayout"
|
||||
android:scaleType="matrix"
|
||||
android:layout_alignParentTop="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnRotate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:text="@string/rotate" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:text="@string/btnSave" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,34 @@
|
|||
package com.adins.mss.base.dynamicform.form.models;
|
||||
|
||||
import com.adins.mss.foundation.http.KeyValue;
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by gigin.ginanjar on 12/10/2016.
|
||||
*/
|
||||
|
||||
public class ReviewResponse extends MssResponseType {
|
||||
@SerializedName("errorMessage")
|
||||
private String errMessage;
|
||||
@SerializedName("listField")
|
||||
private List<KeyValue> listField;
|
||||
|
||||
public String getErrMessage() {
|
||||
return errMessage;
|
||||
}
|
||||
|
||||
public void setErrMessage(String errMessage) {
|
||||
this.errMessage = errMessage;
|
||||
}
|
||||
|
||||
public List<KeyValue> getListField() {
|
||||
return listField;
|
||||
}
|
||||
|
||||
public void setListField(List<KeyValue> listField) {
|
||||
this.listField = listField;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
|
@ -0,0 +1,239 @@
|
|||
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 com.adins.mss.dao.Emergency;
|
||||
|
||||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
|
||||
/**
|
||||
* DAO for table "TR_EMERGENCY".
|
||||
*/
|
||||
public class EmergencyDao extends AbstractDao<Emergency, Long> {
|
||||
|
||||
public static final String TABLENAME = "TR_EMERGENCY";
|
||||
|
||||
/**
|
||||
* Properties of entity Emergency.<br/>
|
||||
* Can be used for QueryBuilder and for referencing column names.
|
||||
*/
|
||||
public static class Properties {
|
||||
public final static Property Uuid_emergency = new Property(0, long.class, "uuid_emergency", true, "UUID_EMERGENCY");
|
||||
public final static Property Uuid_user = new Property(1, String.class, "uuid_user", false, "UUID_USER");
|
||||
public final static Property Longitude = new Property(2, String.class, "longitude", false, "LONGITUDE");
|
||||
public final static Property Latitude = new Property(3, String.class, "latitude", false, "LATITUDE");
|
||||
public final static Property Dtm_emergency = new Property(4, java.util.Date.class, "dtm_emergency", false, "DTM_EMERGENCY");
|
||||
};
|
||||
|
||||
private DaoSession daoSession;
|
||||
|
||||
|
||||
public EmergencyDao(DaoConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
public EmergencyDao(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_EMERGENCY\" (" + //
|
||||
"\"UUID_EMERGENCY\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ," + // 0: uuid_emergency
|
||||
"\"UUID_USER\" TEXT NOT NULL ," + // 1: uuid_user
|
||||
"\"LONGITUDE\" TEXT," + // 2: longitude
|
||||
"\"LATITUDE\" TEXT," + // 3: latitude
|
||||
"\"DTM_EMERGENCY\" INTEGER);"); // 4: dtm_emergency
|
||||
}
|
||||
|
||||
/** Drops the underlying database table. */
|
||||
public static void dropTable(Database db, boolean ifExists) {
|
||||
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TR_EMERGENCY\"";
|
||||
db.execSQL(sql);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected void bindValues(DatabaseStatement stmt, Emergency entity) {
|
||||
stmt.clearBindings();
|
||||
stmt.bindLong(1, entity.getUuid_emergency());
|
||||
stmt.bindString(2, entity.getUuid_user());
|
||||
|
||||
String longitude = entity.getLongitude();
|
||||
if (longitude != null) {
|
||||
stmt.bindString(3, longitude);
|
||||
}
|
||||
|
||||
String latitude = entity.getLatitude();
|
||||
if (latitude != null) {
|
||||
stmt.bindString(4, latitude);
|
||||
}
|
||||
|
||||
java.util.Date dtm_emergency = entity.getDtm_emergency();
|
||||
if (dtm_emergency != null) {
|
||||
stmt.bindLong(5, dtm_emergency.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachEntity(Emergency entity) {
|
||||
super.attachEntity(entity);
|
||||
entity.__setDaoSession(daoSession);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public Long readKey(Cursor cursor, int offset) {
|
||||
return cursor.getLong(offset + 0);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public Emergency readEntity(Cursor cursor, int offset) {
|
||||
Emergency entity = new Emergency( //
|
||||
cursor.getLong(offset + 0), // uuid_emergency
|
||||
cursor.getString(offset + 1), // uuid_user
|
||||
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // longitude
|
||||
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // latitude
|
||||
cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)) // dtm_emergency
|
||||
);
|
||||
return entity;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public void readEntity(Cursor cursor, Emergency entity, int offset) {
|
||||
entity.setUuid_emergency(cursor.getLong(offset + 0));
|
||||
entity.setUuid_user(cursor.getString(offset + 1));
|
||||
entity.setLongitude(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
|
||||
entity.setLatitude(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
|
||||
entity.setDtm_emergency(cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)));
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected Long updateKeyAfterInsert(Emergency entity, long rowId) {
|
||||
entity.setUuid_emergency(rowId);
|
||||
return rowId;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public Long getKey(Emergency entity) {
|
||||
if(entity != null) {
|
||||
return entity.getUuid_emergency();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected boolean isEntityUpdateable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
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.getUserDao().getAllColumns());
|
||||
builder.append(" FROM TR_EMERGENCY T");
|
||||
builder.append(" LEFT JOIN MS_USER T0 ON T.\"UUID_USER\"=T0.\"UUID_USER\"");
|
||||
builder.append(' ');
|
||||
selectDeep = builder.toString();
|
||||
}
|
||||
return selectDeep;
|
||||
}
|
||||
|
||||
protected Emergency loadCurrentDeep(Cursor cursor, boolean lock) {
|
||||
Emergency entity = loadCurrent(cursor, 0, lock);
|
||||
int offset = getAllColumns().length;
|
||||
|
||||
User user = loadCurrentOther(daoSession.getUserDao(), cursor, offset);
|
||||
if(user != null) {
|
||||
entity.setUser(user);
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Emergency 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<Emergency> loadAllDeepFromCursor(Cursor cursor) {
|
||||
int count = cursor.getCount();
|
||||
List<Emergency> list = new ArrayList<Emergency>(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<Emergency> 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<Emergency> queryDeep(String where, String... selectionArg) {
|
||||
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
|
||||
return loadDeepAllAndCloseCursor(cursor);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.adins.mss.base.loyalti.mypointdashboard;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GetLogoRequest extends MssRequestType {
|
||||
|
||||
@SerializedName("MEMBERSHIP_PROGRAM_CODE")
|
||||
protected String MEMBERSHIP_PROGRAM_CODE;
|
||||
|
||||
public String getMEMBERSHIP_PROGRAM_CODE() {
|
||||
return MEMBERSHIP_PROGRAM_CODE;
|
||||
}
|
||||
|
||||
public void setMEMBERSHIP_PROGRAM_CODE(String MEMBERSHIP_PROGRAM_CODE) {
|
||||
this.MEMBERSHIP_PROGRAM_CODE = MEMBERSHIP_PROGRAM_CODE;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.adins.mss.base.commons;
|
||||
|
||||
/**
|
||||
* Created by kusnendi.muhamad on 28/07/2017.
|
||||
*/
|
||||
|
||||
public class TaskListenerImpl implements TaskListener {
|
||||
@Override
|
||||
public void onCompleteTask(Object result) {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelTask(boolean value) {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocalData(Object result) {
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.adins.mss.coll.loyalti.pointacquisitiondaily.contracts;
|
||||
|
||||
import com.adins.mss.coll.loyalti.BasePresenter;
|
||||
import com.adins.mss.coll.loyalti.BaseView;
|
||||
import com.adins.mss.coll.models.loyaltymodels.GroupPointData;
|
||||
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsRequest;
|
||||
import com.adins.mss.coll.models.loyaltymodels.PointDetail;
|
||||
import com.adins.mss.coll.models.loyaltymodels.RankDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DailyPointContract {
|
||||
interface View extends BaseView<DailyPointContract.Presenter> {
|
||||
void onDataReceived(float[][] pointDataSet, RankDetail[][] rankDataSet,List<PointDetail> pointDetailsDataSet);
|
||||
void onGetDataFailed(String message);
|
||||
}
|
||||
|
||||
interface Presenter extends BasePresenter {
|
||||
void getDailyPointsData(LoyaltyPointsRequest reqData);
|
||||
float getAvgPoint();
|
||||
int getMaxPoint();
|
||||
int getTotalPoints();
|
||||
int getCurrentDay();
|
||||
String[] getDays();
|
||||
GroupPointData getPointDataAt(int monthIdx);
|
||||
List<PointDetail> getPointDetails();
|
||||
List<RankDetail> getRanks();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue