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,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/opportunityList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"/>
</LinearLayout>

View file

@ -0,0 +1,31 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_grayscale">
<View android:id="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:background="@drawable/actionbar_background"/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginTop="48dp"
android:id="@+id/swipeRefreshApproval"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="4dp">
<GridView
android:id="@+id/gridApproval"
android:layout_below="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:numColumns="3"
android:padding="5dp"
android:horizontalSpacing="4dp"
android:verticalSpacing="4dp">
</GridView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -0,0 +1,41 @@
package com.adins.mss.base.dynamicform.form.models;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
import java.util.Map;
public class JsonDataRecommendationRequest extends MssRequestType {
@SerializedName("questionTag")
private String questionTag;
@SerializedName("questionList")
private Map<String, String> questionList;
@SerializedName("uuidTaskH")
private String uuidTaskH;
public String getQuestionTag() {
return questionTag;
}
public void setQuestionTag(String questionTag) {
this.questionTag = questionTag;
}
public Map<String, String> getQuestionList() {
return questionList;
}
public void setQuestionList(Map<String, String> questionList) {
this.questionList = questionList;
}
public String getUuidTaskH() {
return uuidTaskH;
}
public void setUuidTaskH(String uuidTaskH) {
this.uuidTaskH = uuidTaskH;
}
}

View file

@ -0,0 +1,13 @@
package com.adins.mss.odr;
import android.os.Bundle;
import androidx.fragment.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}

View file

@ -0,0 +1,129 @@
/*
* 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.util;
import java.util.Collection;
import java.util.LinkedList;
/**
* A {@link LinkedList} version with a maximum number of elements. When adding
* elements to the end of the list, first elements in the list are discarded if
* the maximum size is reached.
*
* @param <E>
* @author Kevin Gaudin
*/
@SuppressWarnings("serial")
public class BoundedLinkedList<E> extends LinkedList<E> {
private final int maxSize;
public BoundedLinkedList(int maxSize) {
this.maxSize = maxSize;
}
/*
* (non-Javadoc)
*
* @see java.util.LinkedList#add(java.lang.Object)
*/
@Override
public boolean add(E object) {
if (size() == maxSize) {
removeFirst();
}
return super.add(object);
}
/*
* (non-Javadoc)
*
* @see java.util.LinkedList#add(int, java.lang.Object)
*/
@Override
public void add(int location, E object) {
if (size() == maxSize) {
removeFirst();
}
super.add(location, object);
}
/*
* (non-Javadoc)
*
* @see java.util.LinkedList#addAll(java.util.Collection)
*/
@Override
public boolean addAll(Collection<? extends E> collection) {
final int totalNeededSize = size() + collection.size();
final int overhead = totalNeededSize - maxSize;
if (overhead > 0) {
removeRange(0, overhead);
}
return super.addAll(collection);
}
/*
* (non-Javadoc)
*
* @see java.util.LinkedList#addAll(int, java.util.Collection)
*/
@Override
public boolean addAll(int location, Collection<? extends E> collection) {
// int totalNeededSize = size() + collection.size();
// int overhead = totalNeededSize - maxSize;
// if(overhead > 0) {
// removeRange(0, overhead);
// }
// return super.addAll(location, collection);
throw new UnsupportedOperationException();
}
/*
* (non-Javadoc)
*
* @see java.util.LinkedList#addFirst(java.lang.Object)
*/
@Override
public void addFirst(E object) {
// super.addFirst(object);
throw new UnsupportedOperationException();
}
/*
* (non-Javadoc)
*
* @see java.util.LinkedList#addLast(java.lang.Object)
*/
@Override
public void addLast(E object) {
add(object);
}
/*
* (non-Javadoc)
*
* @see java.util.AbstractCollection#toString()
*/
@Override
public String toString() {
final StringBuilder result = new StringBuilder();
for (E object : this) {
result.append(object.toString());
}
return result.toString();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape android:shape="rectangle">
<solid android:color="@color/tv_gray"/>
<padding android:left="20dp"
android:right="20dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
</shape>
</item>
</selector>

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.GroupTask;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MS_GROUPTASK".
*/
public class GroupTaskDao extends AbstractDao<GroupTask, String> {
public static final String TABLENAME = "MS_GROUPTASK";
/**
* Properties of entity GroupTask.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Uuid_group_task = new Property(0, String.class, "uuid_group_task", true, "UUID_GROUP_TASK");
public final static Property Group_task_id = new Property(1, String.class, "group_task_id", false, "GROUP_TASK_ID");
public final static Property Uuid_account = new Property(2, String.class, "uuid_account", false, "UUID_ACCOUNT");
public final static Property Last_status = new Property(3, String.class, "last_status", false, "LAST_STATUS");
public final static Property Product_name = new Property(4, String.class, "product_name", false, "PRODUCT_NAME");
public final static Property Project_nett = new Property(5, Integer.class, "project_nett", false, "PROJECT_NETT");
public final static Property Dtm_crt = new Property(6, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
};
public GroupTaskDao(DaoConfig config) {
super(config);
}
public GroupTaskDao(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 + "\"MS_GROUPTASK\" (" + //
"\"UUID_GROUP_TASK\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_group_task
"\"GROUP_TASK_ID\" TEXT," + // 1: group_task_id
"\"UUID_ACCOUNT\" TEXT," + // 2: uuid_account
"\"LAST_STATUS\" TEXT," + // 3: last_status
"\"PRODUCT_NAME\" TEXT," + // 4: product_name
"\"PROJECT_NETT\" INTEGER," + // 5: project_nett
"\"DTM_CRT\" INTEGER);"); // 6: dtm_crt
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MS_GROUPTASK\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(DatabaseStatement stmt, GroupTask entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getUuid_group_task());
String group_task_id = entity.getGroup_task_id();
if (group_task_id != null) {
stmt.bindString(2, group_task_id);
}
String uuid_account = entity.getUuid_account();
if (uuid_account != null) {
stmt.bindString(3, uuid_account);
}
String last_status = entity.getLast_status();
if (last_status != null) {
stmt.bindString(4, last_status);
}
String product_name = entity.getProduct_name();
if (product_name != null) {
stmt.bindString(5, product_name);
}
Integer project_nett = entity.getProject_nett();
if (project_nett != null) {
stmt.bindLong(6, project_nett);
}
java.util.Date dtm_crt = entity.getDtm_crt();
if (dtm_crt != null) {
stmt.bindLong(7, dtm_crt.getTime());
}
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public GroupTask readEntity(Cursor cursor, int offset) {
GroupTask entity = new GroupTask( //
cursor.getString(offset + 0), // uuid_group_task
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // group_task_id
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // uuid_account
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // last_status
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // product_name
cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // project_nett
cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6)) // dtm_crt
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, GroupTask entity, int offset) {
entity.setUuid_group_task(cursor.getString(offset + 0));
entity.setGroup_task_id(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setUuid_account(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setLast_status(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setProduct_name(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setProject_nett(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
entity.setDtm_crt(cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6)));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(GroupTask entity, long rowId) {
return entity.getUuid_group_task();
}
/** @inheritdoc */
@Override
public String getKey(GroupTask entity) {
if(entity != null) {
return entity.getUuid_group_task();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View file

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@color/tv_white"
android:layout_height="match_parent">
<ScrollView android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:padding="8dp">
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/payment_history"
android:textStyle="bold"
android:textSize="24sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:orientation="horizontal">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_agreement_number"
android:textColor="#666"
android:textSize="15sp"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dummy_number"
android:id="@+id/agreementNumber"
android:textColor="#666"
android:textSize="15sp"/>
</LinearLayout>
<HorizontalScrollView android:id="@+id/horizontalScrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<TableLayout android:layout_width="fill_parent"
android:stretchColumns="1"
android:layout_height="wrap_content"
android:id="@+id/tablePaymentHeaders">
<TableRow android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:gravity="center_vertical"
android:background="@drawable/spinner_background"
android:paddingBottom="8dp">
<TextView android:text="@string/label_no"
android:textSize="12sp"
android:paddingRight="6dp"
android:paddingLeft="6dp"
android:textColor="@color/tv_white"
android:gravity="center"
android:textStyle="bold"/>
<TextView android:text="@string/label_transaction_code"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:gravity="center_vertical"
android:textStyle="bold"/>
<TextView android:text="@string/label_posting_date"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:gravity="center_vertical"
android:textStyle="bold"/>
<TextView android:text="@string/label_amount_paid_2"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:gravity="center_vertical"
android:textStyle="bold"/>
<TextView android:text="@string/label_amount_installment_2"
android:textSize="12sp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/tv_white"
android:gravity="center_vertical"
android:textStyle="bold"/>
</TableRow>
</TableLayout>
</HorizontalScrollView>
</LinearLayout>
</ScrollView>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom">
<ImageButton android:id="@+id/imageBtnDownload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_download"
android:background="@android:color/transparent"/>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,133 @@
package com.adins.mss.odr.news;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import com.adins.mss.base.GlobalData;
import com.adins.mss.base.crashlytics.FireCrash;
import com.adins.mss.base.util.GsonHelper;
import com.adins.mss.base.util.Utility;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.MobileContentD;
import com.adins.mss.dao.MobileContentH;
import com.adins.mss.foundation.db.dataaccess.MobileContentDDataAccess;
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
import com.adins.mss.foundation.http.HttpConnectionResult;
import com.adins.mss.foundation.http.HttpCryptedConnection;
import com.adins.mss.odr.R;
import com.google.firebase.perf.FirebasePerformance;
import com.google.firebase.perf.metrics.HttpMetric;
import java.util.List;
public class NewsContentTask extends AsyncTask<Void, Void, Boolean>{
private Activity activity;
private ProgressDialog progressDialog;
private String errMsg = null;
private News news;
private String messageWait;
private String messageEmpty;
private boolean noSubList;
String uuid_mobile_content_h;
public NewsContentTask(Activity activity, String messageWait, String messageEmpty, String uuid_mobile_content_h, boolean noSublist) {
this.activity = activity;
this.messageWait = messageWait;
this.messageEmpty = messageEmpty;
this.uuid_mobile_content_h = uuid_mobile_content_h;
this.noSubList=noSublist;
}
@Override
protected void onPreExecute() {
this.progressDialog = ProgressDialog.show(activity, "", this.messageWait, true);
}
@Override
protected Boolean doInBackground(Void... params) {
String result;
JsonRequestNews requestType = new JsonRequestNews();
requestType.setAudit(GlobalData.getSharedGlobalData().getAuditData());
requestType.addImeiAndroidIdToUnstructured();
requestType.setuuid_mobile_content_h(uuid_mobile_content_h);
String json = GsonHelper.toJson(requestType);
String url = GlobalData.getSharedGlobalData().getURL_GET_NEWSHEADER();
boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
HttpCryptedConnection httpConn = new HttpCryptedConnection(activity, encrypt, decrypt);
HttpConnectionResult serverResult = null;
//Firebase Performance Trace HTTP Request
HttpMetric networkMetric =
FirebasePerformance.getInstance().newHttpMetric(url, FirebasePerformance.HttpMethod.POST);
Utility.metricStart(networkMetric, json);
List<MobileContentD> objectDetail = new News(activity).getlistContentOnDate(uuid_mobile_content_h);
try {
if(objectDetail!=null && objectDetail.size()>0)
serverResult = httpConn.requestToServer(url, json, Global.SORTCONNECTIONTIMEOUT);
else
serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
Utility.metricStop(networkMetric, serverResult);
} catch (Exception e) {
e.printStackTrace();
errMsg = e.getMessage();
}
if(serverResult.isOK()){
result = serverResult.getResult();
JsonResponseNewsContent content = GsonHelper.fromJson(result, JsonResponseNewsContent.class);
if(content.getStatus().getCode()==0){
List<MobileContentD> listContent = content.getListMobileContentD();
news= new News(activity);
MobileContentH contentH = news.getContent(uuid_mobile_content_h);
if(listContent!=null || listContent.size()>0){
for(MobileContentD contentD : listContent){
contentD.setMobileContentH(contentH);
MobileContentDDataAccess.addOrReplace(activity, contentD);
}
}
if(listContent.isEmpty()){
if(MobileContentDDataAccess.getAll(activity, uuid_mobile_content_h).isEmpty()){
errMsg = activity.getResources().getString(R.string.data_not_found);
}
}
}
else{
errMsg=result;
}
}
return serverResult.isOK();
}
@Override
protected void onPostExecute(Boolean result) {
if (progressDialog.isShowing()){
try {
progressDialog.dismiss();
} catch (Exception e) {
FireCrash.log(e);
}
}
NiftyDialogBuilder dialogBuilder;
if(errMsg!=null){
if(GlobalData.isRequireRelogin()){
return;
}
if(errMsg.equals(activity.getResources().getString(R.string.data_not_found))){
dialogBuilder = NiftyDialogBuilder.getInstance(activity);
dialogBuilder.withTitle(activity.getResources().getString(R.string.info_capital)).withIcon(android.R.drawable.ic_dialog_info).withMessage(activity.getString(com.adins.mss.base.R.string.empty_data)).show();
}else{
dialogBuilder = NiftyDialogBuilder.getInstance(activity);
dialogBuilder.withTitle(activity.getResources().getString(R.string.error_capital)).withIcon(android.R.drawable.ic_dialog_alert).withMessage(this.errMsg).show();
}
}else {
Intent intent = new Intent(activity, NewsContentActivity.class);
intent.putExtra("uuid_taskH", uuid_mobile_content_h);
activity.startActivity(intent);
if(noSubList)
activity.finish();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB