Parcourir la source

apex land 1.13

Ray Zhang il y a 7 ans
Parent
commit
db2c4442e4

+ 7 - 0
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/signature/SignatureView.java

@@ -202,6 +202,9 @@ public class SignatureView extends View {
     }
     void TouchDown(MotionElement element, Canvas c)
     {
+
+        if(mPaint==null)
+            return;
         ControllerPoint cp =  getControlPoint(element);
 //        last_Point = cp;
         idx_lastaction=mMeasurePointList.size();
@@ -242,6 +245,8 @@ public class SignatureView extends View {
     }
     void TouchMove(MotionElement element, Canvas c)
     {
+        if(mPaint==null)
+            return;
 //        ControllerPoint cp =  getControlPoint(element);
 //        last_Point = cp;
         idx_lastaction=mMeasurePointList.size();
@@ -301,6 +306,8 @@ public class SignatureView extends View {
     }
     void TouchUp(MotionElement element, Canvas c)
     {
+        if(mPaint==null)
+            return;
         ControllerPoint cp =  getControlPoint(element);
 //        last_Point = cp;
         idx_lastaction=mMeasurePointList.size();

+ 2 - 2
ApexDrivers/apexdriversi/build.gradle

@@ -22,8 +22,8 @@ android {
         applicationId "com.usai.apex.apexdriversi"
         minSdkVersion 23
         targetSdkVersion 26
-        versionCode 1
-        versionName "1.11"
+        versionCode 3
+        versionName "1.13"
 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 

+ 2 - 2
ApexDrivers/apexdriverslib/src/main/AndroidManifest.xml

@@ -110,7 +110,7 @@
 
         <receiver
             android:name=".receiver.ApexDriverAlarmReceiver"
-            android:directBootAware="true"
+            android:directBootAware="false"
             android:enabled="true"
             android:exported="true"
             android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
@@ -119,7 +119,7 @@
                 <action android:name="REDANT.BROADCAST.ACTION_REDANT_INIT_ALARM" />
                 <action android:name="REDANT.BROADCAST.ACTION_REDANT_ALARM" />
                 <action android:name="android.intent.action.BOOT_COMPLETED"/>
-                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>
+                <!--<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>-->
             </intent-filter>
         </receiver>
 

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriverApplication.java

@@ -549,6 +549,7 @@ public class ApexDriverApplication extends Application {
 
         authExpired = false;
         setShouldAutoLogin(false);
+        setRequiredBackgroundLocation(false);
     }
 
     public Object getValueForKeyPath(String keyPath) {

+ 1 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/DetailActivity.java

@@ -528,7 +528,7 @@ public class DetailActivity extends BasicActivity implements DetailAdapter.Detai
             case DetailSubActionModel.DetailActionType.DetailActionTypeRemote: {
 
                 if (actionModel.actionSubType == DetailActionSubTypeAccept) {
-                    ApexDriverApplication.sharedApplication().setRequiredBackgroundLocation(true);
+//                    ApexDriverApplication.sharedApplication().setRequiredBackgroundLocation(true);
                 }
 
                 handleRemoteAction(actionModel);

+ 15 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/photoCell/PhotoItemCell.java

@@ -2,7 +2,6 @@ package com.usai.redant.apexdrivers.photoCell;
 
 import android.content.Context;
 import android.util.AttributeSet;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.ImageView;
@@ -60,8 +59,23 @@ public class PhotoItemCell extends RelativeLayout implements PhotoModelDelegate
         mPhotoView = findViewById(R.id.photo_view);
 
         mPhotoView.setOnClickListener(new OnClickListener() {
+            long lastClickTime = 0;
+            final long DOUBLE_CLICK_DELAY_TIME = 500;
             @Override
             public void onClick(View v) {
+                long currentTime = System.currentTimeMillis();
+
+//                    Log.e("debug", "onClick: current"+currentTime  );
+//                    Log.e("debug", "onClick: last"+lastClickTime  );
+//                    Log.e("debug", "onClick: time"+(currentTime - lastClickTime ) );
+                if (currentTime - lastClickTime < DOUBLE_CLICK_DELAY_TIME) {
+
+//                        Log.e("debug", "onClick: invalid  : "+(currentTime - lastClickTime ) );
+
+                    return;
+                }
+                lastClickTime = currentTime;
+
 
                 if (delegate != null && weakModel != null) {
                     delegate.clickPhotoItem(weakModel.get());

+ 1 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateActivity.java

@@ -1378,7 +1378,7 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
         // Create an image file name
 
         String timeStamp=DateFormat.format(
-                "MM/dd/yyyy kk:mm",
+                "yyyyMMdd_kkmmss",
                 new Date().getTime()).toString();
 //        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
         String imageFileName = "JPEG_" + timeStamp + "_";

+ 60 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateAdapter.java

@@ -9,7 +9,6 @@ import android.text.TextWatcher;
 import android.text.method.LinkMovementMethod;
 import android.text.style.URLSpan;
 import android.text.util.Linkify;
-import android.util.Log;
 import android.util.Patterns;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -450,8 +449,23 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             valueEt = view.findViewById(R.id.update_input_tv);
             scannerBtn = view.findViewById(R.id.update_scanner_btn);
             scannerBtn.setOnClickListener(new View.OnClickListener() {
+                long lastClickTime = 0;
                 @Override
                 public void onClick(View v) {
+
+                    long currentTime = System.currentTimeMillis();
+
+//                    Log.e("debug", "onClick: current"+currentTime  );
+//                    Log.e("debug", "onClick: last"+lastClickTime  );
+//                    Log.e("debug", "onClick: time"+(currentTime - lastClickTime ) );
+                    if (currentTime - lastClickTime < DOUBLE_CLICK_DELAY_TIME) {
+
+//                        Log.e("debug", "onClick: invalid  : "+(currentTime - lastClickTime ) );
+
+                        return;
+                    }
+                    lastClickTime = currentTime;
+
                     if (weakInput != null && mDelegate != null) {
 
                         UpdateInputModel inputModel = weakInput.get();
@@ -634,8 +648,22 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             requiredTv = view.findViewById(R.id.update_photo_required_tv);
             photoBtn = view.findViewById(R.id.update_photo_btn);
             photoBtn.setOnClickListener(new View.OnClickListener() {
+                long lastClickTime = 0;
                 @Override
                 public void onClick(View v) {
+
+                    long currentTime = System.currentTimeMillis();
+
+//                    Log.e("debug", "onClick: current"+currentTime  );
+//                    Log.e("debug", "onClick: last"+lastClickTime  );
+//                    Log.e("debug", "onClick: time"+(currentTime - lastClickTime ) );
+                    if (currentTime - lastClickTime < DOUBLE_CLICK_DELAY_TIME) {
+
+//                        Log.e("debug", "onClick: invalid  : "+(currentTime - lastClickTime ) );
+
+                        return;
+                    }
+                    lastClickTime = currentTime;
                     if (weakPhoto != null && mDelegate != null) {
 
                         UpdateAdapterDelegate adapterDelegate = mDelegate.get();
@@ -704,6 +732,7 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
 
     private class SignatureHolder implements UpdateBaseModel.UpdateModelDelegate {
 
+
         TextView titleTv,requiredTv;
         ImageView signatureView;
         WeakReference<UpdateSignatureModel> weakSignature;
@@ -713,10 +742,25 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             titleTv = view.findViewById(R.id.update_signature_title_tv);
             requiredTv = view.findViewById(R.id.update_signature_required_tv);
             signatureView = view.findViewById(R.id.update_signature_image_view);
+
             signatureView.setOnClickListener(new View.OnClickListener() {
+                long lastClickTime = 0;
                 @Override
                 public void onClick(View v) {
 
+
+                    long currentTime = System.currentTimeMillis();
+
+//                    Log.e("debug", "onClick: current"+currentTime  );
+//                    Log.e("debug", "onClick: last"+lastClickTime  );
+//                    Log.e("debug", "onClick: time"+(currentTime - lastClickTime ) );
+                    if (currentTime - lastClickTime < DOUBLE_CLICK_DELAY_TIME) {
+
+//                        Log.e("debug", "onClick: invalid  : "+(currentTime - lastClickTime ) );
+
+                        return;
+                    }
+                    lastClickTime = currentTime;
                     if (weakSignature != null && mDelegate != null) {
 
                         UpdateAdapterDelegate adapterDelegate = mDelegate.get();
@@ -797,8 +841,23 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             valueTv = view.findViewById(R.id.update_date_value_tv);
             dateBtn = view.findViewById(R.id.update_date_btn);
             dateBtn.setOnClickListener(new View.OnClickListener() {
+                private long lastClickTime = 0;
                 @Override
                 public void onClick(View v) {
+
+                    long currentTime = System.currentTimeMillis();
+
+//                    Log.e("debug", "onClick: current"+currentTime  );
+//                    Log.e("debug", "onClick: last"+lastClickTime  );
+//                    Log.e("debug", "onClick: time"+(currentTime - lastClickTime ) );
+                    if (currentTime - lastClickTime < DOUBLE_CLICK_DELAY_TIME) {
+
+//                        Log.e("debug", "onClick: invalid  : "+(currentTime - lastClickTime ) );
+
+                        return;
+                    }
+                    lastClickTime = currentTime;
+
                     if (weakDate != null && mDelegate != null) {
 
                         UpdateDateModel dateModel = weakDate.get();

+ 9 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateBaseModel.java

@@ -12,8 +12,17 @@ public class UpdateBaseModel extends BasicObject {
     public interface UpdateModelDelegate {
         void refresh();
         void unbind();
+
+        public final int DOUBLE_CLICK_DELAY_TIME = 500;
+//        public final int MIN_CLICK_DELAY_TIME = 1000;
+
+//        public final int SINGLE_CLICK_MESSAGE = 1;
     }
 
+
+
+
+
     public final static int UpdateTypeLabel = 0;
     public final static int UpdateTypeInput = 1;
     public final static int UpdateTypeMultInput= 2;