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,454 @@
package com.adins.mss.base.todolist.form;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.adins.mss.base.Backup;
import com.adins.mss.base.GlobalData;
import com.adins.mss.base.R;
import com.adins.mss.base.crashlytics.FireCrash;
import com.adins.mss.base.dynamicform.CustomerFragment;
import com.adins.mss.base.dynamicform.SurveyHeaderBean;
import com.adins.mss.base.dynamicform.TaskManager;
import com.adins.mss.base.mainmenu.MainMenuActivity;
import com.adins.mss.base.todolist.ToDoList;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.Scheme;
import com.adins.mss.dao.TaskD;
import com.adins.mss.dao.TaskH;
import com.adins.mss.foundation.db.dataaccess.SchemeDataAccess;
import com.adins.mss.foundation.db.dataaccess.TaskDDataAccess;
import com.adins.mss.foundation.db.dataaccess.TaskHDataAccess;
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
import com.adins.mss.foundation.dialog.NiftyDialogBuilder_PL;
import com.adins.mss.foundation.formatter.Tool;
import java.util.ArrayList;
import java.util.List;
/**
* A fragment representing a list of Items.
* <p/>
*/
public class StatusTabFragment extends Fragment implements OnTaskListClickListener, TasklistListener {
private static final String ARG_COLUMN_COUNT = "column-count";
public static ListHandler handler;
private static boolean isStatusOpen = false;
public List<TaskH> listTaskH;
public ToDoList toDoList;
private int mColumnCount = 3;
private StatusViewAdapter viewAdapter;
private SwipeRefreshLayout mSwipeRefreshLayout;
private TasklistInterface iTasklist;
/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public StatusTabFragment() {
}
@SuppressWarnings("unused")
public static StatusTabFragment newInstance(int columnCount) {
StatusTabFragment fragment = new StatusTabFragment();
Bundle args = new Bundle();
args.putInt(ARG_COLUMN_COUNT, columnCount);
fragment.setArguments(args);
return fragment;
}
@Override
public void onResume() {
super.onResume();
isStatusOpen = true;
try {
if (Global.APPLICATION_ORDER.equalsIgnoreCase(GlobalData.getSharedGlobalData().getAuditData().getApplication())) {
getActivity().getActionBar().setTitle(getActivity().getString(R.string.title_mn_tasklist));
} else if (Global.APPLICATION_SURVEY.equalsIgnoreCase(GlobalData.getSharedGlobalData().getAuditData().getApplication())) {
if (MainMenuActivity.mnTaskList == null) {
getActivity().getActionBar().setTitle("Status Task");
}
}
try {
MainMenuActivity.setDrawerCounter();
} catch (Exception e) {
FireCrash.log(e);
}
} catch (Exception e) {
FireCrash.log(e);
}
if (listTaskH != null) iTasklist.initiateRefresh("status");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
iTasklist = new TasklistImpl(this, this);
if (getArguments() != null) {
mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
}
toDoList = iTasklist.getTodoList();
listTaskH = toDoList.getListTaskInStatus(ToDoList.SEARCH_BY_ALL, "");
handler = new ListHandler();
}
@Override
public void onPause() {
super.onPause();
isStatusOpen = false;
}
@Override
public void onDestroy() {
super.onDestroy();
isStatusOpen = false;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment__status_list, container, false);
// Set the adapter
if (view instanceof RelativeLayout) {
Context context = view.getContext();
View view2 = view.findViewById(R.id.actionbar);
String application = GlobalData.getSharedGlobalData().getAuditData().getApplication();
if (Global.APPLICATION_ORDER.equalsIgnoreCase(application)) {
view2.setVisibility(View.VISIBLE);
RelativeLayout mainLayout = (RelativeLayout) view.findViewById(R.id.mainLayout);
mainLayout.setBackgroundResource(R.drawable.bg_grayscale);
} else if (Global.APPLICATION_SURVEY.equalsIgnoreCase(application)) {
if (MainMenuActivity.mnTaskList != null)
view2.setVisibility(View.GONE);
else {
view2.setVisibility(View.VISIBLE);
RelativeLayout mainLayout = (RelativeLayout) view.findViewById(R.id.mainLayout);
mainLayout.setBackgroundResource(R.drawable.bg_grayscale);
}
} else {
view2.setVisibility(View.GONE);
}
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.listStatus);
if (mColumnCount <= 1) {
recyclerView.setLayoutManager(new LinearLayoutManager(context));
} else {
recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
}
viewAdapter = new StatusViewAdapter(listTaskH, this);
recyclerView.setAdapter(viewAdapter);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swiperefresh);
// BEGIN_INCLUDE (change_colors)
// Set the color scheme of the SwipeRefreshLayout by providing 4 color resource ids
mSwipeRefreshLayout.setColorSchemeColors(
getResources().getColor(R.color.tv_light), getResources().getColor(R.color.tv_normal),
getResources().getColor(R.color.tv_dark), getResources().getColor(R.color.tv_darker));
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
iTasklist.initiateRefresh("status");
}
});
}
return view;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
}
@Override
public void onDetach() {
super.onDetach();
}
@Override
public void onRefreshBackgroundCancelled(boolean value) {
dismissSwiperRefresh();
}
@Override
public void onRefreshBackgroundComplete(List<TaskH> result) {
onRefreshComplete(result);
}
@Override
public void onItemClickListener(TaskH item, int position) {
try {
Scheme scheme = null;
scheme = item.getScheme();
if (scheme == null) {
if (item.getUuid_scheme() != null) {
scheme = SchemeDataAccess.getOne(getActivity(),
item.getUuid_scheme());
if (scheme != null)
item.setScheme(scheme);
}
}
if (scheme == null) {
Toast.makeText(getActivity(),
getActivity().getString(R.string.task_cant_seen2),
Toast.LENGTH_SHORT).show();
} else {
SurveyHeaderBean header = new SurveyHeaderBean(item);
CustomerFragment fragment = CustomerFragment.create(header);
FragmentTransaction transaction = MainMenuActivity.fragmentManager.beginTransaction();
transaction.setCustomAnimations(R.anim.activity_open_translate, R.anim.activity_close_scale, R.anim.activity_open_scale, R.anim.activity_close_translate);
transaction.replace(R.id.content_frame, fragment);
transaction.addToBackStack(null);
transaction.commit();
}
} catch (Exception e) {
FireCrash.log(e);
Toast.makeText(
getActivity(),
getActivity().getString(R.string.scheme_gone)
+ e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onItemLongClickListener(final TaskH item, int position) {
try {
if (item.getStatus().equals(TaskHDataAccess.STATUS_SEND_UPLOADING)) {
try {
final NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(getActivity());
dialogBuilder.withTitle(getActivity().getString(R.string.info_capital))
.withMessage(getActivity().getString(R.string.confirm_upload) + " " + item.getCustomer_name() + " ?")
.withButton1Text(getActivity().getString(R.string.btnYes))
.withButton2Text(getActivity().getString(R.string.btnCancel))
.setButton1Click(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
dialogBuilder.dismiss();
if (Tool.isInternetconnected(getActivity())) {
String message = null;
List<TaskD> taskd = TaskDDataAccess.getUnsentImageByTaskH(getActivity(), item.getUuid_user(), item.getUuid_task_h());
if (Global.isIsUploading() || Global.isIsManualUploading()) {
Toast.makeText(getActivity(), getActivity().getString(R.string.upload_on_queue), Toast.LENGTH_SHORT).show();
} else {
try {
TaskManager.ManualUploadImage(getActivity(), taskd);
for (int i = 1; i < getActivity().getSupportFragmentManager().getBackStackEntryCount(); i++)
getActivity().getSupportFragmentManager().popBackStack();
} catch (Exception e) {
FireCrash.log(e);
message = getActivity().getString(R.string.request_error);
}
try {
if(taskd.isEmpty()){
List<TaskD> taskDList = TaskDDataAccess.getAll(getActivity(), item.getUuid_task_h(), TaskDDataAccess.IMAGE_ONLY);
if(!taskDList.isEmpty()){
List<TaskD> taskDetail = new ArrayList();
taskDetail.add(taskDList.get(0));
TaskManager.ManualUploadImage(getActivity(), taskDetail);
}
}else{
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
}
}catch (Exception e){
Toast.makeText(getActivity(), getActivity().getString(R.string.request_error), Toast.LENGTH_SHORT).show();
}
}
} else {
Toast.makeText(getActivity(), getActivity().getString(R.string.no_internet_connection), Toast.LENGTH_SHORT).show();
}
if (StatusTabFragment.handler != null)
StatusTabFragment.handler.sendEmptyMessage(0);
}
})
.setButton2Click(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialogBuilder.dismiss();
}
})
.show();
} catch (Exception e) {
FireCrash.log(e);
e.printStackTrace();
}
} else if (item.getStatus().equals(TaskHDataAccess.STATUS_SEND_PENDING)) {
String btnText1 = getActivity().getString(R.string.btnSend);
if (item.getIs_prepocessed() != null && item.getIs_prepocessed().equals(Global.FORM_TYPE_VERIFICATION))
btnText1 = "Verify";
final NiftyDialogBuilder_PL dialogBuilder = NiftyDialogBuilder_PL.getInstance(getActivity());
dialogBuilder.withNoTitle()
.withNoMessage()
.withButton1Text(btnText1)
.withButton2Text(getActivity().getString(R.string.btnDelete))
.setButton1Click(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
dialogBuilder.dismiss();
if (Tool.isInternetconnected(getActivity())) {
if (item.getTask_id() != null) {
new TaskManager().saveAndSendTaskOnBackground(getActivity(), item.getTask_id(), false, false);
for (int i = 1; i < getActivity().getSupportFragmentManager().getBackStackEntryCount(); i++)
getActivity().getSupportFragmentManager().popBackStack();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
try {
MainMenuActivity.setDrawerCounter();
} catch (Exception e) {
FireCrash.log(e);
}
listTaskH.clear();
listTaskH.addAll(toDoList.getListTaskInStatus(ToDoList.SEARCH_BY_ALL, ""));
viewAdapter.notifyDataSetChanged();
}
});
}
} else {
Toast.makeText(getActivity(), getActivity().getString(R.string.no_internet_connection), Toast.LENGTH_SHORT).show();
}
}
})
.setButton2Click(new View.OnClickListener() {
@Override
public void onClick(View v) {
TaskHDataAccess.deleteWithRelation(getActivity(), item);
if (item.getTask_id() != null)
ToDoList.removeSurveyFromList(item.getTask_id());
if (StatusTabFragment.handler != null)
StatusTabFragment.handler.sendEmptyMessage(0);
listTaskH.clear();
listTaskH.addAll(toDoList.getListTaskInStatus(ToDoList.SEARCH_BY_ALL, ""));
viewAdapter.notifyDataSetChanged();
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
public void run() {
try {
MainMenuActivity.setDrawerCounter();
} catch (Exception e) {
FireCrash.log(e);
}
}
});
dialogBuilder.dismiss();
}
}).show();
} else {
final NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(getActivity());
dialogBuilder.withTitle(getActivity().getString(R.string.info_capital))
.withMessage(getActivity().getString(R.string.confirm_delete) + " " + item.getCustomer_name() + " ?")
.withButton1Text(getActivity().getString(R.string.btnYes))
.withButton2Text(getActivity().getString(R.string.btnCancel))
.setButton1Click(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
TaskHDataAccess.deleteWithRelation(getActivity(), item);
ToDoList.removeSurveyFromList(item.getTask_id());
Backup backup = new Backup(getContext());
List<TaskH> taskHList = new ArrayList<>();
taskHList.add(item);
backup.removeTask(new ArrayList<TaskH>(taskHList));
if (StatusTabFragment.handler != null)
StatusTabFragment.handler.sendEmptyMessage(0);
listTaskH.clear();
listTaskH.addAll(toDoList.getListTaskInStatus(ToDoList.SEARCH_BY_ALL, ""));
viewAdapter.notifyDataSetChanged();
dialogBuilder.dismiss();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
try {
MainMenuActivity.setDrawerCounter();
} catch (Exception e) {
FireCrash.log(e);
}
}
});
}
})
.setButton2Click(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialogBuilder.dismiss();
}
})
.show();
}
} catch (Exception ex) {
}
}
private void onRefreshComplete(List<TaskH> result) {
//Reset List Item Collection in Adapter
listTaskH.clear();
listTaskH.addAll(result);
viewAdapter.notifyDataSetChanged();
// Stop the refreshing indicator
dismissSwiperRefresh();
}
private void dismissSwiperRefresh() {
if (mSwipeRefreshLayout != null && mSwipeRefreshLayout.isRefreshing())
mSwipeRefreshLayout.setRefreshing(false);
}
@Override
public void onDestroyView() {
super.onDestroyView();
iTasklist.cancelRefreshTask();
isStatusOpen = false;
}
public class ListHandler extends Handler {
@Override
public void handleMessage(Message msg) {
if (isStatusOpen) {
try {
if (listTaskH != null) iTasklist.initiateRefresh("status");
} catch (Exception e) {
FireCrash.log(e);
e.printStackTrace();
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,27 @@
<?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:layout_height="match_parent">
<Button
android:id="@+id/btnSubmit2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="allTask"
android:text="@string/submit_all_task"
android:textColor="@android:color/white" />
<Button
android:id="@+id/btnSubmit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="taskCollection"
android:text="@string/submit_task_collection"
android:textColor="@android:color/white" />
<FrameLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/content_frame">
</FrameLayout>
</LinearLayout>

View file

@ -0,0 +1,56 @@
package com.adins.mss.coll.loyalti.barchart.ranklegends;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.adins.mss.coll.R;
import com.adins.mss.coll.models.loyaltymodels.RankDetail;
import java.util.ArrayList;
import java.util.List;
public class RankLegendsAdapter extends BaseAdapter {
private List<RankDetail> dataset = new ArrayList<>();
private Context context;
public RankLegendsAdapter(Context context,List<RankDetail> dataset) {
this.context = context;
for(int i=dataset.size()-1; i>=0; i--){
this.dataset.add(dataset.get(i));
}
}
@Override
public int getCount() {
return dataset.size();
}
@Override
public Object getItem(int position) {
return dataset.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null){
convertView = LayoutInflater.from(context).inflate(R.layout.rank_legend_item,parent,false);
}
RankDetail item = dataset.get(position);
TextView legendText = convertView.findViewById(R.id.legendText);
legendText.setTextColor(item.colorValue);
legendText.setText(item.level);
return convertView;
}
}

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".dynamicform.form.FragmentQuestion"
android:fitsSystemWindows="true">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:cardElevation="@dimen/card_shadow"
android:layout_margin="@dimen/card_margin"
app:cardCornerRadius="5dp"
app:contentPadding="5dp"
android:background="@color/fontColorWhite">
<com.adins.mss.base.dynamicform.form.questions.viewholder.ExpandableRecyclerView
android:id="@+id/questionList"
android:name="com.adins.mss.base.dynamicform.form.QuestionFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="false"
app:layoutManager="LinearLayoutManager" />
<com.adins.mss.base.dynamicform.form.questions.viewholder.ExpandableRecyclerView
android:id="@+id/reviewList"
android:name="com.adins.mss.base.dynamicform.form.QuestionFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:layoutManager="LinearLayoutManager" />
</androidx.cardview.widget.CardView>
</RelativeLayout>

View file

@ -0,0 +1,71 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<View
android:id="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:background="@drawable/actionbar_background" />
<TextView
android:id="@+id/contentComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_margin="6dp"
android:text="Change Profile Picture" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" >
<ImageView
android:id="@+id/profilePicture"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="6dp"
android:layout_marginLeft="32dp"
android:src="@drawable/profile_image" />
<Button
android:id="@+id/btnChangeProfile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="31dp"
android:text="Change" />
</LinearLayout>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:text="Change Header Picture"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" >
<ImageView
android:id="@+id/headerPicture"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/dummy" />
<Button
android:id="@+id/btnChangeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="24dp"
android:text="change" />
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bgColor"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/deviceInfoContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="@dimen/card_margin"
app:cardBackgroundColor="@color/fontColorWhite"
app:cardCornerRadius="10dp"
app:cardElevation="@dimen/card_shadow"
app:contentPadding="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txtAppVer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_mobile"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/appVer"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtOsVer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_android"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/androidVersion"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtBattery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_battery"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/batteryPercen"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtDataUsage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_app_storage"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/appStorage"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone"/>
<TextView
android:id="@+id/txtMobileDataUsage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_data_usage_color"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/dataUsage"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtMemoryAvailable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_storage"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/deviceStorage"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtAndroidId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_android"
android:drawablePadding="5dp"
android:paddingBottom="5dp"
android:text="@string/androidID"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="visible"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/fontColorWhite"
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector>

View file

@ -0,0 +1,171 @@
package com.adins.mss.foundation.phone;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import androidx.core.content.ContextCompat;
import android.telephony.TelephonyManager;
import com.adins.mss.base.crashlytics.FireCrash;
import java.lang.reflect.Method;
import java.util.UUID;
/**
* Created by gigin.ginanjar on 14/09/2016.
*/
public class TelephonyInfo {
private static TelephonyInfo telephonyInfo;
private String imsiSIM1;
private String imsiSIM2;
private TelephonyInfo() {
}
public static TelephonyInfo getInstance(Context context) {
if (telephonyInfo == null) {
telephonyInfo = new TelephonyInfo();
TelephonyManager telephonyManager = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE));
if (ContextCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED
&& Build.VERSION.SDK_INT <= 28) {
telephonyInfo.imsiSIM1 = telephonyManager.getDeviceId();
telephonyInfo.imsiSIM2 = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (telephonyManager.getPhoneCount() >= 2) { //Check is phone has 2 or more sim card
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
telephonyInfo.imsiSIM1 = telephonyManager.getImei(0);
telephonyInfo.imsiSIM2 = telephonyManager.getImei(1);
} else {
telephonyInfo.imsiSIM1 = telephonyManager.getDeviceId(0);
telephonyInfo.imsiSIM2 = telephonyManager.getDeviceId(1);
}
} else { //Phone only has single sim card
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
telephonyInfo.imsiSIM1 = telephonyManager.getImei();
telephonyInfo.imsiSIM2 = null;
}
}
} else {
try {
telephonyInfo.imsiSIM1 = getDeviceIdBySlot(context, "getDeviceIdGemini", 0);
telephonyInfo.imsiSIM2 = getDeviceIdBySlot(context, "getDeviceIdGemini", 1);
} catch (GeminiMethodNotFoundException e) {
try {
telephonyInfo.imsiSIM1 = getDeviceIdBySlot(context, "getDeviceId", 0);
telephonyInfo.imsiSIM2 = getDeviceIdBySlot(context, "getDeviceId", 1);
} catch (GeminiMethodNotFoundException e1) {
try {
telephonyInfo.imsiSIM1 = getDeviceIdBySlot(context, "getDeviceIdDs", 0);
telephonyInfo.imsiSIM2 = getDeviceIdBySlot(context, "getDeviceIdDs", 1);
} catch (GeminiMethodNotFoundException e2) {
try {
telephonyInfo.imsiSIM1 = getDeviceIdBySlot(context, "getSimSerialNumberGemini", 0);
telephonyInfo.imsiSIM2 = getDeviceIdBySlot(context, "getSimSerialNumberGemini", 1);
} catch (GeminiMethodNotFoundException e3) {
//Call here for next manufacturer's predicted method name if you wish
e3.printStackTrace();
}
}
}
}
}
} else {
telephonyInfo.imsiSIM1 = UUID.randomUUID().toString();
telephonyInfo.imsiSIM2 = null;
}
}
return telephonyInfo;
}
private static String getDeviceIdBySlot(Context context, String predictedMethodName, int slotID) throws GeminiMethodNotFoundException {
String imsi = null;
TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
try {
Class<?> telephonyClass = Class.forName(telephony.getClass().getName());
Class<?>[] parameter = new Class[1];
parameter[0] = int.class;
Method getSimID = telephonyClass.getMethod(predictedMethodName, parameter);
Object[] obParameter = new Object[1];
obParameter[0] = slotID;
Object ob_phone = getSimID.invoke(telephony, obParameter);
if (ob_phone != null) {
imsi = ob_phone.toString();
}
} catch (Exception e) {
FireCrash.log(e);
e.printStackTrace();
throw new GeminiMethodNotFoundException(predictedMethodName);
}
return imsi;
}
private static boolean getSIMStateBySlot(Context context, String predictedMethodName, int slotID) throws GeminiMethodNotFoundException {
boolean isReady = false;
TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
try {
Class<?> telephonyClass = Class.forName(telephony.getClass().getName());
Class<?>[] parameter = new Class[1];
parameter[0] = int.class;
Method getSimStateGemini = telephonyClass.getMethod(predictedMethodName, parameter);
Object[] obParameter = new Object[1];
obParameter[0] = slotID;
Object ob_phone = getSimStateGemini.invoke(telephony, obParameter);
if (ob_phone != null) {
int simState = Integer.parseInt(ob_phone.toString());
if (simState == TelephonyManager.SIM_STATE_READY) {
isReady = true;
}
}
} catch (Exception e) {
FireCrash.log(e);
e.printStackTrace();
throw new GeminiMethodNotFoundException(predictedMethodName);
}
return isReady;
}
public String getImeiSIM1() {
return imsiSIM1;
}
public String getImeiSIM2() {
return imsiSIM2;
}
public boolean isDualSIM() {
return imsiSIM2 != null;
}
private static class GeminiMethodNotFoundException extends Exception {
private static final long serialVersionUID = -996812356902545308L;
public GeminiMethodNotFoundException(String info) {
super(info);
}
}
}

View file

@ -0,0 +1,17 @@
package com.adins.mss.base.loyalti.model;
import com.google.gson.annotations.SerializedName;
public class RankDetail {
@SerializedName("LEVEL")
public String level;
@SerializedName("RANK")
public String rank;
public transient int colorValue;
public RankDetail(String level, String rank, int colorValue) {
this.level = level;
this.rank = rank;
this.colorValue = colorValue;
}
}

View file

@ -0,0 +1,26 @@
package com.adins.mss.base.dynamicform;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
public class JsonRequestTaskD extends MssRequestType {
/**
* Property uuid_task_h
*/
@SerializedName("uuid_task_h")
String uuid_task_h;
/**
* Gets the uuid_task_h
*/
public String getuuid_task_h() {
return this.uuid_task_h;
}
/**
* Sets the uuid_task_h
*/
public void setuuid_task_h(String value) {
this.uuid_task_h = value;
}
}