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,503 @@
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.Timeline;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "TR_TIMELINE".
*/
public class TimelineDao extends AbstractDao<Timeline, String> {
public static final String TABLENAME = "TR_TIMELINE";
/**
* Properties of entity Timeline.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Uuid_timeline = new Property(0, String.class, "uuid_timeline", true, "UUID_TIMELINE");
public final static Property Description = new Property(1, String.class, "description", false, "DESCRIPTION");
public final static Property Latitude = new Property(2, String.class, "latitude", false, "LATITUDE");
public final static Property Longitude = new Property(3, String.class, "longitude", false, "LONGITUDE");
public final static Property Dtm_crt_server = new Property(4, java.util.Date.class, "dtm_crt_server", false, "DTM_CRT_SERVER");
public final static Property Name = new Property(5, String.class, "name", false, "NAME");
public final static Property Address = new Property(6, String.class, "address", false, "ADDRESS");
public final static Property Agreement_no = new Property(7, String.class, "agreement_no", false, "AGREEMENT_NO");
public final static Property Amount_due = new Property(8, String.class, "amount_due", false, "AMOUNT_DUE");
public final static Property Overdue = new Property(9, String.class, "overdue", false, "OVERDUE");
public final static Property Installment_no = new Property(10, String.class, "installment_no", false, "INSTALLMENT_NO");
public final static Property Attd_address = new Property(11, String.class, "attd_address", false, "ATTD_ADDRESS");
public final static Property Priority = new Property(12, String.class, "priority", false, "PRIORITY");
public final static Property IsVerificationTask = new Property(13, String.class, "isVerificationTask", false, "IS_VERIFICATION_TASK");
public final static Property CollResult = new Property(14, String.class, "collResult", false, "COLL_RESULT");
public final static Property Account_name = new Property(15, String.class, "account_name", false, "ACCOUNT_NAME");
public final static Property Product_name = new Property(16, String.class, "product_name", false, "PRODUCT_NAME");
public final static Property Status_code = new Property(17, String.class, "status_code", false, "STATUS_CODE");
public final static Property Usr_crt = new Property(18, String.class, "usr_crt", false, "USR_CRT");
public final static Property Dtm_crt = new Property(19, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
public final static Property Uuid_task_h = new Property(20, String.class, "uuid_task_h", false, "UUID_TASK_H");
public final static Property Uuid_user = new Property(21, String.class, "uuid_user", false, "UUID_USER");
public final static Property Uuid_timeline_type = new Property(22, String.class, "uuid_timeline_type", false, "UUID_TIMELINE_TYPE");
public final static Property Uuid_message = new Property(23, String.class, "uuid_message", false, "UUID_MESSAGE");
public final static Property Byte_image = new Property(24, byte[].class, "byte_image", false, "BYTE_IMAGE");
};
private DaoSession daoSession;
private Query<Timeline> user_TimelineListQuery;
private Query<Timeline> timelineType_TimelineListQuery;
private Query<Timeline> message_TimelineListQuery;
private Query<Timeline> taskH_TimelineListQuery;
public TimelineDao(DaoConfig config) {
super(config);
}
public TimelineDao(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_TIMELINE\" (" + //
"\"UUID_TIMELINE\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_timeline
"\"DESCRIPTION\" TEXT," + // 1: description
"\"LATITUDE\" TEXT," + // 2: latitude
"\"LONGITUDE\" TEXT," + // 3: longitude
"\"DTM_CRT_SERVER\" INTEGER," + // 4: dtm_crt_server
"\"NAME\" TEXT," + // 5: name
"\"ADDRESS\" TEXT," + // 6: address
"\"AGREEMENT_NO\" TEXT," + // 7: agreement_no
"\"AMOUNT_DUE\" TEXT," + // 8: amount_due
"\"OVERDUE\" TEXT," + // 9: overdue
"\"INSTALLMENT_NO\" TEXT," + // 10: installment_no
"\"ATTD_ADDRESS\" TEXT," + // 11: attd_address
"\"PRIORITY\" TEXT," + // 12: priority
"\"IS_VERIFICATION_TASK\" TEXT," + // 13: isVerificationTask
"\"COLL_RESULT\" TEXT," + // 14: collResult
"\"ACCOUNT_NAME\" TEXT," + // 15: account_name
"\"PRODUCT_NAME\" TEXT," + // 16: product_name
"\"STATUS_CODE\" TEXT," + // 17: status_code
"\"USR_CRT\" TEXT," + // 18: usr_crt
"\"DTM_CRT\" INTEGER," + // 19: dtm_crt
"\"UUID_TASK_H\" TEXT," + // 20: uuid_task_h
"\"UUID_USER\" TEXT," + // 21: uuid_user
"\"UUID_TIMELINE_TYPE\" TEXT," + // 22: uuid_timeline_type
"\"UUID_MESSAGE\" TEXT," + // 23: uuid_message
"\"BYTE_IMAGE\" BLOB);"); // 24: byte_image
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TR_TIMELINE\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(DatabaseStatement stmt, Timeline entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getUuid_timeline());
String description = entity.getDescription();
if (description != null) {
stmt.bindString(2, description);
}
String latitude = entity.getLatitude();
if (latitude != null) {
stmt.bindString(3, latitude);
}
String longitude = entity.getLongitude();
if (longitude != null) {
stmt.bindString(4, longitude);
}
java.util.Date dtm_crt_server = entity.getDtm_crt_server();
if (dtm_crt_server != null) {
stmt.bindLong(5, dtm_crt_server.getTime());
}
String name = entity.getName();
if (name != null) {
stmt.bindString(6, name);
}
String address = entity.getAddress();
if (address != null) {
stmt.bindString(7, address);
}
String agreement_no = entity.getAgreement_no();
if (agreement_no != null) {
stmt.bindString(8, agreement_no);
}
String amount_due = entity.getAmount_due();
if (amount_due != null) {
stmt.bindString(9, amount_due);
}
String overdue = entity.getOverdue();
if (overdue != null) {
stmt.bindString(10, overdue);
}
String installment_no = entity.getInstallment_no();
if (installment_no != null) {
stmt.bindString(11, installment_no);
}
String attd_address = entity.getAttd_address();
if (attd_address != null) {
stmt.bindString(12, attd_address);
}
String priority = entity.getPriority();
if (priority != null) {
stmt.bindString(13, priority);
}
String isVerificationTask = entity.getIsVerificationTask();
if (isVerificationTask != null) {
stmt.bindString(14, isVerificationTask);
}
String collResult = entity.getCollResult();
if (collResult != null) {
stmt.bindString(15, collResult);
}
String account_name = entity.getAccount_name();
if (account_name != null) {
stmt.bindString(16, account_name);
}
String product_name = entity.getProduct_name();
if (product_name != null) {
stmt.bindString(17, product_name);
}
String status_code = entity.getStatus_code();
if (status_code != null) {
stmt.bindString(18, status_code);
}
String usr_crt = entity.getUsr_crt();
if (usr_crt != null) {
stmt.bindString(19, usr_crt);
}
java.util.Date dtm_crt = entity.getDtm_crt();
if (dtm_crt != null) {
stmt.bindLong(20, dtm_crt.getTime());
}
String uuid_task_h = entity.getUuid_task_h();
if (uuid_task_h != null) {
stmt.bindString(21, uuid_task_h);
}
String uuid_user = entity.getUuid_user();
if (uuid_user != null) {
stmt.bindString(22, uuid_user);
}
String uuid_timeline_type = entity.getUuid_timeline_type();
if (uuid_timeline_type != null) {
stmt.bindString(23, uuid_timeline_type);
}
String uuid_message = entity.getUuid_message();
if (uuid_message != null) {
stmt.bindString(24, uuid_message);
}
byte[] byte_image = entity.getByte_image();
if (byte_image != null) {
stmt.bindBlob(25, byte_image);
}
}
@Override
protected void attachEntity(Timeline entity) {
super.attachEntity(entity);
entity.__setDaoSession(daoSession);
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public Timeline readEntity(Cursor cursor, int offset) {
Timeline entity = new Timeline( //
cursor.getString(offset + 0), // uuid_timeline
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // description
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // latitude
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // longitude
cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)), // dtm_crt_server
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // name
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // address
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // agreement_no
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // amount_due
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // overdue
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // installment_no
cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // attd_address
cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // priority
cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // isVerificationTask
cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // collResult
cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // account_name
cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // product_name
cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // status_code
cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // usr_crt
cursor.isNull(offset + 19) ? null : new java.util.Date(cursor.getLong(offset + 19)), // dtm_crt
cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // uuid_task_h
cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // uuid_user
cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // uuid_timeline_type
cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // uuid_message
cursor.isNull(offset + 24) ? null : cursor.getBlob(offset + 24) // byte_image
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, Timeline entity, int offset) {
entity.setUuid_timeline(cursor.getString(offset + 0));
entity.setDescription(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setLatitude(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setLongitude(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setDtm_crt_server(cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)));
entity.setName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setAddress(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setAgreement_no(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setAmount_due(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setOverdue(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
entity.setInstallment_no(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
entity.setAttd_address(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
entity.setPriority(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
entity.setIsVerificationTask(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
entity.setCollResult(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
entity.setAccount_name(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
entity.setProduct_name(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
entity.setStatus_code(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
entity.setUsr_crt(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
entity.setDtm_crt(cursor.isNull(offset + 19) ? null : new java.util.Date(cursor.getLong(offset + 19)));
entity.setUuid_task_h(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
entity.setUuid_user(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
entity.setUuid_timeline_type(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
entity.setUuid_message(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
entity.setByte_image(cursor.isNull(offset + 24) ? null : cursor.getBlob(offset + 24));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(Timeline entity, long rowId) {
return entity.getUuid_timeline();
}
/** @inheritdoc */
@Override
public String getKey(Timeline entity) {
if(entity != null) {
return entity.getUuid_timeline();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
/** Internal query to resolve the "timelineList" to-many relationship of User. */
public List<Timeline> _queryUser_TimelineList(String uuid_user) {
synchronized (this) {
if (user_TimelineListQuery == null) {
QueryBuilder<Timeline> queryBuilder = queryBuilder();
queryBuilder.where(Properties.Uuid_user.eq(null));
user_TimelineListQuery = queryBuilder.build();
}
}
Query<Timeline> query = user_TimelineListQuery.forCurrentThread();
query.setParameter(0, uuid_user);
return query.list();
}
/** Internal query to resolve the "timelineList" to-many relationship of TimelineType. */
public List<Timeline> _queryTimelineType_TimelineList(String uuid_timeline_type) {
synchronized (this) {
if (timelineType_TimelineListQuery == null) {
QueryBuilder<Timeline> queryBuilder = queryBuilder();
queryBuilder.where(Properties.Uuid_timeline_type.eq(null));
timelineType_TimelineListQuery = queryBuilder.build();
}
}
Query<Timeline> query = timelineType_TimelineListQuery.forCurrentThread();
query.setParameter(0, uuid_timeline_type);
return query.list();
}
/** Internal query to resolve the "timelineList" to-many relationship of Message. */
public List<Timeline> _queryMessage_TimelineList(String uuid_message) {
synchronized (this) {
if (message_TimelineListQuery == null) {
QueryBuilder<Timeline> queryBuilder = queryBuilder();
queryBuilder.where(Properties.Uuid_message.eq(null));
message_TimelineListQuery = queryBuilder.build();
}
}
Query<Timeline> query = message_TimelineListQuery.forCurrentThread();
query.setParameter(0, uuid_message);
return query.list();
}
/** Internal query to resolve the "timelineList" to-many relationship of TaskH. */
public List<Timeline> _queryTaskH_TimelineList(String uuid_task_h) {
synchronized (this) {
if (taskH_TimelineListQuery == null) {
QueryBuilder<Timeline> queryBuilder = queryBuilder();
queryBuilder.where(Properties.Uuid_task_h.eq(null));
taskH_TimelineListQuery = queryBuilder.build();
}
}
Query<Timeline> query = taskH_TimelineListQuery.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.getUserDao().getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T1", daoSession.getTimelineTypeDao().getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T2", daoSession.getMessageDao().getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T3", daoSession.getTaskHDao().getAllColumns());
builder.append(" FROM TR_TIMELINE T");
builder.append(" LEFT JOIN MS_USER T0 ON T.\"UUID_USER\"=T0.\"UUID_USER\"");
builder.append(" LEFT JOIN MS_TIMELINETYPE T1 ON T.\"UUID_TIMELINE_TYPE\"=T1.\"UUID_TIMELINE_TYPE\"");
builder.append(" LEFT JOIN TR_MESSAGE T2 ON T.\"UUID_MESSAGE\"=T2.\"UUID_MESSAGE\"");
builder.append(" LEFT JOIN TR_TASK_H T3 ON T.\"UUID_TASK_H\"=T3.\"UUID_TASK_H\"");
builder.append(' ');
selectDeep = builder.toString();
}
return selectDeep;
}
protected Timeline loadCurrentDeep(Cursor cursor, boolean lock) {
Timeline entity = loadCurrent(cursor, 0, lock);
int offset = getAllColumns().length;
User user = loadCurrentOther(daoSession.getUserDao(), cursor, offset);
entity.setUser(user);
offset += daoSession.getUserDao().getAllColumns().length;
TimelineType timelineType = loadCurrentOther(daoSession.getTimelineTypeDao(), cursor, offset);
entity.setTimelineType(timelineType);
offset += daoSession.getTimelineTypeDao().getAllColumns().length;
Message message = loadCurrentOther(daoSession.getMessageDao(), cursor, offset);
entity.setMessage(message);
offset += daoSession.getMessageDao().getAllColumns().length;
TaskH taskH = loadCurrentOther(daoSession.getTaskHDao(), cursor, offset);
entity.setTaskH(taskH);
return entity;
}
public Timeline 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<Timeline> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<Timeline> list = new ArrayList<Timeline>(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<Timeline> 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<Timeline> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
}
}

View file

@ -0,0 +1,170 @@
package com.adins.mss.foundation.camerainapp.helper;
import android.content.res.Resources;
import android.hardware.Camera;
import android.hardware.Camera.Size;
import com.adins.mss.foundation.formatter.Tool;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class CamParaUtil {
private static CamParaUtil myCamPara = null;
private CameraSizeComparator sizeComparator = new CameraSizeComparator();
private CamParaUtil() {
}
public static CamParaUtil getInstance() {
if (myCamPara == null) {
myCamPara = new CamParaUtil();
return myCamPara;
} else {
return myCamPara;
}
}
public boolean equalRate(Size s, float rate) {
float r = (float) (s.width) / (float) (s.height);
return Math.abs(r - rate) <= 0.03;
}
/**
* previewSizes
*
* @param params
*/
public void printSupportPreviewSize(Camera.Parameters params) {
List<Size> previewSizes = params.getSupportedPreviewSizes();
for (int i = 0; i < previewSizes.size(); i++) {
Size size = previewSizes.get(i);
Logger.i(this, "previewSizes:width = " + size.width + " height = " + size.height);
}
}
/**
* pictureSizes
*
* @param params
*/
public void printSupportPictureSize(Camera.Parameters params) {
List<Size> pictureSizes = params.getSupportedPictureSizes();
for (int i = 0; i < pictureSizes.size(); i++) {
Size size = pictureSizes.get(i);
Logger.i(this, "pictureSizes:width = " + size.width
+ " height = " + size.height);
}
}
/**
* @param params
*/
public void printSupportFocusMode(Camera.Parameters params) {
List<String> focusModes = params.getSupportedFocusModes();
for (String mode : focusModes) {
Logger.i(this, "focusModes--" + mode);
}
}
public int findFrontFacingCamera() {
int cameraId = -1;
// Search for the front facing camera
int numberOfCameras = Camera.getNumberOfCameras();
for (int i = 0; i < numberOfCameras; i++) {
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(i, info);
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
//Log.d(DEBUG_TAG, "Camera found");
cameraId = i;
break;
}
}
return cameraId;
}
public Size getPropPictureSize(List<Camera.Size> list, int minWidth, int minHeight) {
Collections.sort(list, sizeComparator);
int width = minWidth < minHeight ? minHeight : minWidth;
double aspectRatio = Tool.getAspectRatio(minWidth,minHeight);
int i = 0;
for (Size s : list) {
// TODO : cari berdasarkan aspect ratio
if (s.width >= width && Tool.getAspectRatio(s.width,s.height) == aspectRatio) {
Logger.i(this, "PictureSize : w = " + s.width + "h = " + s.height);
break;
}
i++;
}
if (i == list.size()) {
i = i - 1; // ambil yang paling besar
}
Size size;
if(i == list.size() - 1){
size = list.get(i);
}else {
//Nendi: Find best aspect ratio
size = list.get(i).width == width ? list.get(i) : list.get(i + 1).width == list.get(i + 1).height ? list.get(i) : list.get(i + 1);
}
return size;
}
public Size getPropPreviewSize(List<Camera.Size> list, int minWidth, int minHeight) {
Collections.sort(list, sizeComparator);
int i = 0;
for (Size s : list) {
if (s.width == minWidth && s.height == minHeight) {
Logger.i(this, "PreviewSize : w = " + s.width + "h = " + s.height);
break;
}
i++;
}
if (i == list.size()) {
float th = (float) minWidth / (float) minHeight;
i = 0;
for (Size s : list) {
if ((s.width >= minWidth) && equalRate(s, th)) {
Logger.i(this, "PreviewSize : w = " + s.width + "h = " + s.height);
break;
}
i++;
}
if (i == list.size()) {
i = -1;
for (int a = list.size() - 1; a >= 0; a--) {
Size s = list.get(a);
if (equalRate(s, th)) {
Logger.i(this, "PreviewSize : w = " + s.width + "h = " + s.height);
i = list.indexOf(s);
break;
}
}
if (i == -1) {
i = list.size() - 1;
}
}
}
return list.get(i);
}
public class CameraSizeComparator implements Comparator<Camera.Size> {
public int compare(Size lhs, Size rhs) {
// TODO Auto-generated method stub
if (lhs.width == rhs.width) {
return 0;
} else if (lhs.width > rhs.width) {
return 1;
} else {
return -1;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -0,0 +1,71 @@
package com.adins.mss.foundation.dialog.gitonway.lib.effects;
import android.view.View;
import com.adins.libs.nineoldandroids.animation.AnimatorSet;
import com.adins.libs.nineoldandroids.view.ViewHelper;
/**
* Modify by lee on 2014/7/30.
* https://github.com/sd6352051/NiftyDialogEffects
* <p>
* The MIT License (MIT)
* <p>
* Copyright (c) 2014 daimajia
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* <p>
* Acknowledgements daimajia
* https://github.com/daimajia
*/
public abstract class BaseEffects {
private static final int DURATION = 1 * 700;
protected long mDuration = DURATION;
private AnimatorSet mAnimatorSet;
{
mAnimatorSet = new AnimatorSet();
}
protected abstract void setupAnimation(View view);
public void start(View view) {
reset(view);
setupAnimation(view);
mAnimatorSet.start();
}
public void reset(View view) {
ViewHelper.setPivotX(view, view.getMeasuredWidth() / 2.0f);
ViewHelper.setPivotY(view, view.getMeasuredHeight() / 2.0f);
}
public AnimatorSet getAnimatorSet() {
return mAnimatorSet;
}
public void setDuration(long duration) {
this.mDuration = duration;
}
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<com.github.jjobes.slidedatetimepicker.CustomTimePicker
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/timePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

View file

@ -0,0 +1,279 @@
package com.adins.mss.dao;
import java.util.List;
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 "MS_SCHEME".
*/
public class Scheme {
/** Not-null value. */
@SerializedName("uuid_scheme")
private String uuid_scheme;
@SerializedName("scheme_description")
private String scheme_description;
@SerializedName("scheme_last_update")
private java.util.Date scheme_last_update;
@SerializedName("is_printable")
private String is_printable;
@SerializedName("form_id")
private String form_id;
@SerializedName("usr_crt")
private String usr_crt;
@SerializedName("is_preview_server")
private String is_preview_server;
@SerializedName("dtm_crt")
private java.util.Date dtm_crt;
@SerializedName("usr_upd")
private String usr_upd;
@SerializedName("dtm_upd")
private java.util.Date dtm_upd;
@SerializedName("form_type")
private String form_type;
@SerializedName("is_active")
private String is_active;
@SerializedName("form_version")
private String form_version;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient SchemeDao myDao;
private List<PrintItem> printItemList;
private List<QuestionSet> questionSetList;
private List<TaskH> taskHList;
public Scheme() {
}
public Scheme(String uuid_scheme) {
this.uuid_scheme = uuid_scheme;
}
public Scheme(String uuid_scheme, String scheme_description, java.util.Date scheme_last_update, String is_printable, String form_id, String usr_crt, String is_preview_server, java.util.Date dtm_crt, String usr_upd, java.util.Date dtm_upd, String form_type, String is_active, String form_version) {
this.uuid_scheme = uuid_scheme;
this.scheme_description = scheme_description;
this.scheme_last_update = scheme_last_update;
this.is_printable = is_printable;
this.form_id = form_id;
this.usr_crt = usr_crt;
this.is_preview_server = is_preview_server;
this.dtm_crt = dtm_crt;
this.usr_upd = usr_upd;
this.dtm_upd = dtm_upd;
this.form_type = form_type;
this.is_active = is_active;
this.form_version = form_version;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getSchemeDao() : null;
}
/** Not-null value. */
public String getUuid_scheme() {
return uuid_scheme;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_scheme(String uuid_scheme) {
this.uuid_scheme = uuid_scheme;
}
public String getScheme_description() {
return scheme_description;
}
public void setScheme_description(String scheme_description) {
this.scheme_description = scheme_description;
}
public java.util.Date getScheme_last_update() {
return scheme_last_update;
}
public void setScheme_last_update(java.util.Date scheme_last_update) {
this.scheme_last_update = scheme_last_update;
}
public String getIs_printable() {
return is_printable;
}
public void setIs_printable(String is_printable) {
this.is_printable = is_printable;
}
public String getForm_id() {
return form_id;
}
public void setForm_id(String form_id) {
this.form_id = form_id;
}
public String getUsr_crt() {
return usr_crt;
}
public void setUsr_crt(String usr_crt) {
this.usr_crt = usr_crt;
}
public String getIs_preview_server() {
return is_preview_server;
}
public void setIs_preview_server(String is_preview_server) {
this.is_preview_server = is_preview_server;
}
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_upd() {
return usr_upd;
}
public void setUsr_upd(String usr_upd) {
this.usr_upd = usr_upd;
}
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 getForm_type() {
return form_type;
}
public void setForm_type(String form_type) {
this.form_type = form_type;
}
public String getIs_active() {
return is_active;
}
public void setIs_active(String is_active) {
this.is_active = is_active;
}
public String getForm_version() {
return form_version;
}
public void setForm_version(String form_version) {
this.form_version = form_version;
}
/** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
public List<PrintItem> getPrintItemList() {
if (printItemList == null) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
PrintItemDao targetDao = daoSession.getPrintItemDao();
List<PrintItem> printItemListNew = targetDao._queryScheme_PrintItemList(uuid_scheme);
synchronized (this) {
if(printItemList == null) {
printItemList = printItemListNew;
}
}
}
return printItemList;
}
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
public synchronized void resetPrintItemList() {
printItemList = null;
}
/** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
public List<QuestionSet> getQuestionSetList() {
if (questionSetList == null) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
QuestionSetDao targetDao = daoSession.getQuestionSetDao();
List<QuestionSet> questionSetListNew = targetDao._queryScheme_QuestionSetList(uuid_scheme);
synchronized (this) {
if(questionSetList == null) {
questionSetList = questionSetListNew;
}
}
}
return questionSetList;
}
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
public synchronized void resetQuestionSetList() {
questionSetList = null;
}
/** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
public List<TaskH> getTaskHList() {
if (taskHList == null) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
TaskHDao targetDao = daoSession.getTaskHDao();
List<TaskH> taskHListNew = targetDao._queryScheme_TaskHList(uuid_scheme);
synchronized (this) {
if(taskHList == null) {
taskHList = taskHListNew;
}
}
}
return taskHList;
}
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
public synchronized void resetTaskHList() {
taskHList = null;
}
/** 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,133 @@
package com.adins.mss.foundation.security;
import org.bouncycastle.crypto.BlockCipher;
import org.bouncycastle.crypto.BufferedBlockCipher;
import org.bouncycastle.crypto.CipherParameters;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.engines.AESEngine;
import org.bouncycastle.crypto.paddings.BlockCipherPadding;
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher;
import org.bouncycastle.crypto.paddings.ZeroBytePadding;
import org.bouncycastle.crypto.params.KeyParameter;
public class AESManager {
public byte[] encryptAES256(byte[] input, KeyParameter key)
throws InvalidCipherTextException {
CipherParameters cipherParameters = null;
BufferedBlockCipher bufferedBlockCipher = null;
cipherParameters = key;
BlockCipher blockCipher = new AESEngine();
BlockCipherPadding blockCipherPadding = new ZeroBytePadding();
bufferedBlockCipher = new PaddedBufferedBlockCipher(blockCipher,
blockCipherPadding);
return encrypt(input, bufferedBlockCipher, cipherParameters);
}
public byte[] encryptAES256(byte[] input, byte[] key)
throws InvalidCipherTextException {
CipherParameters cipherParameters = null;
BufferedBlockCipher bufferedBlockCipher = null;
cipherParameters = new KeyParameter(key);
BlockCipher blockCipher = new AESEngine();
BlockCipherPadding blockCipherPadding = new ZeroBytePadding();
bufferedBlockCipher = new PaddedBufferedBlockCipher(blockCipher,
blockCipherPadding);
return encrypt(input, bufferedBlockCipher, cipherParameters);
}
public byte[] decryptAES256(byte[] input, byte[] key)
throws InvalidCipherTextException {
CipherParameters cipherParameters = null;
BufferedBlockCipher bufferedBlockCipher = null;
if (key.length == 32) // 32 bytes == 256 bits
{
cipherParameters = new KeyParameter(key);
BlockCipher blockCipher = new AESEngine();
BlockCipherPadding blockCipherPadding = new ZeroBytePadding();
bufferedBlockCipher = new PaddedBufferedBlockCipher(blockCipher,
blockCipherPadding);
}
return decrypt(input, bufferedBlockCipher, cipherParameters);
}
public byte[] decryptAES256(byte[] input, KeyParameter key)
throws InvalidCipherTextException {
CipherParameters cipherParameters = null;
BufferedBlockCipher bufferedBlockCipher = null;
cipherParameters = key;
BlockCipher blockCipher = new AESEngine();
BlockCipherPadding blockCipherPadding = new ZeroBytePadding();
bufferedBlockCipher = new PaddedBufferedBlockCipher(blockCipher,
blockCipherPadding);
return decrypt(input, bufferedBlockCipher, cipherParameters);
}
public byte[] encrypt(byte[] input,
BufferedBlockCipher bufferedBlockCipher,
CipherParameters cipherParameters)
throws InvalidCipherTextException {
boolean forEncryption = true;
return process(input, bufferedBlockCipher, cipherParameters,
forEncryption);
}
public byte[] decrypt(byte[] input,
BufferedBlockCipher bufferedBlockCipher,
CipherParameters cipherParameters)
throws InvalidCipherTextException {
boolean forEncryption = false;
return process(input, bufferedBlockCipher, cipherParameters,
forEncryption);
}
public byte[] process(byte[] input,
BufferedBlockCipher bufferedBlockCipher,
CipherParameters cipherParameters, boolean forEncryption)
throws InvalidCipherTextException {
bufferedBlockCipher.init(forEncryption, cipherParameters);
int inputOffset = 0;
int inputLength = input.length;
int maximumOutputLength = bufferedBlockCipher
.getOutputSize(inputLength);
byte[] output = new byte[maximumOutputLength];
int outputOffset = 0;
int outputLength = 0;
int bytesProcessed;
bytesProcessed = bufferedBlockCipher.processBytes(input, inputOffset,
inputLength, output, outputOffset);
outputOffset += bytesProcessed;
outputLength += bytesProcessed;
bytesProcessed = bufferedBlockCipher.doFinal(output, outputOffset);
outputLength += bytesProcessed;
if (outputLength == output.length) {
return output;
} else {
byte[] truncatedOutput = new byte[outputLength];
System.arraycopy(output, 0, truncatedOutput, 0, outputLength);
return truncatedOutput;
}
}
}

View file

@ -0,0 +1,122 @@
package com.adins.mss.coll.models;
import com.adins.mss.foundation.http.MssResponseType;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by adityapurwa on 22/04/15.
*/
public class ReportSummaryResponse extends MssResponseType {
@SerializedName("current_date")
private String current_date;
@SerializedName("collector")
private String collector;
@SerializedName("total_to_be_paid")
private Double total_to_be_paid;
@SerializedName("total_received")
private Double total_received;
@SerializedName("listTask")
private List<ReportSummaryResponse> listTask;
@SerializedName("agreementNo")
private String agreementNo;
@SerializedName("statusTask")
private String statusTask;
@SerializedName("amountPaid")
private String amountPaid;
@SerializedName("ptp")
private String ptp;
@SerializedName("note")
private String note;
@SerializedName("customerName")
private String customerName;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCurrent_date() {
return current_date;
}
public void setCurrent_date(String current_date) {
this.current_date = current_date;
}
public String getCollector() {
return collector;
}
public void setCollector(String collector) {
this.collector = collector;
}
public Double getTotal_to_be_paid() {
return total_to_be_paid;
}
public void setTotal_to_be_paid(Double total_to_be_paid) {
this.total_to_be_paid = total_to_be_paid;
}
public Double getTotal_received() {
return total_received;
}
public void setTotal_received(Double total_received) {
this.total_received = total_received;
}
public List<ReportSummaryResponse> getList_task(){
return this.listTask;
}
public void setList_task(List<ReportSummaryResponse> listTask){
this.listTask = listTask;
}
public String getAgreementNo() {
return agreementNo;
}
public void setAgreementNo(String agreementNo) {
this.agreementNo = agreementNo;
}
public String getStatusTask() {
return statusTask;
}
public void setStatusTask(String statusTask) {
this.statusTask = statusTask;
}
public String getAmountPaid() {
return amountPaid;
}
public void setAmountPaid(String amountPaid) {
this.amountPaid = amountPaid;
}
public String getPtp() {
return ptp;
}
public void setPtp(String ptp) {
this.ptp = ptp;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -0,0 +1,32 @@
package com.adins.mss.coll.models;
import com.adins.mss.dao.PaymentHistoryD;
import com.adins.mss.dao.PaymentHistoryH;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class PaymentHistoryHBean {
@SerializedName("paymentHistoryH")
private PaymentHistoryH paymentHistoryH;
@SerializedName("paymentHistoryDList")
private List<PaymentHistoryD> paymentHistoryDList;
public PaymentHistoryH getPaymentHistoryH() {
return paymentHistoryH;
}
public void setPaymentHistoryH(PaymentHistoryH paymentHistoryH) {
this.paymentHistoryH = paymentHistoryH;
}
public List<PaymentHistoryD> getPaymentHistoryDList() {
return paymentHistoryDList;
}
public void setPaymentHistoryDList(List<PaymentHistoryD> paymentHistoryDList) {
this.paymentHistoryDList = paymentHistoryDList;
}
}

View file

@ -0,0 +1,195 @@
package com.adins.mss.coll.fragments;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class TeamMember {
@SerializedName("LOGIN_ID")
protected String LOGIN_ID;
@SerializedName("POINT_PERIOD")
protected String POINT_PERIOD;
@SerializedName("POINT_PERIOD_BEFORE")
protected String POINT_PERIOD_BEFORE;
@SerializedName("POINT_MONTH")
protected String POINT_MONTH;
@SerializedName("POINT_MONTH_BEFORE")
protected String POINT_MONTH_BEFORE;
@SerializedName("DATA_GROUP_RANK")
protected ArrayList<DataGroupRank> DATA_GROUP_RANK;
@SerializedName("BEST_MEMBERSHIP_MEMBER")
protected ArrayList<BestMembershipMember> BEST_MEMBERSHIP_MEMBER;
public String getLOGIN_ID() {
return LOGIN_ID;
}
public void setLOGIN_ID(String LOGIN_ID) {
this.LOGIN_ID = LOGIN_ID;
}
public String getPOINT_PERIOD() {
return POINT_PERIOD;
}
public void setPOINT_PERIOD(String POINT_PERIOD) {
this.POINT_PERIOD = POINT_PERIOD;
}
public String getPOINT_PERIOD_BEFORE() {
return POINT_PERIOD_BEFORE;
}
public void setPOINT_PERIOD_BEFORE(String POINT_PERIOD_BEFORE) {
this.POINT_PERIOD_BEFORE = POINT_PERIOD_BEFORE;
}
public String getPOINT_MONTH() {
return POINT_MONTH;
}
public void setPOINT_MONTH(String POINT_MONTH) {
this.POINT_MONTH = POINT_MONTH;
}
public String getPOINT_MONTH_BEFORE() {
return POINT_MONTH_BEFORE;
}
public void setPOINT_MONTH_BEFORE(String POINT_MONTH_BEFORE) {
this.POINT_MONTH_BEFORE = POINT_MONTH_BEFORE;
}
public ArrayList<DataGroupRank> getDATA_GROUP_RANK() {
return DATA_GROUP_RANK;
}
public void setDATA_GROUP_RANK(ArrayList<DataGroupRank> DATA_GROUP_RANK) {
this.DATA_GROUP_RANK = DATA_GROUP_RANK;
}
public ArrayList<BestMembershipMember> getBEST_MEMBERSHIP_MEMBER() {
return BEST_MEMBERSHIP_MEMBER;
}
public void setBEST_MEMBERSHIP_MEMBER(ArrayList<BestMembershipMember> BEST_MEMBERSHIP_MEMBER) {
this.BEST_MEMBERSHIP_MEMBER = BEST_MEMBERSHIP_MEMBER;
}
class BestMembershipMember {
@SerializedName("LOGIN_ID")
protected String LOGIN_ID;
@SerializedName("POINT_PERIOD")
protected String POINT_PERIOD;
@SerializedName("POINT_PERIOD_BEFORE")
protected String POINT_PERIOD_BEFORE;
@SerializedName("POINT_MONTH")
protected String POINT_MONTH;
@SerializedName("POINT_MONTH_BEFORE")
protected String POINT_MONTH_BEFORE;
@SerializedName("DATA_GROUP_RANK")
protected ArrayList<DataGroupRank> DATA_GROUP_RANK;
public String getLOGIN_ID() {
return LOGIN_ID;
}
public void setLOGIN_ID(String LOGIN_ID) {
this.LOGIN_ID = LOGIN_ID;
}
public String getPOINT_PERIOD() {
return POINT_PERIOD;
}
public void setPOINT_PERIOD(String POINT_PERIOD) {
this.POINT_PERIOD = POINT_PERIOD;
}
public String getPOINT_PERIOD_BEFORE() {
return POINT_PERIOD_BEFORE;
}
public void setPOINT_PERIOD_BEFORE(String POINT_PERIOD_BEFORE) {
this.POINT_PERIOD_BEFORE = POINT_PERIOD_BEFORE;
}
public String getPOINT_MONTH() {
return POINT_MONTH;
}
public void setPOINT_MONTH(String POINT_MONTH) {
this.POINT_MONTH = POINT_MONTH;
}
public String getPOINT_MONTH_BEFORE() {
return POINT_MONTH_BEFORE;
}
public void setPOINT_MONTH_BEFORE(String POINT_MONTH_BEFORE) {
this.POINT_MONTH_BEFORE = POINT_MONTH_BEFORE;
}
public ArrayList<DataGroupRank> getDATA_GROUP_RANK() {
return DATA_GROUP_RANK;
}
public void setDATA_GROUP_RANK(ArrayList<DataGroupRank> DATA_GROUP_RANK) {
this.DATA_GROUP_RANK = DATA_GROUP_RANK;
}
}
public class DataGroupRank {
@SerializedName("LEVEL")
protected String LEVEL;
@SerializedName("RANK")
protected String RANK;
@SerializedName("RANK_BEFORE")
protected String RANK_BEFORE;
public String getLEVEL() {
return LEVEL;
}
public void setLEVEL(String LEVEL) {
this.LEVEL = LEVEL;
}
public String getRANK() {
return RANK;
}
public void setRANK(String RANK) {
this.RANK = RANK;
}
public String getRANK_BEFORE() {
return RANK_BEFORE;
}
public void setRANK_BEFORE(String RANK_BEFORE) {
this.RANK_BEFORE = RANK_BEFORE;
}
}
}