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,51 @@
package com.adins.mss.base.dynamicform.form.models;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
/**
* Created by gigin.ginanjar on 14/10/2016.
*/
public class LookupOnlineRequest extends MssRequestType {
@SerializedName("refId")
private String identifier;
@SerializedName("filter")
private String choiceFilter;
@SerializedName("lov_group")
private String lovGroup;
@SerializedName("value")
private String userFilter;
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getChoiceFilter() {
return choiceFilter;
}
public void setChoiceFilter(String choiceFilter) {
this.choiceFilter = choiceFilter;
}
public String getLovGroup() {
return lovGroup;
}
public void setLovGroup(String lovGroup) {
this.lovGroup = lovGroup;
}
public String getUserFilter() {
return userFilter;
}
public void setUserFilter(String userFilter) {
this.userFilter = userFilter;
}
}

View file

@ -0,0 +1,10 @@
package com.adins.mss.svy.reassignment;
/**
* Created by ahmadkamilalmasyhur on 26/03/2018.
*/
public interface OnDateChangeListener {
void onStartDateSetListener(String startDate);
void onEndDateSetListener(String endDate);
}

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="14dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gradient_end"
android:pathData="M20,6h-8l-2,-2L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,8c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8h16v10z"/>
</vector>

View file

@ -0,0 +1,107 @@
package com.adins.mss.base.dynamictheme;
import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Build;
import com.google.android.material.textfield.TextInputLayout;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.adins.mss.foundation.image.Utils;
/**
* Created by intishar.fa on 06/09/2018.
*/
public class ThemeUtility {
public static String getColorItemValue(DynamicTheme colorSet, String itemName){
String value = "";
if(null != colorSet) {
if (colorSet.getThemeItemList() != null){
for (ThemeItem item : colorSet.getThemeItemList()) {
if (item.getItemName().equals(itemName)) {
value = item.getValue();
break;
}
}
}
}
return value;
}
public static void setToolbarColor(Toolbar toolbar,int color){
toolbar.setBackgroundColor(color);
}
public static void setStatusBarColor(Activity activity, int color){
Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setStatusBarColor(color);
}
}
public static void setViewBackground(View view, int color){
Drawable drawable = null;
if(view instanceof ImageView)
drawable = ((ImageView) view).getDrawable();
else{
if(view instanceof ImageButton)
drawable = DrawableCompat.wrap(view.getBackground());
else
drawable = view.getBackground();
}
DrawableCompat.setTint(drawable,color);
if(view instanceof ImageButton){
view.setBackground(DrawableCompat.unwrap(drawable));
}
}
public static void setViewBackground(View view, ColorStateList colorstate){
Drawable drawable = null;
if(view instanceof ImageView)
drawable = ((ImageView) view).getDrawable();
else{
if(view instanceof ImageButton)
drawable = DrawableCompat.wrap(view.getBackground());
else
drawable = view.getBackground();
}
DrawableCompat.setTintList(drawable,colorstate);
}
public static void setTextViewDrawableLeftColor(TextView view,int color){
Drawable[] drawables = view.getCompoundDrawables();
if(drawables.length != 0){
DrawableCompat.setTint(drawables[0],color);//index 0 is left
view.setCompoundDrawables(drawables[0],null,null,null);
}
}
public static void setEditTextBorder(TextInputLayout view, int color){
Drawable editTxtDrw = view.getEditText().getBackground();
DrawableCompat.setTint(editTxtDrw,color);
view.getEditText().setBackground(editTxtDrw);
}
public static void setTextColor(View view,int color){
}
public static void setImage(final ImageView view, final String base64Img){
byte[] imgByteArr = Utils.base64ToByte(base64Img);
Bitmap tempBitmap = Utils.byteToBitmap(imgByteArr);
view.setImageBitmap(tempBitmap);
}
}

View file

@ -0,0 +1,48 @@
/*
* Copyright 2010 Kevin Gaudin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.acra.collector;
/**
* Collects some data identifying a Thread, usually the Thread which crashed.
*
* @author Kevin Gaudin
*/
public class ThreadCollector {
/**
* Convenience method that collects some data identifying a Thread, usually the Thread which
* crashed and returns a string containing the thread's id, name, priority and group name.
*
* @param t the thread
* @return a string representation of the string including the id, name and priority of the thread.
*/
public static String collect(Thread t) {
StringBuilder result = new StringBuilder();
if (t != null) {
result.append("id=").append(t.getId()).append("\n");
result.append("name=").append(t.getName()).append("\n");
result.append("priority=").append(t.getPriority()).append("\n");
if (t.getThreadGroup() != null) {
result.append("groupName=").append(t.getThreadGroup().getName()).append("\n");
}
} else {
result.append("No broken thread, this might be a silent exception.");
}
return result.toString();
}
}

View file

@ -0,0 +1,236 @@
package com.adins.mss.odr.reassignment;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.annotation.Keep;
import android.view.View;
import android.widget.AdapterView;
import com.adins.mss.base.GlobalData;
import com.adins.mss.base.util.GsonHelper;
import com.adins.mss.base.util.LocaleHelper;
import com.adins.mss.base.util.Utility;
import com.adins.mss.constant.Global;
import com.adins.mss.foundation.formatter.Formatter;
import com.adins.mss.foundation.http.HttpConnectionResult;
import com.adins.mss.foundation.http.HttpCryptedConnection;
import com.adins.mss.odr.R;
import com.adins.mss.odr.assignment.OrderAssignmentAdapter;
import com.adins.mss.odr.assignment.OrderAssignmentResult;
import com.adins.mss.odr.model.JsonRequestCheckOrder;
import com.adins.mss.odr.model.JsonResponseServer;
import com.adins.mss.odr.model.JsonResponseServer.ResponseServer;
import com.androidquery.AQuery;
import com.google.firebase.perf.FirebasePerformance;
import com.google.firebase.perf.metrics.HttpMetric;
import org.acra.ACRA;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
public class OrderReassignmentResult extends Activity{
private String url;
protected String startDate;
protected String endDate;
protected String orderNumber;
protected String flag;
private Bundle mArguments;
protected JsonResponseServer results;
private List<ResponseServer> responseServer;
OrderAssignmentAdapter adapter;
AQuery query;
protected String getUsedURL(){
return GlobalData.getSharedGlobalData().getURL_CHECKORDER();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.default_listview);
ACRA.getErrorReporter().putCustomData("LAST_CLASS_ACCESSED", getClass().getSimpleName());
mArguments = getIntent().getExtras();
query = new AQuery(this);
initialize();
query.id(android.R.id.list).adapter(adapter);
query.id(android.R.id.list).itemClicked(this, "itemClick");
new ResultOrderTask().execute();
}
@Override
protected void attachBaseContext(Context newBase) {
Context context = newBase;
Locale locale;
try {
locale = new Locale(GlobalData.getSharedGlobalData().getLocale());
context = LocaleHelper.wrap(newBase, locale);
} catch (Exception e) {
locale = new Locale(LocaleHelper.ENGLSIH);
context = LocaleHelper.wrap(newBase, locale);
} finally {
super.attachBaseContext(context);
}
}
@Override
public void onResume(){
super.onResume();
getActionBar().setTitle(getString(R.string.title_mn_orderreassign));
}
protected void initialize() {
String mStartDate = mArguments.getString("startDate");
String mEndDate = mArguments.getString("endDate");
String mNomorOrder= mArguments.getString("nomorOrder");
String status= mArguments.getString("status");
url = getUsedURL();
if(mStartDate==null || "".equalsIgnoreCase(mStartDate)){
startDate="1";
endDate="1";
orderNumber=mNomorOrder;
flag="orderNumber";
}
//jika memilih order by date
else if(mNomorOrder==null || "".equalsIgnoreCase(mNomorOrder)){
startDate=mStartDate;
endDate=mEndDate;
orderNumber="1";
flag="date";
}
if(status!=null){
flag = status;
}
if("orderTracking".equalsIgnoreCase(flag)){
startDate="1";
endDate="1";
orderNumber="1";
}
}
protected List<NameValuePair> generateRequestParam() throws ParseException {
String sdtSDate = "1";
String sdtEDate = "1";
if(startDate==null||endDate==null||"".equalsIgnoreCase(startDate)||"".equalsIgnoreCase(endDate)
||"1".equalsIgnoreCase(startDate)||"1".equalsIgnoreCase(endDate)){
}else{
//convert format date biar bisa di tranlate di DB servernya
SimpleDateFormat f = new SimpleDateFormat(Global.DATE_STR_FORMAT);
Date sDate,eDate;
sDate = f.parse(startDate);
eDate = f.parse(endDate);
sdtSDate = Formatter.formatDate(sDate, Global.DATE_STR_FORMAT2);
sdtEDate = Formatter.formatDate(eDate, Global.DATE_STR_FORMAT2);
}
List<NameValuePair> param = new ArrayList<>();
param.add(new BasicNameValuePair("startdate", sdtSDate));
param.add(new BasicNameValuePair("enddate", sdtEDate));
param.add(new BasicNameValuePair("ordernumber", orderNumber));
param.add(new BasicNameValuePair("flag", flag));
return param;
}
public class ResultOrderTask extends AsyncTask<String, Void, String> {
private String errMessage = null;
@Override
protected String doInBackground(String... arg0) {
String resp = null;
try {
List<NameValuePair> param = generateRequestParam();
JsonRequestCheckOrder requestCheckOrder = new JsonRequestCheckOrder();
requestCheckOrder.setAudit(GlobalData.getSharedGlobalData().getAuditData());
if(param.get(3).getValue().equals(Global.FLAG_BY_DATE)){
requestCheckOrder.setStartDate(param.get(0).getValue());
requestCheckOrder.setEndDate(param.get(1).getValue());
}
else if(param.get(3).getValue().equals(Global.FLAG_BY_ORDERNUMBER)){
requestCheckOrder.setOrderNumber(param.get(2).getValue());
}
else if(param.get(3).getValue().equals(Global.FLAG_FOR_CANCELORDER)){
if(param.get(2).getValue().equals("1")){
requestCheckOrder.setStartDate(param.get(0).getValue());
requestCheckOrder.setEndDate(param.get(1).getValue());
}else{
requestCheckOrder.setOrderNumber(param.get(2).getValue());
}
}
else if(param.get(3).getValue().equals(Global.FLAG_FOR_ORDERREASSIGNMENT)){
if(param.get(2).getValue().equals("1")){
requestCheckOrder.setStartDate(param.get(0).getValue());
requestCheckOrder.setEndDate(param.get(1).getValue());
}else{
requestCheckOrder.setOrderNumber(param.get(2).getValue());
}
requestCheckOrder.setFlag(param.get(3).getValue());
}
String json = GsonHelper.toJson(requestCheckOrder);
boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
HttpCryptedConnection httpConn = new HttpCryptedConnection(getApplicationContext(), encrypt, decrypt);
HttpConnectionResult serverResult = null;
//Firebase Performance Trace HTTP Request
HttpMetric networkMetric =
FirebasePerformance.getInstance().newHttpMetric(url, FirebasePerformance.HttpMethod.POST);
Utility.metricStart(networkMetric, json);
try {
serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
Utility.metricStop(networkMetric, serverResult);
} catch (Exception e) {
e.printStackTrace();
}
resp = serverResult.getResult();
}catch (Exception e) {
resp=e.getMessage();
}
return resp;
}
@Override
protected void onPostExecute(String result) {
if (errMessage == null) {
results = GsonHelper.fromJson(result, JsonResponseServer.class);
responseServer = results.getListResponseServer();
adapter = new OrderAssignmentAdapter(getApplicationContext(), responseServer,false);
adapter.notifyDataSetChanged();
query.id(android.R.id.list).adapter(adapter);
}
}
}
@Keep
public void itemClick(AdapterView<?> parent, View v, int position, long id){
String nomorOrder = responseServer.get(position).getKey();
String uuid_task_h = responseServer.get(position).getFlag();
gotoDetailData(Global.TASK_ORDER_REASSIGNMENT, nomorOrder, uuid_task_h);
}
private void gotoDetailData(int taskType, String nomorOrder, String uuid_task_h){
Intent intent = new Intent(this, OrderAssignmentResult.class);
intent.putExtra(Global.BUND_KEY_ORDERNO, nomorOrder);
intent.putExtra(Global.BUND_KEY_TASK_TYPE, taskType);
intent.putExtra(Global.BUND_KEY_UUID_TASKH, uuid_task_h);
startActivity(intent);
}
}

View file

@ -0,0 +1,11 @@
package com.adins.mss.base.commons;
/**
* Created by kusnendi.muhamad on 31/07/2017.
*/
public interface SettingInterface {
public String getLanguage();
public void setLanguage(String language);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB