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.3 KiB

View file

@ -0,0 +1,48 @@
package com.adins.mss.base.todolist.form;
import com.adins.mss.foundation.http.MssResponseType;
import java.util.List;
/**
* Created by gigin.ginanjar on 29/09/2016.
*/
public class CashOnHandResponse extends MssResponseType {
private String userId;
private String cashLimit;
private String cashOnHand;
private List batchIdList;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getCashLimit() {
return cashLimit;
}
public void setCashLimit(String cashLimit) {
this.cashLimit = cashLimit;
}
public String getCashOnHand() {
return cashOnHand;
}
public void setCashOnHand(String cashOnHand) {
this.cashOnHand = cashOnHand;
}
public List getBatchIdList() {
return batchIdList;
}
public void setBatchIdList(List batchIdList) {
this.batchIdList = batchIdList;
}
}

View file

@ -0,0 +1,84 @@
package com.adins.mss.base.dynamicform.form.questions;
/**
* Created by gigin.ginanjar on 05/09/2016.
*/
import androidx.core.view.ViewCompat;
import androidx.core.view.ViewPropertyAnimatorCompat;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
/**
* @see androidx.recyclerview.widget.RecyclerView#setItemAnimator(androidx.recyclerview.widget.RecyclerView.ItemAnimator)
*/
public class SlideInOutLeftItemAnimator extends BaseItemAnimator {
public SlideInOutLeftItemAnimator(RecyclerView recyclerView) {
super(recyclerView);
}
protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
mRemoveAnimations.add(holder);
animation
.setDuration(getRemoveDuration())
.alpha(0)
.translationX(-mRecyclerView.getLayoutManager().getWidth())
.setListener(new VpaListenerAdapter() {
@Override
public void onAnimationStart(View view) {
dispatchRemoveStarting(holder);
}
@Override
public void onAnimationEnd(View view) {
animation.setListener(null);
ViewCompat.setAlpha(view, 1);
ViewCompat.setTranslationX(view, -mRecyclerView.getLayoutManager().getWidth());
dispatchRemoveFinished(holder);
mRemoveAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
protected void prepareAnimateAdd(RecyclerView.ViewHolder holder) {
ViewCompat.setTranslationX(holder.itemView, -mRecyclerView.getLayoutManager().getWidth());
}
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
mAddAnimations.add(holder);
animation.translationX(0)
.alpha(1)
.setDuration(getAddDuration())
.setListener(new VpaListenerAdapter() {
@Override
public void onAnimationStart(View view) {
dispatchAddStarting(holder);
}
@Override
public void onAnimationCancel(View view) {
ViewCompat.setTranslationX(view, 0);
ViewCompat.setAlpha(view, 1);
}
@Override
public void onAnimationEnd(View view) {
animation.setListener(null);
ViewCompat.setTranslationX(view, 0);
ViewCompat.setAlpha(view, 1);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -0,0 +1,81 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bgColor"
android:orientation="vertical"
tools:context="com.adins.mss.base.fragments.SettingFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--<View-->
<!--android:id="@+id/toolbar"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="?android:actionBarSize"-->
<!--android:background="@drawable/actionbar_background"/>-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/mLanguages"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="16dp"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
app:srcCompat="@drawable/ic_translate_24dp"
android:layout_marginRight="16dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:layout_gravity="center_vertical"
android:text="@string/menu_setting_language"/>
</LinearLayout>
<LinearLayout
android:id="@+id/mPrinting"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="16dp"
android:orientation="horizontal"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
app:layout_constraintTop_toBottomOf="@+id/mLanguages"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
app:srcCompat="@drawable/ic_print_24dp"
android:layout_marginRight="16dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:layout_gravity="center_vertical"
android:text="@string/menu_setting_printing"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,33 @@
package com.adins.mss.foundation.dialog.gitonway.lib.effects;
import android.view.View;
import com.adins.libs.nineoldandroids.animation.ObjectAnimator;
/*
* Copyright 2014 litao
* https://github.com/sd6352051/NiftyDialogEffects
*
* 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.
*/
public class SlideTop extends BaseEffects {
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "translationY", -300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
);
}
}

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:background="@android:color/white"
android:orientation="vertical"
tools:context=".pdfrenderer.ViewPdfRendererFragment">
<ImageView
android:id="@+id/imageViewPdf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:contentDescription="@null" />
</LinearLayout>

View file

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Follow-Up"
android:textSize="@dimen/textSizeLarge_openSource"
android:padding="5dp"
android:layout_marginBottom="5dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Nama Konsumen" />
<EditText
android:id="@+id/namaKonsumen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@drawable/form_edittext_background"
android:enabled="false"
android:hint="(auto fill)"
android:padding="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Nomor Perjanjian"
android:layout_marginBottom="5dp"/>
<EditText
android:id="@+id/nomorPerjanjian"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="(auto fill)"
android:background="@drawable/form_edittext_background"
android:enabled="false"
android:padding="5dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Tanggal Janji Bayar"
android:layout_marginBottom="5dp"/>
<EditText
android:id="@+id/tanggalJanjiBayar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="(auto fill)"
android:background="@drawable/form_edittext_background"
android:enabled="false"
android:padding="5dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Catatan"
android:layout_marginBottom="5dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/catatan"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/form_edittext_background"
android:inputType="textMultiLine"
android:scrollbars="vertical"
android:padding="5dp"
android:gravity="top|start"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@+id/catatan"
android:layout_marginEnd="5dp"
android:layout_weight="0.1"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:background="@drawable/form_edittext_default">
<Button
android:id="@+id/button_scroll_up"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="▲"
android:padding="0dp"
android:background="?android:attr/selectableItemBackground"
android:textSize="14sp"
android:layout_marginBottom="10dp"/>
<Button
android:id="@+id/button_scroll_down"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="▼"
android:padding="0dp"
android:background="?android:attr/selectableItemBackground"
android:textSize="14sp"
android:layout_marginTop="10dp"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/submitFormBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/btnSubmit"
android:textColor="@color/fontColorWhite"
android:background="@drawable/button_background"/>
</LinearLayout>

View file

@ -0,0 +1,58 @@
package com.services;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
import java.util.List;
public class RestartAutoSendLocationReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i(getClass().getSimpleName(), "Received message to restart service Tracking History");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
return;
if (!isAppRunning(context, context.getPackageName())) {
Intent main = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
if (main != null) {
main.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(main);
}
ObscuredSharedPreferences sharedPref = ObscuredSharedPreferences.getPrefs(context,
"GlobalData", Context.MODE_PRIVATE);
boolean hasLogged = sharedPref.getBoolean("HAS_LOGGED", false);
if (!ForegroundServiceNotification.isServiceAvailable(context, MSLocationTrackingService.class)
&& hasLogged) {
String manufacture = Build.MANUFACTURER.toLowerCase();
switch (manufacture) {
case "vivo":
context.startService(new Intent(context, MSLocationTrackingService.class));
break;
default:
break;
}
}
}
public static boolean isAppRunning(final Context context, final String packageName) {
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
final List<ActivityManager.RunningAppProcessInfo> procInfos = activityManager.getRunningAppProcesses();
if (procInfos != null)
{
for (final ActivityManager.RunningAppProcessInfo processInfo : procInfos) {
if (processInfo.processName.equals(packageName)) {
return true;
}
}
}
return false;
}
}

View file

@ -0,0 +1,121 @@
package com.adins.mss.base.errorhandler;
import android.content.Context;
import com.adins.mss.base.R;
import com.adins.mss.foundation.http.HttpConnectionResult;
import com.google.gson.JsonParseException;
import java.io.IOException;
/**
* Created by intishar.fa on 31/10/2018.
*/
public class ErrorMessageHandler {
IShowError iShowError;
private int currentNotifType;
public static final int TOAST_TYPE = 0;
public static final int DIALOG_TYPE = 1;
public ErrorMessageHandler(){}
public ErrorMessageHandler(IShowError iShowError){
this.iShowError = iShowError;
}
public int getCurrentNotifType() {
return currentNotifType;
}
public void setCurrentNotifType(int currentNotifType) {
this.currentNotifType = currentNotifType;
}
public void processError(Context context,HttpConnectionResult connectionResult, int notiftype){
String errorMessage = "";
String errorSubject = "";
this.currentNotifType = notiftype;
if(connectionResult != null){
switch (connectionResult.getStatusCode()){
case 400: errorMessage = context.getString(R.string.http_status_400);
break;
case 401: errorMessage = context.getString(R.string.http_status_401);
break;
case 403: errorMessage = context.getString(R.string.http_status_403);
break;
case 404: errorMessage = context.getString(R.string.http_status_404);
break;
case 408: errorMessage = context.getString(R.string.http_status_408);
break;
case 409: errorMessage = context.getString(R.string.http_status_409);
break;
case 500: errorMessage = context.getString(R.string.http_status_500);
break;
case 502: errorMessage = context.getString(R.string.http_status_502);
break;
case 503: errorMessage = context.getString(R.string.http_status_503);
break;
default: errorMessage = connectionResult.getResult();
}
}
if(iShowError != null){
iShowError.showError(errorSubject,errorMessage, notiftype);
}
}
public void processError(HttpConnectionResult connectionResult, String customErrorMsg, int notiftype){
String errorMessage = "";
String errorSubject = "Http Exception";
this.currentNotifType = notiftype;
if(connectionResult != null){
if(customErrorMsg == null || customErrorMsg.equals("")){
errorMessage = connectionResult.getResult();
}
else {
errorMessage = customErrorMsg;
}
}
if(iShowError != null){
iShowError.showError(errorSubject,errorMessage,notiftype);
}
}
public void processError(String errorSubject, String errorMsg, int notiftype){
this.currentNotifType = notiftype;
if(iShowError != null && errorMsg != null){
iShowError.showError(errorSubject,errorMsg, notiftype);
}
}
public void processError(Exception ex,int notiftype){
String errorMsg = "";
String errorSubject = "";
this.currentNotifType = notiftype;
if(ex != null){
if(ex instanceof IOException){
IOException exception = (IOException)ex;
errorMsg = exception.getMessage();
errorSubject = exception.toString();
}
else if(ex instanceof JsonParseException){
JsonParseException exception = (JsonParseException)ex;
errorMsg = exception.getMessage();
errorSubject = exception.toString();
}
else {
errorMsg = ex.getMessage();
errorSubject = ex.toString();
}
}
if(iShowError != null){
iShowError.showError(errorSubject,errorMsg,notiftype);
}
}
public void setiShowError(IShowError iShowError) {
this.iShowError = iShowError;
}
}

View file

@ -0,0 +1,13 @@
package com.adins.mss.svy;
import android.app.Application;
//import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest {
/*public ApplicationTest() {
super(Application.class);
}*/
}