mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
package com.adins.mss.foundation.UserHelp.Bean.Dummy;
|
||||
|
||||
public class UserHelpIconDummy {
|
||||
private String icon;
|
||||
private UserHelpPropertiesDummy properties;
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public UserHelpPropertiesDummy getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(UserHelpPropertiesDummy properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.adins.mss.base.tracking;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.LocationInfo;
|
||||
import com.adins.mss.foundation.camerainapp.helper.Logger;
|
||||
import com.adins.mss.foundation.db.dataaccess.LocationInfoDataAccess;
|
||||
import com.adins.mss.foundation.http.HttpConnectionResult;
|
||||
import com.adins.mss.foundation.services.ScheduledConnectionItem;
|
||||
import com.adins.mss.foundation.services.ScheduledItem.ScheduledItemHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Default ScheduledConnectionItem for location tracking. It automatically query locations info from database and try to send it over
|
||||
* Internet connection to server
|
||||
*
|
||||
* @author glen.iglesias
|
||||
*/
|
||||
public class LocationTrackingSchedule extends ScheduledConnectionItem implements ScheduledItemHandler {
|
||||
|
||||
Context context;
|
||||
List<LocationInfo> processedList;
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param id of ScheduledItem to be registered to AutoSendService
|
||||
* @param interval time delay between trigger
|
||||
* @param url target URL
|
||||
* @param encrypt need of encryption
|
||||
* @param decrypt need of decryption
|
||||
*/
|
||||
public LocationTrackingSchedule(Context context, String id, int interval, String url, boolean encrypt, boolean decrypt) {
|
||||
super(id, interval, url, encrypt, decrypt);
|
||||
this.context = context;
|
||||
this.url = url;
|
||||
this.setHandler(this);
|
||||
|
||||
this.processedList = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getData() {
|
||||
try {
|
||||
GlobalData.getSharedGlobalData().getUser().getUuid_user();
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
//add to database
|
||||
LocationInfoDataAccess.add(context, Global.LTM.getCurrentLocation(Global.FLAG_LOCATION_TRACKING));
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSuccess(HttpConnectionResult result) {
|
||||
LocationInfoDataAccess.deleteList(context, processedList);
|
||||
processedList.clear();
|
||||
Logger.d("LocationTracking", "success connection");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onFail(HttpConnectionResult result) {
|
||||
processedList.clear();
|
||||
Logger.d("LocationTracking", "fail connection");
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package com.adins.mss.odr.products.adapter;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.base.NewMainActivity;
|
||||
import com.adins.mss.dao.Product;
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
import com.adins.mss.foundation.image.Utils;
|
||||
import com.adins.mss.odr.R;
|
||||
import com.adins.mss.odr.products.ProductDetailFragment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by muhammad.aap on 11/15/2018.
|
||||
*/
|
||||
|
||||
public class ProductListAdapter extends RecyclerView.Adapter<ProductListAdapter.ProductViewHolder> {
|
||||
private FragmentActivity activity;
|
||||
private List<Product> objects;
|
||||
private Fragment fragment;
|
||||
|
||||
public ProductListAdapter(FragmentActivity activity, List<Product> objects) {
|
||||
this.activity = activity;
|
||||
this.objects = objects;
|
||||
}
|
||||
|
||||
public class ProductViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
private TextView txtName;
|
||||
private TextView txtPrice;
|
||||
private ImageView imgProduct;
|
||||
|
||||
public ProductViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
mView = itemView;
|
||||
txtName = (TextView) itemView.findViewById(R.id.productNameText); //punya list item
|
||||
txtPrice = (TextView) itemView.findViewById(R.id.productPriceText);
|
||||
imgProduct = (ImageView) itemView.findViewById(R.id.productPicture);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.product_list_item, parent, false);
|
||||
ProductViewHolder viewHolder = new ProductViewHolder(v);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ProductViewHolder holder, final int position) {
|
||||
if (objects.get(position).getLob_image() != null) {
|
||||
Bitmap bitmapImage = Utils.byteToBitmap(objects.get(position).getLob_image());
|
||||
holder.imgProduct.setImageBitmap(bitmapImage);
|
||||
} else {
|
||||
holder.imgProduct.setImageResource(R.drawable.img_notavailable);
|
||||
holder.imgProduct.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
}
|
||||
|
||||
holder.txtName.setText(objects.get(position).getProduct_name());
|
||||
String currency = Tool.separateThousand(objects.get(position).getProduct_value().toString());
|
||||
holder.txtPrice.setText("Rp " + currency);
|
||||
|
||||
holder.mView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String uuidProduct = objects.get(position).getUuid_product();
|
||||
gotoProductsDetail(uuidProduct);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (objects == null || objects.size() == 0)
|
||||
return 0;
|
||||
else
|
||||
return objects.size();
|
||||
}
|
||||
|
||||
private void gotoProductsDetail(String productId) {
|
||||
fragment = new ProductDetailFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("uuidProduct", productId);
|
||||
fragment.setArguments(bundle);
|
||||
FragmentTransaction transaction = NewMainActivity.fragmentManager.beginTransaction();
|
||||
transaction.setCustomAnimations(com.adins.mss.base.R.anim.activity_open_translate, com.adins.mss.base.R.anim.activity_close_scale, com.adins.mss.base.R.anim.activity_open_scale, com.adins.mss.base.R.anim.activity_close_translate);
|
||||
transaction.replace(com.adins.mss.base.R.id.content_frame, fragment);
|
||||
transaction.addToBackStack(null);
|
||||
transaction.commit();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
package com.adins.mss.odr.update;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.AsyncTask;
|
||||
import android.view.View;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.dynamicform.JsonResponseSubmitTask;
|
||||
import com.adins.mss.base.util.GsonHelper;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.dialog.DialogManager;
|
||||
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
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.common.Toaster;
|
||||
import com.adins.mss.odr.model.JsonRequestCheckOrder;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CancelOrderTask extends AsyncTask<Void, Void, String>{
|
||||
private ProgressDialog progressDialog;
|
||||
private String errMessage = null;
|
||||
private Activity activity;
|
||||
List<NameValuePair> params;
|
||||
public CancelOrderTask(Activity activity, List<NameValuePair> params){
|
||||
this.activity = activity;
|
||||
this.params = params;
|
||||
}
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
progressDialog = ProgressDialog.show(activity,
|
||||
"", activity.getString(R.string.progressWait), true);
|
||||
}
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
String result="";
|
||||
if(Tool.isInternetconnected(activity)){
|
||||
JsonRequestCheckOrder request = new JsonRequestCheckOrder();
|
||||
request.setAudit(GlobalData.getSharedGlobalData().getAuditData());
|
||||
request.setOrderNumber(this.params.get(0).getValue());
|
||||
request.setFlag(this.params.get(1).getValue());
|
||||
|
||||
String json = GsonHelper.toJson(request);
|
||||
String url = GlobalData.getSharedGlobalData().getURL_GET_CANCELORDER();
|
||||
|
||||
boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
|
||||
boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
|
||||
HttpCryptedConnection httpConn = new HttpCryptedConnection(activity, encrypt, decrypt);
|
||||
HttpConnectionResult serverResult = null;
|
||||
try {
|
||||
serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
|
||||
result = serverResult.getResult();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
errMessage = activity.getString(R.string.cancel_order_error);
|
||||
}
|
||||
}else{
|
||||
result = activity.getString(R.string.no_internet_connection);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
protected void onPostExecute(String result){
|
||||
if (progressDialog.isShowing()){
|
||||
try {
|
||||
progressDialog.dismiss();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if(!GlobalData.isRequireRelogin()){
|
||||
if(errMessage!=null){
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(activity);
|
||||
dialogBuilder.withTitle("Error")
|
||||
.withMessage(errMessage)
|
||||
.show();
|
||||
}else {
|
||||
if (result.equals(activity.getString(R.string.no_internet_connection))) {
|
||||
Toaster.warning(activity, result);
|
||||
} else {
|
||||
JsonResponseSubmitTask response = GsonHelper.fromJson(result, JsonResponseSubmitTask.class);
|
||||
int code = response.getStatus().getCode();
|
||||
if (code == 0) {
|
||||
if (response.getResult().contains("Success")) {
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(activity);
|
||||
dialogBuilder.withTitle(activity.getString(R.string.success))
|
||||
.withMessage(activity.getString(R.string.order_canceled))
|
||||
.isCancelable(false)
|
||||
.withButton1Text(activity.getString(R.string.btnOk))
|
||||
.setButton1Click(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
activity.finish();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
} else {
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(activity);
|
||||
dialogBuilder.withTitle("Error")
|
||||
.withMessage(result)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DialogManager.showForceExitAlert(activity, activity.getString(com.adins.mss.base.R.string.msgLogout));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.adins.mss.base.todolist.form.todaysplan;
|
||||
|
||||
import com.adins.mss.dao.PlanTask;
|
||||
import com.adins.mss.dao.TaskH;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SelectTaskPlanHandler {
|
||||
|
||||
private List<TaskH> selectedTask = new ArrayList<>();
|
||||
private TodayPlanHandler todayPlanHandler;
|
||||
private OnSelectedChange changeListener;
|
||||
|
||||
public interface OnSelectedChange{
|
||||
void onSelectedChange(List<TaskH> newSelected,int startSequence);
|
||||
}
|
||||
|
||||
public SelectTaskPlanHandler(TodayPlanHandler todayPlanHandler) {
|
||||
this.todayPlanHandler = todayPlanHandler;
|
||||
}
|
||||
|
||||
public void setChangeListener(OnSelectedChange changeListener) {
|
||||
this.changeListener = changeListener;
|
||||
}
|
||||
|
||||
public List<TaskH> getSelectedTask() {
|
||||
return selectedTask;
|
||||
}
|
||||
|
||||
public List<PlanTask> generatePlanTasks(){
|
||||
return null;
|
||||
}
|
||||
|
||||
public void selectTask(TaskH taskH){
|
||||
if(todayPlanHandler == null)
|
||||
return;
|
||||
int currPlanSize = todayPlanHandler.getAllPlansCount();
|
||||
if(selectedTask.contains(taskH))
|
||||
return;
|
||||
|
||||
selectedTask.add(taskH);
|
||||
if(changeListener != null)
|
||||
changeListener.onSelectedChange(selectedTask,currPlanSize);
|
||||
}
|
||||
|
||||
public void selectAllTask(List<TaskH> selecteds){
|
||||
if(todayPlanHandler == null)
|
||||
return;
|
||||
int currPlanSize = todayPlanHandler.getAllPlansCount();
|
||||
|
||||
selectedTask.clear();
|
||||
selectedTask.addAll(selecteds);
|
||||
if(changeListener != null)
|
||||
changeListener.onSelectedChange(selectedTask,currPlanSize);
|
||||
}
|
||||
|
||||
public void deselectAllTask(){
|
||||
selectedTask.clear();
|
||||
if(changeListener != null)
|
||||
changeListener.onSelectedChange(selectedTask,0);
|
||||
}
|
||||
|
||||
public void deselectTask(TaskH taskH){
|
||||
if(todayPlanHandler == null)
|
||||
return;
|
||||
int currPlanSize = todayPlanHandler.getAllPlansCount();
|
||||
if(!selectedTask.contains(taskH))
|
||||
return;
|
||||
|
||||
selectedTask.remove(taskH);
|
||||
if(changeListener != null)
|
||||
changeListener.onSelectedChange(selectedTask,currPlanSize);
|
||||
}
|
||||
|
||||
public void clearSelections(){
|
||||
if(todayPlanHandler == null)
|
||||
return;
|
||||
int currPlanSize = todayPlanHandler.getAllPlansCount();
|
||||
|
||||
selectedTask.clear();
|
||||
if(changeListener != null){
|
||||
changeListener.onSelectedChange(selectedTask,currPlanSize);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.adins.mss.foundation.questiongenerator.form.QuestionView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/questionDtmLayout">
|
||||
<TextView
|
||||
android:id="@+id/questionDtmLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0. Label"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1"
|
||||
android:layout_margin="5dp">
|
||||
<EditText
|
||||
android:id="@+id/questionDtmAnswer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:text="ddMMyyy"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@drawable/edit_text_selector"
|
||||
android:focusable="false"
|
||||
android:layout_weight="0.5"/>
|
||||
<Button
|
||||
android:id="@+id/btnSetDtm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="SET THE DATE"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</LinearLayout>
|
||||
</com.adins.mss.foundation.questiongenerator.form.QuestionView>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="30dp"
|
||||
android:height="30dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
|
@ -0,0 +1,133 @@
|
|||
<?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:id="@+id/print"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@drawable/header"
|
||||
app:titleTextAppearance="?android:attr/textAppearanceSmall"
|
||||
android:titleTextColor="@color/fontColorWhite"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar"
|
||||
android:fitsSystemWindows="true"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/tl_device"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true">
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tr_device_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:text="@string/label_device_name"
|
||||
android:textColor="#0b5d66" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=":"
|
||||
android:textColor="#0b5d66" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_device_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:paddingLeft="25dp"
|
||||
android:text="-"
|
||||
android:textColor="#0b5d66"
|
||||
android:textStyle="bold" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tr_device_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lblStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:text="@string/lblStatusPrint"
|
||||
android:textColor="#0b5d66" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=":"
|
||||
android:textColor="#0b5d66" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lblPrinterStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:paddingLeft="25dp"
|
||||
android:text="@string/not_connected"
|
||||
android:textColor="#0b5d66"
|
||||
android:textStyle="bold" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnConnect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tl_device"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/connect"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<!--<Button
|
||||
android:id="@+id/btnDisconnect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/btnConnect"
|
||||
android:layout_alignRight="@+id/btnConnect"
|
||||
android:layout_below="@+id/btnConnect"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/mnDisconnect"
|
||||
android:textColor="@android:color/white" />-->
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnPrint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/btnConnect"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@string/mnPrint"
|
||||
android:background="@drawable/button_background"
|
||||
android:textColor="@android:color/white" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,67 @@
|
|||
package com.adins.mss.base.checkin.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.util.Utility;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
|
||||
import org.acra.ACRA;
|
||||
|
||||
public class CheckInActivity extends Fragment {
|
||||
|
||||
public Fragment fragment = this;
|
||||
private CheckInView view;
|
||||
private FirebaseAnalytics screenName;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context activity) {
|
||||
super.onAttach(activity);
|
||||
ACRA.getErrorReporter().putCustomData("LAST_CLASS_ACCESSED", getClass().getSimpleName());
|
||||
setHasOptionsMenu(true);
|
||||
view = new CheckInView(getActivity());
|
||||
view.onAttach();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
view.onOptionsItemSelected(item.getItemId());
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
screenName = FirebaseAnalytics.getInstance(getActivity());
|
||||
view.fragment = fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
view.onResume();
|
||||
//Set Firebase screen name
|
||||
screenName.setCurrentScreen(getActivity(), getString(R.string.screen_name_attendance_in), null);
|
||||
|
||||
getActivity().findViewById(R.id.search).setVisibility(View.GONE);
|
||||
getActivity().findViewById(R.id.spinner).setVisibility(View.GONE);
|
||||
getActivity().setTitle(getString(R.string.title_mn_absentin));
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return view.layoutInflater(inflater, container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Utility.freeMemory();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<?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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:visibility="visible"
|
||||
android:background="@color/bgColor">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@drawable/header"
|
||||
app:titleTextAppearance="?android:attr/textAppearanceSmall"
|
||||
android:titleTextColor="@color/fontColorWhite"
|
||||
app:popupTheme="@style/AppTheme" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
app:cardElevation="@dimen/card_shadow"
|
||||
android:layout_margin="@dimen/card_margin"
|
||||
app:contentPadding="10dp"
|
||||
app:cardCornerRadius="5dp">
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:passwordToggleEnabled="true"
|
||||
android:visibility="gone">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/currentPassword"
|
||||
android:hint="@string/lblCurrentPassword"
|
||||
android:maxLines="1"
|
||||
android:inputType="textPassword"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:passwordToggleEnabled="true">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/newPassword"
|
||||
android:hint="@string/lblNewPassword"
|
||||
android:inputType="textPassword"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:maxLines="1" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:passwordToggleEnabled="true">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/retypePassword"
|
||||
android:hint="@string/hintRetypePassword"
|
||||
android:inputType="textPassword"
|
||||
android:padding="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:maxLines="1" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<Button android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:text="@string/btn_reset_password"
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/changePassword"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:background="@drawable/button_background">
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,65 @@
|
|||
package com.adins.mss.base.loyalti.barchart;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import com.github.mikephil.charting.components.IMarker;
|
||||
import com.github.mikephil.charting.data.BarEntry;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.highlight.Highlight;
|
||||
import com.github.mikephil.charting.utils.MPPointF;
|
||||
|
||||
public class PointClickMarker implements IMarker {
|
||||
|
||||
private Entry currClickEntry;
|
||||
private Highlight highlight;
|
||||
private Paint textPaint;
|
||||
private float textOffset;
|
||||
|
||||
private float textSize;
|
||||
|
||||
public PointClickMarker(float textSize, float textOffset) {
|
||||
this.textSize = textSize;
|
||||
this.textOffset = textOffset;
|
||||
textPaint = new Paint();
|
||||
textPaint.setTextSize(textSize);
|
||||
textPaint.setColor(Color.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MPPointF getOffset() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MPPointF getOffsetForDrawingAtPoint(float posX, float posY) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshContent(Entry e, Highlight highlight) {
|
||||
currClickEntry = e;
|
||||
this.highlight = highlight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas, float posX, float posY) {
|
||||
if(currClickEntry == null)
|
||||
return;
|
||||
if(highlight == null)
|
||||
return;
|
||||
|
||||
int yVal = 0;
|
||||
if(highlight.isStacked()){
|
||||
int stackIdx = highlight.getStackIndex();
|
||||
BarEntry barEntry = (BarEntry) currClickEntry;
|
||||
yVal = (int)barEntry.getYVals()[stackIdx];
|
||||
}
|
||||
else {
|
||||
yVal = (int)currClickEntry.getY();
|
||||
}
|
||||
canvas.drawText(String.valueOf(yVal),posX - textPaint.getTextSize() + textOffset,posY + textPaint.getTextSize(),textPaint);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.adins.mss.odr.assignment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.AsyncTask;
|
||||
import android.view.View;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.dynamicform.JsonResponseSubmitTask;
|
||||
import com.adins.mss.base.util.GsonHelper;
|
||||
import com.adins.mss.base.util.Utility;
|
||||
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.model.JsonRequestSubmitAssign;
|
||||
import com.google.firebase.perf.FirebasePerformance;
|
||||
import com.google.firebase.perf.metrics.HttpMetric;
|
||||
|
||||
public class SubmitAssignTask extends AsyncTask<Void, Void, String> {
|
||||
private ProgressDialog progressDialog;
|
||||
private String errMessage = null;
|
||||
private Activity activity;
|
||||
String uuid_task_h;
|
||||
String assignId;
|
||||
String flag;
|
||||
String notes;
|
||||
public SubmitAssignTask(Activity activity, String notes, String uuid_task_h, String assignId, String flag){
|
||||
this.activity=activity;
|
||||
this.uuid_task_h= uuid_task_h;
|
||||
this.assignId= assignId;
|
||||
this.flag= flag;
|
||||
this.notes=notes;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
progressDialog = ProgressDialog.show(activity, "", activity.getString(com.adins.mss.base.R.string.progressWait), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
String result = null;
|
||||
|
||||
JsonRequestSubmitAssign request = new JsonRequestSubmitAssign();
|
||||
request.setAudit(GlobalData.getSharedGlobalData().getAuditData());
|
||||
request.setFlag(flag);
|
||||
request.setUuid_user(assignId);
|
||||
request.setUuid_task_h(uuid_task_h);
|
||||
request.setNotes(notes);
|
||||
String json = GsonHelper.toJson(request);
|
||||
String url = GlobalData.getSharedGlobalData().getURL_SUBMIT_ASSIGN();
|
||||
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);
|
||||
|
||||
try {
|
||||
serverResult = httpConn.requestToServer(url, json);
|
||||
Utility.metricStop(networkMetric, serverResult);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
errMessage=e.getMessage();
|
||||
}
|
||||
String resp = null;
|
||||
resp = serverResult.getResult();
|
||||
JsonResponseSubmitTask response ;
|
||||
try {
|
||||
response = GsonHelper.fromJson(resp, JsonResponseSubmitTask.class);
|
||||
if(response.getStatus().getCode()==0){
|
||||
result=response.getResult();
|
||||
}else{
|
||||
errMessage=response.getStatus().getMessage();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result=resp;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
if (progressDialog.isShowing()){
|
||||
try {
|
||||
progressDialog.dismiss();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if (errMessage != null) {
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(activity);
|
||||
dialogBuilder.withTitle(activity.getString(com.adins.mss.base.R.string.error_capital))
|
||||
.withMessage(errMessage)
|
||||
.show();
|
||||
}
|
||||
else if (result.equals("Success")){
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(activity);
|
||||
dialogBuilder.withTitle(activity.getString(com.adins.mss.base.R.string.success))
|
||||
.withMessage(activity.getString(com.adins.mss.base.R.string.task_submitted))
|
||||
.isCancelable(false)
|
||||
.withButton1Text(activity.getString(com.adins.mss.base.R.string.btnOk))
|
||||
.setButton1Click(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
activity.finish();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
else{
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(activity);
|
||||
dialogBuilder.withTitle(activity.getString(com.adins.mss.base.R.string.warning_capital))
|
||||
.withMessage(result)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue