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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/footer" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_above="@+id/contentComment"
android:orientation="horizontal"
>
<TextView
android:id="@+id/contentVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="10dp"
android:text="@string/appVersion" />
<TextView
android:id="@+id/divider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="|"
android:textSize="10dp"
android:visibility="gone" />
<TextView
android:id="@+id/androidId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="10dp"
android:text="androidId"
android:visibility="gone"/>
</LinearLayout>
<TextView
android:id="@+id/contentComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/aboutCopyright" />
</RelativeLayout>

View file

@ -0,0 +1,149 @@
package com.adins.mss.foundation.image;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
import com.adins.mss.foundation.camerainapp.helper.Logger;
/**
* Set OnTouchListener for view Image
*
* @author gigin.ginanjar
*/
public class ImageViewer implements OnTouchListener {
// We can be in one of these 3 states
static final int NONE = 0;
static final int DRAG = 1;
static final int ZOOM = 2;
private static final String TAG = "Touch";
// These matrices will be used to move and zoom image
Matrix matrix = new Matrix();
Matrix savedMatrix = new Matrix();
int mode = NONE;
// Remember some things for zooming
PointF start = new PointF();
PointF mid = new PointF();
float oldDist = 1f;
//data gambar
byte[] img;
Bitmap bmp;
ImageView view;
Bitmap temp_bmp;
boolean rotate = true;
@Override
public boolean onTouch(View v, MotionEvent rawEvent) {
WrapMotionEvent event = WrapMotionEvent.wrap(rawEvent);
// ...
ImageView view = (ImageView) v;
// Dump touch event to log
dumpEvent(event);
// Handle touch events here...
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
savedMatrix.set(matrix);
start.set(event.getX(), event.getY());
Logger.d(TAG, "mode=DRAG");
mode = DRAG;
break;
case MotionEvent.ACTION_POINTER_DOWN:
oldDist = spacing(event);
Logger.d(TAG, "oldDist=" + oldDist);
if (oldDist > 10f) {
savedMatrix.set(matrix);
midPoint(mid, event);
mode = ZOOM;
Logger.d(TAG, "mode=ZOOM");
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
mode = NONE;
Logger.d(TAG, "mode=NONE");
break;
case MotionEvent.ACTION_MOVE:
if (mode == DRAG) {
// ...
matrix.set(savedMatrix);
matrix.postTranslate(event.getX() - start.x,
event.getY() - start.y);
} else if (mode == ZOOM) {
float newDist = spacing(event);
Logger.d(TAG, "newDist=" + newDist);
if (newDist > 10f) {
matrix.set(savedMatrix);
float scale = newDist / oldDist;
matrix.postScale(scale, scale, mid.x, mid.y);
}
}
break;
default:
break;
}
view.setImageMatrix(matrix);
return true; // indicate event was handled
}
/**
* Show an event in the LogCat view, for debugging
*/
private void dumpEvent(WrapMotionEvent event) {
// ...
String names[] = {"DOWN", "UP", "MOVE", "CANCEL", "OUTSIDE",
"POINTER_DOWN", "POINTER_UP", "7?", "8?", "9?"};
StringBuilder sb = new StringBuilder();
int action = event.getAction();
int actionCode = action & MotionEvent.ACTION_MASK;
sb.append("event ACTION_").append(names[actionCode]);
if (actionCode == MotionEvent.ACTION_POINTER_DOWN
|| actionCode == MotionEvent.ACTION_POINTER_UP) {
sb.append("(pid ").append(
action >> MotionEvent.ACTION_POINTER_INDEX_SHIFT);
sb.append(")");
}
sb.append("[");
for (int i = 0; i < event.getPointerCount(); i++) {
sb.append("#").append(i);
sb.append("(pid ").append(event.getPointerId(i));
sb.append(")=").append((int) event.getX(i));
sb.append(",").append((int) event.getY(i));
if (i + 1 < event.getPointerCount())
sb.append(";");
}
sb.append("]");
Logger.d(TAG, sb.toString());
}
/**
* Determine the space between the first two fingers
*/
private float spacing(WrapMotionEvent event) {
// ...
float x = event.getX(0) - event.getX(1);
float y = event.getY(0) - event.getY(1);
return (float) Math.sqrt(x * x + y * y);
}
/**
* Calculate the mid point of the first two fingers
*/
private void midPoint(PointF point, WrapMotionEvent event) {
// ...
float x = event.getX(0) + event.getX(1);
float y = event.getY(0) + event.getY(1);
point.set(x / 2, y / 2);
}
}

View file

@ -0,0 +1,102 @@
<?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"
android:orientation="vertical"
android:background="@android:color/black">
<com.adins.mss.foundation.camerainapp.helper.AspectFrameLayout
android:id="@+id/camera_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.adins.mss.foundation.camerainapp.CameraSurfaceView
android:id="@+id/camera_surfaceview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/camera_border"
android:layout_width="350dp"
android:layout_height="220dp"
android:layout_centerInParent="true"
android:background="@drawable/camera_border" />
<View
android:id="@+id/viewLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/camera_border"
android:background="#CC000000"
android:layout_toStartOf="@+id/camera_border"
android:visibility="gone"/>
<View
android:id="@+id/viewRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/camera_border"
android:background="#CC000000"
android:layout_toEndOf="@+id/camera_border"
android:visibility="gone"/>
<View
android:id="@+id/viewUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/camera_border"
android:layout_toLeftOf="@+id/viewRight"
android:layout_toRightOf="@+id/viewLeft"
android:background="#CC000000"
android:layout_toStartOf="@+id/viewRight"
android:layout_toEndOf="@+id/viewLeft"
android:visibility="gone"/>
<View
android:id="@+id/viewDown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/camera_border"
android:layout_toLeftOf="@+id/viewRight"
android:layout_toRightOf="@+id/viewLeft"
android:background="#CC000000"
android:layout_toStartOf="@+id/viewRight"
android:layout_toEndOf="@+id/viewLeft"
android:visibility="gone"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_auto_focus_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.adins.mss.foundation.camerainapp.helper.AspectFrameLayout>
<TextView
android:id="@+id/txtIdCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/footer_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center"
android:text="@string/camera_message"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="gone"/>
<FrameLayout
android:id="@+id/footer_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:clickable="true"
android:layout_alignParentBottom="true"/>
</RelativeLayout>

View file

@ -0,0 +1,72 @@
package com.adins.mss.base;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.PermissionChecker;
import androidx.fragment.app.Fragment;
import com.adins.mss.base.util.Utility;
public class LocationPermissionInformationFragment extends Fragment {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_location_permission_information, container, false);
TextView turnOnLocPermission = view.findViewById(R.id.turn_on_text);
TextView gotoTermAndCondition = view.findViewById(R.id.termAndConditionText);
TextView gotoPrivacyAndPolicy = view.findViewById(R.id.PrivacyAndPolicyText);
turnOnLocPermission.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Utility.checkPermissionGranted(getActivity());
}
});
gotoTermAndCondition.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Uri uri = Uri.parse("http://app.ad-ins.com/mobileone/TermsConditions.html"); // missing 'http://' will cause crashed
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
gotoPrivacyAndPolicy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Uri uri = Uri.parse("http://app.ad-ins.com/mobileone/KebijakanPrivasi.html"); // missing 'http://' will cause crashed
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
return view;
}
@Override
public void onResume() {
super.onResume();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (getActivity().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED &&
getActivity().checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
getActivity().getSupportFragmentManager().popBackStack();
}
} else {
if (PermissionChecker.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) == PermissionChecker.PERMISSION_GRANTED &&
PermissionChecker.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) == PermissionChecker.PERMISSION_GRANTED) {
getActivity().getSupportFragmentManager().popBackStack();
}
}
}
}

View file

@ -0,0 +1,71 @@
package com.adins.mss.base.checkout.activity;
import android.os.Bundle;
import androidx.fragment.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.adins.mss.base.R;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.LocationInfo;
import com.adins.mss.foundation.formatter.Formatter;
public class CheckOutResultDialog extends DialogFragment {
private TextView title;
private TextView time;
private TextView date;
public CheckOutResultDialog() {
setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Dialog_MinWidth);
}
public static CheckOutResultDialog newInstance(String title, String message, LocationInfo locationInfo) {
CheckOutResultDialog frag = new CheckOutResultDialog();
String time = Formatter.formatDate(locationInfo.getHandset_time(), Global.TIME_STR_FORMAT);
String date = Formatter.formatDate(locationInfo.getHandset_time(), Global.DATE_STR_FORMAT3);
Bundle args = new Bundle();
args.putString("title", title);
args.putString("message", message);
args.putString("time", time);
args.putString("date", date);
frag.setArguments(args);
return frag;
}
public static CheckOutResultDialog newInstance(String title, LocationInfo locationInfo) {
CheckOutResultDialog frag = new CheckOutResultDialog();
String time = Formatter.formatDate(locationInfo.getHandset_time(), Global.TIME_STR_FORMAT);
String date = Formatter.formatDate(locationInfo.getHandset_time(), Global.DATE_STR_FORMAT3);
Bundle args = new Bundle();
args.putString("title", title);
args.putString("time", time);
args.putString("date", date);
frag.setArguments(args);
return frag;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_absent_layout, container);
title = (TextView) view.findViewById(R.id.lbl_title);
time = (TextView) view.findViewById(R.id.txt_time);
date = (TextView) view.findViewById(R.id.txt_date);
String mtitle = getArguments().getString("title");
String mTime = getArguments().getString("time");
String mDate = getArguments().getString("date");
title.setText(mtitle);
time.setText(mTime);
date.setText(mDate);
return view;
}
}

View file

@ -0,0 +1,155 @@
package com.adins.mss.dao;
import android.database.Cursor;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
import de.greenrobot.dao.database.Database;
import de.greenrobot.dao.database.DatabaseStatement;
import com.adins.mss.dao.LastSync;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "TR_LASTSYNC".
*/
public class LastSyncDao extends AbstractDao<LastSync, String> {
public static final String TABLENAME = "TR_LASTSYNC";
/**
* Properties of entity LastSync.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Uuid_last_sync = new Property(0, String.class, "uuid_last_sync", true, "UUID_LAST_SYNC");
public final static Property Dtm_lastsync = new Property(1, java.util.Date.class, "dtm_lastsync", false, "DTM_LASTSYNC");
public final static Property Dtm_req = new Property(2, String.class, "dtm_req", false, "DTM_REQ");
public final static Property Data = new Property(3, String.class, "data", false, "DATA");
public final static Property ListOfLOV = new Property(4, String.class, "listOfLOV", false, "LIST_OF_LOV");
public final static Property Flag = new Property(5, String.class, "flag", false, "FLAG");
public final static Property Is_send = new Property(6, Integer.class, "is_send", false, "IS_SEND");
};
public LastSyncDao(DaoConfig config) {
super(config);
}
public LastSyncDao(DaoConfig config, DaoSession daoSession) {
super(config, 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_LASTSYNC\" (" + //
"\"UUID_LAST_SYNC\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_last_sync
"\"DTM_LASTSYNC\" INTEGER," + // 1: dtm_lastsync
"\"DTM_REQ\" TEXT," + // 2: dtm_req
"\"DATA\" TEXT," + // 3: data
"\"LIST_OF_LOV\" TEXT," + // 4: listOfLOV
"\"FLAG\" TEXT," + // 5: flag
"\"IS_SEND\" INTEGER);"); // 6: is_send
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TR_LASTSYNC\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(DatabaseStatement stmt, LastSync entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getUuid_last_sync());
java.util.Date dtm_lastsync = entity.getDtm_lastsync();
if (dtm_lastsync != null) {
stmt.bindLong(2, dtm_lastsync.getTime());
}
String dtm_req = entity.getDtm_req();
if (dtm_req != null) {
stmt.bindString(3, dtm_req);
}
String data = entity.getData();
if (data != null) {
stmt.bindString(4, data);
}
String listOfLOV = entity.getListOfLOV();
if (listOfLOV != null) {
stmt.bindString(5, listOfLOV);
}
String flag = entity.getFlag();
if (flag != null) {
stmt.bindString(6, flag);
}
Integer is_send = entity.getIs_send();
if (is_send != null) {
stmt.bindLong(7, is_send);
}
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public LastSync readEntity(Cursor cursor, int offset) {
LastSync entity = new LastSync( //
cursor.getString(offset + 0), // uuid_last_sync
cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1)), // dtm_lastsync
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // dtm_req
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // data
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // listOfLOV
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // flag
cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6) // is_send
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, LastSync entity, int offset) {
entity.setUuid_last_sync(cursor.getString(offset + 0));
entity.setDtm_lastsync(cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1)));
entity.setDtm_req(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setData(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setListOfLOV(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setFlag(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setIs_send(cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(LastSync entity, long rowId) {
return entity.getUuid_last_sync();
}
/** @inheritdoc */
@Override
public String getKey(LastSync entity) {
if(entity != null) {
return entity.getUuid_last_sync();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}

View file

@ -0,0 +1,53 @@
package com.adins.mss.base.tracking;
import com.adins.mss.dao.LocationInfo;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
public class LocationTrackingRequestJson extends MssRequestType {
@SerializedName("listLocationInfo")
public List<LocationInfo> listLocationInfo = new ArrayList<LocationInfo>();
public String precentageBattery;
public String dataUsage;
public String getPrecentageBattery() {
return precentageBattery;
}
public void setPrecentageBattery(String precentageBattery) {
this.precentageBattery = precentageBattery;
}
public String getDataUsage() {
return dataUsage;
}
public void setDataUsage(String dataUsage) {
this.dataUsage = dataUsage;
}
// public LocationTrackingRequestJson(){
// super();
// setAudit(GlobalData.getSharedGlobalData().getAuditData());
// String uuidUser = GlobalData.getSharedGlobalData().getUser().getUuid_user();
// getAudit().setCallerId(uuidUser);
// KeyValue imei = new KeyValue("imei", GlobalData.getSharedGlobalData().getImei());
// addItemToUnstructured(imei, false);
// }
public void addLocationInfoList(List<LocationInfo> listLocationInfo) {
this.listLocationInfo.addAll(listLocationInfo);
}
public List<LocationInfo> getLocationInfoList() {
return this.listLocationInfo;
}
public void clearLocationInfoList() {
listLocationInfo.clear();
}
}

View file

@ -0,0 +1,91 @@
<?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"
android:id="@+id/checkOrderLayout"
>
<ScrollView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_alignParentTop="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
>
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:gravity="center_horizontal"
android:id="@+id/searchBy">
<TextView
android:text="@string/lblSearchBy"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000"
android:textStyle="bold"
android:layout_marginTop="37dp"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ems="10"/>
<Spinner
android:id="@+id/cbSearchBy"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ems="10"
android:entries="@array/cbSearchBy"/>
</LinearLayout>
<LinearLayout
android:id="@+id/byNoOrder"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible"
android:gravity="center_horizontal" >
<TextView
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ems="10"
android:text="@string/lblNomorOrder"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000000"
android:textStyle="bold"/>
<EditText android:hint="@string/requiredField"
android:id="@+id/txtNomorOrder"
android:editable="false"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ems="10" />
</LinearLayout>
<View android:layout_width="fill_parent"
android:layout_height="20dp"
android:background="@android:color/transparent"/>
<Button
android:id="@+id/btnSearchOrder"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ems="10"
android:layout_weight="1"
android:text="@string/btnSearchOrder"
android:textColor="#ffffff"
android:textStyle="bold"
android:layout_marginBottom="37dp">
</Button>
</LinearLayout>
</ScrollView>
</RelativeLayout>