Explorar el Código

1.修改Android Apex Drivers显示FirstName、首页统计数字可点击、电话可点击。
2.修改Android Apex Drivers增加Save Password。
3.修改Android Apex Drivers More Order增加索引。
4.修改Android Apex Drivers Update Order增加日期类型。

Pen Li hace 7 años
padre
commit
839274d491
Se han modificado 37 ficheros con 943 adiciones y 114 borrados
  1. 76 10
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriverApplication.java
  2. 1 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/MainActivity.java
  3. 10 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/base/BasicObject.java
  4. 47 8
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/DetailAdapter.java
  5. 8 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/DetailSectionModel.java
  6. 1 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/model/DetailBaseModel.java
  7. 22 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/filter/OrderFilterActivity.java
  8. 24 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeCellLayout.java
  9. 24 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeFragment.java
  10. 35 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeHeaderView.java
  11. 6 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeMoreActivity.java
  12. 2 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeOrderModel.java
  13. 10 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/login/LoginFragment.java
  14. 2 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/network/Network.java
  15. 26 26
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/receiver/ApexDriverAlarmReceiver.java
  16. 36 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateActivity.java
  17. 124 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateAdapter.java
  18. 111 57
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateSectionModel.java
  19. 31 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateBaseModel.java
  20. 54 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateDateModel.java
  21. 5 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateLabelModel.java
  22. 2 0
      ApexDrivers/apexdriverslib/src/main/res/layout/detail_location_cell.xml
  23. 2 0
      ApexDrivers/apexdriverslib/src/main/res/layout/detail_map_cell.xml
  24. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/detail_mult_line_cell.xml
  25. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/detail_photo_cell.xml
  26. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/detail_signature_cell.xml
  27. 2 0
      ApexDrivers/apexdriverslib/src/main/res/layout/detail_single_line_cell.xml
  28. 1 1
      ApexDrivers/apexdriverslib/src/main/res/layout/fragment_login.xml
  29. 3 0
      ApexDrivers/apexdriverslib/src/main/res/layout/home_header_view.xml
  30. 189 0
      ApexDrivers/apexdriverslib/src/main/res/layout/home_more_order_cell.xml
  31. 8 0
      ApexDrivers/apexdriverslib/src/main/res/layout/home_order_cell.xml
  32. 71 0
      ApexDrivers/apexdriverslib/src/main/res/layout/update_date_cell.xml
  33. 3 1
      ApexDrivers/apexdriverslib/src/main/res/layout/update_label_cell.xml
  34. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/update_multinput_cell.xml
  35. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/update_photo_cell.xml
  36. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/update_scanner_input_cell.xml
  37. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/update_signature_cell.xml

+ 76 - 10
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriverApplication.java

@@ -53,6 +53,9 @@ public class ApexDriverApplication extends Application {
 
     public String user;
     public String password;
+    private boolean savePass;
+    private String firstName;
+
     private volatile long notificationID;
 
     public boolean isbackground=true;
@@ -71,7 +74,6 @@ public class ApexDriverApplication extends Application {
 
     private Activity mCurActivity;
 
-
     private OperationQueue networkQueue;
 
     public void initLocation()
@@ -167,6 +169,8 @@ public class ApexDriverApplication extends Application {
         try {
             user = savedUser();
             password = savedPassword();
+            firstName = getFirstName();
+            loadSaveedSavePass();
 
             loadBackgroundReportType();
 
@@ -268,12 +272,30 @@ public class ApexDriverApplication extends Application {
     }
 
     public boolean isLogin() {
-        return user != null && user.length() > 0 && password != null && password.length() > 0;
+        boolean login = shouldAutoLogin();
+        if (login) {
+            return user != null && user.length() > 0 && password != null && password.length() > 0;
+        }
+        return false;
+    }
+
+    private boolean shouldAutoLogin() {
+        SharedPreferences pref = sharedPreferences();
+        return pref.getBoolean("autoLogin",false);
+    }
+
+    private void setShouldAutoLogin(boolean login) {
+        SharedPreferences pref = sharedPreferences();
+
+        SharedPreferences.Editor editor = pref.edit();
+        editor.putBoolean("autoLogin",login);
+        editor.commit();
     }
 
-    public void login(String user,String password) {
+    public void login(String user,String password, String firstName) {
         this.user = user;
         this.password = password;
+        this.firstName = firstName;
 
 
         SharedPreferences pref = sharedPreferences();
@@ -283,15 +305,54 @@ public class ApexDriverApplication extends Application {
 
             editor.putString("user", encryptString(user));
             editor.putString("password", encryptString(password));
+            editor.putString("firstName",firstName);
 
         } catch (Exception e) {
             editor.putString("user", null);
             editor.putString("password", null);
+            editor.putString("firstName",null);
+            e.printStackTrace();
+        }
+        editor.commit();
+
+        setShouldAutoLogin(true);
+    }
+
+    public void setSavePass(boolean save) {
+        this.savePass = save;
+
+        SharedPreferences pref = sharedPreferences();
+
+        SharedPreferences.Editor editor = pref.edit();
+        try {
+            editor.putBoolean("savePass",save);
+        } catch (Exception e) {
+            editor.remove("savePass");
             e.printStackTrace();
         }
         editor.commit();
     }
 
+    private void loadSaveedSavePass() {
+        SharedPreferences pref=sharedPreferences();
+
+        savePass = pref.getBoolean("savePass", false);
+    }
+
+    public boolean getSavePass() {
+        return savePass;
+    }
+
+    public String getFirstName() {
+        if (firstName == null) {
+            SharedPreferences pref=sharedPreferences();
+
+            firstName = pref.getString("firstName", null);
+
+        }
+        return firstName;
+    }
+
     public void updatePassword(String password) {
         this.password = password;
         SharedPreferences pref = sharedPreferences();
@@ -408,15 +469,20 @@ public class ApexDriverApplication extends Application {
     }
 
     public void logout() {
-        user = null;
-        password = null;
-        SharedPreferences pref = sharedPreferences();
+        if (!savePass) {
+            user = null;
+            password = null;
+            firstName = null;
+            SharedPreferences pref = sharedPreferences();
 
-        SharedPreferences.Editor editor = pref.edit();
-        editor.remove("user");
-        editor.remove("password");
-        editor.commit();
+            SharedPreferences.Editor editor = pref.edit();
+            editor.remove("user");
+            editor.remove("password");
+            editor.remove("firstName");
+            editor.commit();
+        }
 
+        setShouldAutoLogin(false);
     }
 
     public Object getValueForKeyPath(String keyPath) {

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

@@ -461,7 +461,7 @@ public class MainActivity extends BasicActivity implements LoginFragment.LoginCa
 
         invalidateOptionsMenu();
 
-        setTitle(ApexDriverApplication.sharedApplication().user);
+        setTitle(ApexDriverApplication.sharedApplication().user + " " + ApexDriverApplication.sharedApplication().getFirstName());
     }
 
     private void setupLogoutAppearance() {

+ 10 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/base/BasicObject.java

@@ -30,7 +30,7 @@ public class BasicObject {
                     }
 
                     Class type = f.getType();
-                    if (type == value.getClass() || ((type == int.class || type == long.class) && value.getClass() == Integer.class) || ((type == float.class || type == double.class) && (value.getClass() == Double.class || value.getClass() == Float.class))) {
+                    if (type == value.getClass() || ((type == int.class || type == long.class) && value.getClass() == Integer.class) || ((type == float.class || type == double.class) && (value.getClass() == Double.class || value.getClass() == Float.class)) || ((type == Boolean.class || type == boolean.class) && (value.getClass() == boolean.class || value.getClass() == Boolean.class))) {
 
 
                         boolean success = invokeSetter(cls,f,type,key,value);
@@ -63,6 +63,15 @@ public class BasicObject {
                                 f.set(this,value);
                             }
 
+                        } else {
+
+                            if (type == Object.class) {
+                                boolean success = invokeSetter(cls,f,type,key,value);
+                                if (!success) {
+                                    f.set(this,value);
+                                }
+                            }
+
                         }
 
                     }

+ 47 - 8
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/DetailAdapter.java

@@ -30,6 +30,8 @@ import com.usai.redant.rautils.utils.RAUtil;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 
+import static android.text.util.Linkify.PHONE_NUMBERS;
+
 //import com.google.android.gms.maps.GoogleMap;
 //import com.google.android.gms.maps.OnMapReadyCallback;
 
@@ -297,9 +299,21 @@ public class DetailAdapter extends BaseExpandableListAdapter {
 
         public void bindSingleLineModel(DetailSingleLineModel model) {
 
-            titleTv.setText(model.title);
-            valueTv.setText(model.value);
-            if (model.highlight) {
+            if (model != null && model.detectTel) {
+                valueTv.setAutoLinkMask(PHONE_NUMBERS);
+            } else {
+                valueTv.setAutoLinkMask(0);
+            }
+
+            if (model != null) {
+                titleTv.setText(model.title);
+                valueTv.setText(model.value);
+            } else {
+                titleTv.setText(null);
+                valueTv.setText(null);
+            }
+
+            if (model != null && model.highlight) {
                 valueTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextRedColor));
             } else {
                 valueTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextBlackColor));
@@ -319,13 +333,24 @@ public class DetailAdapter extends BaseExpandableListAdapter {
         }
 
         public void bindMultLineModel(DetailMultipleLineModel model) {
-            valueTv.setText(model.value);
 
-            if (model.highlight) {
+            if (model != null && model.detectTel) {
+                valueTv.setAutoLinkMask(PHONE_NUMBERS);
+            } else {
+                valueTv.setAutoLinkMask(0);
+            }
+
+            if (model != null) {
+                valueTv.setText(model.value);
+            } else {
+                valueTv.setText(null);
+            }
+            if (model != null && model.highlight) {
                 valueTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextRedColor));
             } else {
                 valueTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextBlackColor));
             }
+
         }
     }
 
@@ -440,16 +465,23 @@ public class DetailAdapter extends BaseExpandableListAdapter {
 
         public void bindLocationModel(DetailLocationModel model) {
 
+            if (model != null && model.detectTel) {
+                locationTv.setAutoLinkMask(PHONE_NUMBERS);
+            } else {
+                locationTv.setAutoLinkMask(0);
+            }
+
             titleTv.setText(model.title);
             locationTv.setText(model.location);
 
             mWeakLocation = new WeakReference<>(model);
 
-            if (model.highlight) {
+            if (model != null && model.highlight) {
                 locationTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextRedColor));
             } else {
                 locationTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextBlackColor));
             }
+
         }
     }
 
@@ -596,10 +628,16 @@ public class DetailAdapter extends BaseExpandableListAdapter {
                 DetailMapModel model = weakMap.get();
                 if (model != null) {
 
+                    if (model != null && model.detectTel) {
+                        valueTv.setAutoLinkMask(PHONE_NUMBERS);
+                    } else {
+                        valueTv.setAutoLinkMask(0);
+                    }
+
                     titleTv.setText(model.title);
                     valueTv.setText(model.location);
 
-                    if (model.highlight) {
+                    if (model != null && model.highlight) {
                         valueTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextRedColor));
                     } else {
                         valueTv.setTextColor(mCtx.getResources().getColor(R.color.ApexDriverTextBlackColor));
@@ -627,17 +665,18 @@ public class DetailAdapter extends BaseExpandableListAdapter {
                         mapBtn.setImageResource(R.drawable.btn_map_no);
                     }
 
-
                 } else {
 
                     titleTv.setText(null);
                     valueTv.setText(null);
+                    valueTv.setAutoLinkMask(0);
                     mapBtn.setEnabled(false);
                     mapBtn.setImageResource(R.drawable.btn_map_no);
                 }
             } else {
                 titleTv.setText(null);
                 valueTv.setText(null);
+                valueTv.setAutoLinkMask(0);
                 mapBtn.setEnabled(false);
                 mapBtn.setImageResource(R.drawable.btn_map_no);
             }

+ 8 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/DetailSectionModel.java

@@ -52,6 +52,7 @@ public class DetailSectionModel {
                 if (value != null) {
                     int type = value.optInt("type",-1);
                     boolean highlight = value.optBoolean("highlight");
+                    boolean detectTel = value.optBoolean("detectTel");
                     switch (type) {
                         case DetailBaseModel.OrderDetailValueType.OderDetailValueTypeSingleLine: {
                             DetailSingleLineModel model = new DetailSingleLineModel(mCtx);
@@ -60,6 +61,7 @@ public class DetailSectionModel {
                             model.value = value.optString("value");
                             model.type = type;
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }
@@ -70,6 +72,7 @@ public class DetailSectionModel {
                             model.value = value.optString("value");
                             model.type = type;
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }
@@ -81,6 +84,7 @@ public class DetailSectionModel {
                             model.setActions(value.optJSONArray("actions"));
                             model.type = type;
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }
@@ -94,6 +98,7 @@ public class DetailSectionModel {
                             model.street = value.optString("street");
                             model.type = type;
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }
@@ -106,6 +111,7 @@ public class DetailSectionModel {
                             model.location = value.optString("location");
                             model.setLatlon(value.optString("latlon"));
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }
@@ -117,6 +123,7 @@ public class DetailSectionModel {
                             model.setPhotoURL(value.optString("photoURL"));
                             model.type = type;
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }
@@ -128,6 +135,7 @@ public class DetailSectionModel {
                             model.setSignatureURL(value.optString("signatureURL"));
                             model.type = type;
                             model.highlight = highlight;
+                            model.detectTel = detectTel;
 
                             this.values.add(model);
                         }

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/model/DetailBaseModel.java

@@ -24,6 +24,7 @@ public class DetailBaseModel {
 
     public int type;
     public boolean highlight;
+    public boolean detectTel;
 
     private OrderDetailModelDelegate delegate;
 

+ 22 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/filter/OrderFilterActivity.java

@@ -7,6 +7,7 @@ import android.support.v7.app.AlertDialog;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.view.LayoutInflater;
+import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.Button;
@@ -24,6 +25,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 
+import static android.view.MenuItem.SHOW_AS_ACTION_ALWAYS;
+
 public class OrderFilterActivity extends BasicActivity {
 
     private static final String OrderFilterKey = "OrderFilterKey";
@@ -139,6 +142,21 @@ public class OrderFilterActivity extends BasicActivity {
         }
     }
 
+    @Override
+    public boolean onPrepareOptionsMenu(Menu menu) {
+        super.onPrepareOptionsMenu(menu);
+
+        menu.clear();
+
+        menu.add(0,0,0,"Search");
+        MenuItem item = menu.findItem(0);
+        if (item != null) {
+            item.setShowAsAction(SHOW_AS_ACTION_ALWAYS);
+        }
+
+        return true;
+    }
+
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         switch (item.getItemId()) {
@@ -146,6 +164,10 @@ public class OrderFilterActivity extends BasicActivity {
                 finish();
                 return true;
             }
+            case 0: {
+                searchClick();
+                return true;
+            }
         }
 
         return super.onOptionsItemSelected(item);

+ 24 - 2
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeCellLayout.java

@@ -1,6 +1,8 @@
 package com.usai.redant.apexdrivers.home;
 
 import android.content.Context;
+import android.graphics.Color;
+import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.view.View;
 import android.widget.ImageView;
@@ -13,7 +15,7 @@ import java.lang.ref.WeakReference;
 
 public class HomeCellLayout extends RelativeLayout implements HomeOrderModel.OrderModelDelegate {
 
-    TextView titleTv, orderNoTv, containerNoTv, dateTv,orderType2Tv;
+    TextView titleTv, orderNoTv, containerNoTv, dateTv,orderType2Tv, index_tv;
     ImageView statusView, markView;
     RelativeLayout contentContainer;
 
@@ -54,6 +56,20 @@ public class HomeCellLayout extends RelativeLayout implements HomeOrderModel.Ord
         initialed = true;
     }
 
+    private boolean isMore = false;
+    public void setIsMore(boolean isMore) {
+        this.isMore = isMore;
+        if (isMore) {
+            index_tv = findViewById(R.id.index_tv);
+        }
+    }
+
+    public void setIndex(int idx) {
+        if (index_tv != null) {
+            index_tv.setText(String.format("%d",idx));
+        }
+    }
+
     public void bindOrderModel(HomeOrderModel model) {
 
         if (!initialed) {
@@ -91,7 +107,7 @@ public class HomeCellLayout extends RelativeLayout implements HomeOrderModel.Ord
         orderNoTv.setText(model.orderNo);
         containerNoTv.setText(model.containerNo);
         dateTv.setText(model.date);
-        orderType2Tv.setText(model.order_type2);
+        orderType2Tv.setText(model.order_type);
         statusView.setImageBitmap(model.getIcon());
 
         if (model.backendFlag) {
@@ -106,6 +122,12 @@ public class HomeCellLayout extends RelativeLayout implements HomeOrderModel.Ord
             contentContainer.setBackgroundResource(R.drawable.round_corner_bg);
         }
 
+        if (model != null && !TextUtils.isEmpty(model.color)) {
+            orderType2Tv.setTextColor(Color.parseColor(model.color));
+        } else {
+            orderType2Tv.setTextColor(Color.parseColor("#000000"));
+        }
+
     }
 
     @Override

+ 24 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeFragment.java

@@ -396,6 +396,28 @@ public class HomeFragment extends Fragment implements HomeHeaderView.HomeHeaderD
         },null);
     }
 
+    private void startMoreActivity(String title, int type) {
+
+        Intent intent = HomeMoreActivity.build(mCtx, type, title);
+
+        startActivityForResult(intent,REQUEST_MORE_CODE);
+    }
+
+    @Override
+    public void newCountClick() {
+        startMoreActivity("New Order",HomeOrderModel.OrderStatusNew);
+    }
+
+    @Override
+    public void processingCountClick() {
+        startMoreActivity("Processing Order",HomeOrderModel.OrderStatusProcessing);
+    }
+
+    @Override
+    public void finishedCountClick() {
+        startMoreActivity("Finished Order",HomeOrderModel.OrderStatusFinish);
+    }
+
     @Override
     public void signoutClick() {
         ((MainActivity)getActivity()).logout();
@@ -767,6 +789,8 @@ public class HomeFragment extends Fragment implements HomeHeaderView.HomeHeaderD
                     model.setIconURL(order.optString("iconURL"));
                     model.setBackendFlag(order.optBoolean("backendFlag"));
                     model.status_no = order.optString("status_no");
+                    model.color = order.optString("color");
+                    model.order_type = order.optString("order_type");
 
                     orderArr.add(model);
                 }

+ 35 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeHeaderView.java

@@ -17,6 +17,9 @@ public class HomeHeaderView extends RelativeLayout {
         void settingClick();
         void availableClick();
         void messageClick();
+        void newCountClick();
+        void processingCountClick();
+        void finishedCountClick();
     }
 
     private Context mCtx;
@@ -50,6 +53,7 @@ public class HomeHeaderView extends RelativeLayout {
         }
     }
 
+    private View newContainer, processingContainer, finishedContainer;
     private TextView newCountTv,processingCountTv,finishCountTv,availableTv;
     private ImageView signoutBtn,settingBtn,availableBtn,messageBtn;
     private ImageView messageFlagView;
@@ -61,6 +65,10 @@ public class HomeHeaderView extends RelativeLayout {
 
     private void init() {
 
+        newContainer = findViewById(R.id.new_count_container);
+        processingContainer = findViewById(R.id.processing_count_container);
+        finishedContainer = findViewById(R.id.finished_count_container);
+
         newCountTv = findViewById(R.id.home_header_new_count_tv);
         processingCountTv = findViewById(R.id.home_header_processing_count_tv);
         finishCountTv = findViewById(R.id.home_header_finish_count_tv);
@@ -76,6 +84,33 @@ public class HomeHeaderView extends RelativeLayout {
         setAvailable(false);
         setExistNewMessage(false);
 
+        newContainer.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (delegate != null) {
+                    delegate.newCountClick();
+                }
+            }
+        });
+
+        processingContainer.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (delegate != null) {
+                    delegate.processingCountClick();
+                }
+            }
+        });
+
+        finishedContainer.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (delegate != null) {
+                    delegate.finishedCountClick();
+                }
+            }
+        });
+
         signoutBtn.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {

+ 6 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeMoreActivity.java

@@ -457,6 +457,8 @@ public class HomeMoreActivity extends BasicActivity implements AbsListView.OnScr
                         model.setIconURL(order.optString("iconURL"));
                         model.setBackendFlag(order.optBoolean("backendFlag"));
                         model.status_no = order.optString("status_no");
+                        model.color = order.optString("color");
+                        model.order_type = order.optString("order_type");
 
                         mOrders.add(model);
                     }
@@ -631,7 +633,8 @@ public class HomeMoreActivity extends BasicActivity implements AbsListView.OnScr
             OrderCellHolder holder;
             if (convertView == null) {
 
-                cell = LayoutInflater.from(mContext).inflate(R.layout.home_order_cell,null);
+                cell = LayoutInflater.from(mContext).inflate(R.layout.home_more_order_cell,null);
+
                 holder = new OrderCellHolder(cell);
 
             } else {
@@ -639,6 +642,8 @@ public class HomeMoreActivity extends BasicActivity implements AbsListView.OnScr
                 cell = convertView;
                 holder = (OrderCellHolder)convertView.getTag();
             }
+            ((HomeCellLayout) cell).setIsMore(true);
+            ((HomeCellLayout) cell).setIndex(position + 1);
 
             HomeOrderModel orderModel = mOrders.get(position);
 

+ 2 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeOrderModel.java

@@ -26,6 +26,8 @@ public class HomeOrderModel {
     String iconURL;
     boolean backendFlag;
     String status_no;
+    String color;
+    String order_type;
 
     OrderModelDelegate delegate;
 

+ 10 - 2
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/login/LoginFragment.java

@@ -101,7 +101,6 @@ public class LoginFragment extends Fragment/* implements OnClickListener */
 			try {
 				m_etName.setText(u);
 				m_etPassword.setText(p);
-				m_cbSave.setChecked(true);
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
@@ -109,6 +108,14 @@ public class LoginFragment extends Fragment/* implements OnClickListener */
 
 		}
 
+		m_cbSave.setChecked(ApexDriverApplication.sharedApplication().getSavePass());
+		m_cbSave.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				ApexDriverApplication.sharedApplication().setSavePass(!ApexDriverApplication.sharedApplication().getSavePass());
+			}
+		});
+
 		m_etPassword.setOnEditorActionListener(new TextView.OnEditorActionListener() {
 					@Override
 					public boolean onEditorAction(TextView textView, int id,
@@ -334,7 +341,8 @@ public class LoginFragment extends Fragment/* implements OnClickListener */
 				int result = json.optInt("result");
 				if (result == Network.RESULT_TRUE) {
 
-					ApexDriverApplication.sharedApplication().login(m_sUser.toLowerCase(),m_sPassword);
+					String firstName = json.optString("firstName");
+					ApexDriverApplication.sharedApplication().login(m_sUser.toLowerCase(),m_sPassword,firstName);
 
 					if(mCallBack!=null)
 						mCallBack.onLogin();

+ 2 - 2
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/network/Network.java

@@ -21,8 +21,8 @@ import static java.lang.Thread.sleep;
 
 public class Network extends com.usai.redant.rautils.utils.Network {
 
-//    private static final String URL_HOST = "http://192.168.0.124:8080/t";
-    private static final String URL_HOST = "https://ra.apexshipping.com/t";
+    private static final String URL_HOST = "http://192.168.0.124:8080/t";
+//    private static final String URL_HOST = "https://ra.apexshipping.com/t";
 
 
     public static final String URL_LOGIN = URL_HOST  + "/mobile/login.mo/";

+ 26 - 26
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/receiver/ApexDriverAlarmReceiver.java

@@ -159,32 +159,32 @@ public class ApexDriverAlarmReceiver extends AlarmReceiver {
             @Override
             public void run() {
 
-                if (ApexDriverApplication.sharedApplication().isLogin()) {
-
-                    JSONObject json = com.usai.redant.apexdrivers.network.Network.pullNotification();
-
-                    if (json != null) {
-
-                        int result = json.optInt("result",0);
-                        if (result == RESULT_TRUE) {
-
-                            JSONArray notifications = json.optJSONArray("notifications");
-                            if (notifications != null) {
-
-                                for (int i = 0; i < notifications.length(); i++) {
-                                    JSONObject notification = notifications.optJSONObject(i);
-                                    if (notification != null) {
-                                        ApexDriverApplication.sharedApplication().receiveNotificationOnMainThread(notification);
-                                    }
-                                }
-
-                            }
-
-                        }
-
-                    }
-
-                }
+//                if (ApexDriverApplication.sharedApplication().isLogin()) {
+//
+//                    JSONObject json = com.usai.redant.apexdrivers.network.Network.pullNotification();
+//
+//                    if (json != null) {
+//
+//                        int result = json.optInt("result",0);
+//                        if (result == RESULT_TRUE) {
+//
+//                            JSONArray notifications = json.optJSONArray("notifications");
+//                            if (notifications != null) {
+//
+//                                for (int i = 0; i < notifications.length(); i++) {
+//                                    JSONObject notification = notifications.optJSONObject(i);
+//                                    if (notification != null) {
+//                                        ApexDriverApplication.sharedApplication().receiveNotificationOnMainThread(notification);
+//                                    }
+//                                }
+//
+//                            }
+//
+//                        }
+//
+//                    }
+//
+//                }
 
             }
         }).start();

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

@@ -3,7 +3,9 @@ package com.usai.redant.apexdrivers.update;
 import android.Manifest;
 import android.app.Activity;
 import android.app.AlertDialog;
+import android.app.DatePickerDialog;
 import android.app.ProgressDialog;
+import android.app.TimePickerDialog;
 import android.content.ContentValues;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -25,8 +27,10 @@ import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.widget.DatePicker;
 import android.widget.ExpandableListView;
 import android.widget.TextView;
+import android.widget.TimePicker;
 import android.widget.Toast;
 
 import com.usai.redant.apexdrivers.ApexDriverApplication;
@@ -34,10 +38,12 @@ import com.usai.redant.apexdrivers.MainActivity;
 import com.usai.redant.apexdrivers.R;
 import com.usai.redant.apexdrivers.base.BasicActivity;
 import com.usai.redant.apexdrivers.codescanner.CaptureActivity;
+import com.usai.redant.apexdrivers.filter.OrderFilterActivity;
 import com.usai.redant.apexdrivers.home.HomeFragment;
 import com.usai.redant.apexdrivers.network.Network;
 import com.usai.redant.apexdrivers.signature.SignatureActivity;
 import com.usai.redant.apexdrivers.update.model.UpdateBaseModel;
+import com.usai.redant.apexdrivers.update.model.UpdateDateModel;
 import com.usai.redant.apexdrivers.update.model.UpdateImageBaseModel;
 import com.usai.redant.apexdrivers.update.model.UpdateInputModel;
 import com.usai.redant.apexdrivers.update.model.UpdateMultInputModel;
@@ -60,6 +66,7 @@ import java.io.IOException;
 import java.lang.ref.WeakReference;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
@@ -938,6 +945,35 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
         SignatureActivity.startSignature(this,REQUEST_SIGNATURE_CODE);
     }
 
+    @Override
+    public void dateClick(UpdateDateModel model) {
+
+        new TimePickerDialog(mCtx, new TimePickerDialog.OnTimeSetListener() {
+            @Override
+            public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+
+            }
+        },0,0,true).show();
+
+//        Calendar c = Calendar.getInstance();
+//        new DatePickerDialog(mCtx,
+//                new DatePickerDialog.OnDateSetListener()
+//                {
+//
+//                    @Override
+//                    public void onDateSet(DatePicker view,
+//                                          int year, int monthOfYear,
+//                                          int dayOfMonth)
+//                    {
+//
+//
+//                    }
+//
+//                }, c.get(Calendar.YEAR), c.get(Calendar.MONTH),
+//                c.get(Calendar.DAY_OF_MONTH)).show();
+
+    }
+
     /**
      * Camera
      * */

+ 124 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateAdapter.java

@@ -18,6 +18,7 @@ import android.widget.TextView;
 import com.usai.redant.apexdrivers.R;
 import com.usai.redant.apexdrivers.signature.SignatureActivity;
 import com.usai.redant.apexdrivers.update.model.UpdateBaseModel;
+import com.usai.redant.apexdrivers.update.model.UpdateDateModel;
 import com.usai.redant.apexdrivers.update.model.UpdateInputModel;
 import com.usai.redant.apexdrivers.update.model.UpdateLabelModel;
 import com.usai.redant.apexdrivers.update.model.UpdateMultInputModel;
@@ -27,6 +28,8 @@ import com.usai.redant.apexdrivers.update.model.UpdateSignatureModel;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 
+import static android.text.util.Linkify.PHONE_NUMBERS;
+
 public class UpdateAdapter extends BaseExpandableListAdapter {
 
     private Context mCtx;
@@ -209,6 +212,25 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
                 UpdateSignatureModel signatureModel = (UpdateSignatureModel)model;
                 holder.bindModel(signatureModel);
             }
+            break;
+            case UpdateBaseModel.UpdateTypeDate: {
+
+                DateHolder holder;
+                if (convertView == null) {
+
+                    convertView = LayoutInflater.from(mCtx).inflate(R.layout.update_date_cell,null);
+                    holder = new DateHolder(convertView);
+
+                } else {
+
+                    holder = (DateHolder) convertView.getTag();
+                }
+
+                UpdateDateModel dateModel = (UpdateDateModel)model;
+                holder.bindModel(dateModel);
+
+            }
+            break;
         }
 
         return convertView;
@@ -249,8 +271,16 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
         }
 
         public void bindModel(UpdateLabelModel model) {
+
+            if (model != null && model.detectTel) {
+                valueTv.setAutoLinkMask(PHONE_NUMBERS);
+            } else {
+                valueTv.setAutoLinkMask(0);
+            }
+
             titleTv.setText(model.title);
             valueTv.setText(model.value);
+
         }
     }
 
@@ -320,6 +350,11 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
                 requiredTv.setVisibility(View.GONE);
             }
         }
+
+        @Override
+        public void unbind() {
+            weakInput = null;
+        }
     }
 
     private class MultInputHolder implements UpdateBaseModel.UpdateModelDelegate,View.OnTouchListener {
@@ -373,6 +408,11 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             }
         }
 
+        @Override
+        public void unbind() {
+            weakInput = null;
+        }
+
         @Override
         public boolean onTouch(View v, MotionEvent event) {
 
@@ -442,6 +482,11 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             }
 
         }
+
+        @Override
+        public void unbind() {
+            weakPhoto = null;
+        }
     }
 
     private class SignatureHolder implements UpdateBaseModel.UpdateModelDelegate {
@@ -499,12 +544,91 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             }
 
         }
+
+        @Override
+        public void unbind() {
+            weakSignature = null;
+        }
+    }
+
+    private class DateHolder implements UpdateBaseModel.UpdateModelDelegate {
+
+        TextView titleTv, requiredTv, valueTv;
+        ImageButton dateBtn;
+        WeakReference<UpdateDateModel> weakDate = null;
+
+        DateHolder(View view) {
+
+            titleTv = view.findViewById(R.id.update_date_title_tv);
+            requiredTv = view.findViewById(R.id.update_date_required_tv);
+            valueTv = view.findViewById(R.id.update_date_value_tv);
+            dateBtn = view.findViewById(R.id.update_date_btn);
+            dateBtn.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+
+                }
+            });
+
+            view.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+
+                    if (weakDate != null && weakDate.get() != null && mDelegate != null) {
+                        mDelegate.get().dateClick(weakDate.get());
+                    }
+                }
+            });
+
+            view.setTag(this);
+        }
+
+        public void bindModel(UpdateDateModel model) {
+
+            if (weakDate != null && weakDate.get() != null) {
+                weakDate.get().setDelegate(null);
+            }
+
+            if (model != null) {
+                weakDate = new WeakReference<>(model);
+                weakDate.get().setDelegate(this);
+            } else {
+                weakDate = null;
+            }
+
+            refresh();
+        }
+
+        @Override
+        public void refresh() {
+
+            UpdateDateModel model = null;
+            if (weakDate != null) {
+                model = weakDate.get();
+            }
+
+            if (model != null) {
+                titleTv.setText(model.title);
+                requiredTv.setVisibility(model.required ? View.VISIBLE : View.INVISIBLE);
+                valueTv.setText(model.getDisplay());
+            } else {
+                titleTv.setText(null);
+                requiredTv.setVisibility(View.INVISIBLE);
+                valueTv.setText(null);
+            }
+        }
+
+        @Override
+        public void unbind() {
+            weakDate = null;
+        }
     }
 
     public interface UpdateAdapterDelegate {
         void scannerButtonDidClick(UpdateInputModel model);
         void photoButtonDidClick(UpdatePhotoModel model);
         void signatureClick(UpdateSignatureModel model);
+        void dateClick(UpdateDateModel model);
     }
 
     public class UpdateTextWatcher implements TextWatcher {

+ 111 - 57
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateSectionModel.java

@@ -1,6 +1,7 @@
 package com.usai.redant.apexdrivers.update;
 
 import com.usai.redant.apexdrivers.update.model.UpdateBaseModel;
+import com.usai.redant.apexdrivers.update.model.UpdateDateModel;
 import com.usai.redant.apexdrivers.update.model.UpdateInputModel;
 import com.usai.redant.apexdrivers.update.model.UpdateLabelModel;
 import com.usai.redant.apexdrivers.update.model.UpdateMultInputModel;
@@ -18,6 +19,103 @@ public class UpdateSectionModel {
     public String title;
     public ArrayList<UpdateBaseModel> items = new ArrayList<>();
 
+    public UpdateBaseModel createModelWithJsonObject(JSONObject item) {
+        if (item == null) {
+            return null;
+        }
+        int type = item.optInt("type");
+//        boolean autofill = item.optBoolean("autofill");
+//        JSONObject expand = item.optJSONObject("expand");
+
+        UpdateBaseModel model = null;
+
+        switch (type) {
+            case UpdateBaseModel.UpdateTypeLabel: {
+
+                model = new UpdateLabelModel();
+//                model.type = type;
+//                model.title = item.optString("title");
+//                model.key = item.optString("key");
+//                model.value = item.optString("value");
+//                model.required = item.optBoolean("required");
+//                model.detectTel = item.optBoolean("detectTel");
+//                model.autofill = autofill;
+//                model.expand = expand;
+
+            }
+            break;
+            case UpdateBaseModel.UpdateTypeInput: {
+
+                model = new UpdateInputModel();
+//                model.type = type;
+//                model.title = item.optString("title");
+//                model.key = item.optString("key");
+//                model.value = item.optString("value");
+//                model.scannable = item.optBoolean("scannable");
+//                model.required = item.optBoolean("required");
+//                model.autofill = autofill;
+//                model.expand = expand;
+
+            }
+            break;
+            case UpdateBaseModel.UpdateTypeMultInput: {
+
+                model = new UpdateMultInputModel();
+//                model.type = type;
+//                model.title = item.optString("title");
+//                model.key = item.optString("key");
+//                model.value = item.optString("value");
+//                model.required = item.optBoolean("required");
+//                model.autofill = autofill;
+//                model.expand = expand;
+
+            }
+            break;
+            case UpdateBaseModel.UpdateTypePhoto: {
+
+                model = new UpdatePhotoModel();
+//                model.type = type;
+//                model.title = item.optString("title");
+//                model.key = item.optString("key");
+//                model.setPhotoPath(item.optString("photoPath")); // 本地使用的,保存、恢复
+//                model.required = item.optBoolean("required");
+//                model.autofill = autofill;
+//                model.expand = expand;
+
+            }
+            break;
+            case UpdateBaseModel.UpdateTypeSignature: {
+
+                model = new UpdateSignatureModel();
+//                model.type = type;
+//                model.title = item.optString("title");
+//                model.key = item.optString("key");
+//                model.setSignaturePath(item.optString("signaturePath")); // 本地使用的,保存、恢复
+//                model.required = item.optBoolean("required");
+//                model.autofill = autofill;
+//                model.expand = expand;
+
+            }
+            break;
+            case UpdateBaseModel.UpdateTypeDate: {
+                model = new UpdateDateModel();
+//                model.type = type;
+//                model.title = item.optString("title");
+//                model.key = item.optString("key");
+//                model.required = item.optBoolean("required");
+//                model.autofill = autofill;
+//                model.expand = expand;
+            }
+            break;
+        }
+
+        if (model != null) {
+            model.setValuesForKeysWithJSON(item);
+        }
+
+        return model;
+    }
+
     public void setItems(JSONArray items) {
         this.items.clear();
 
@@ -26,64 +124,20 @@ public class UpdateSectionModel {
             for (int i = 0; i < items.length(); i++) {
                 JSONObject item = items.optJSONObject(i);
                 if (item != null) {
-                    int type = item.optInt("type");
-                    switch (type) {
-                        case UpdateBaseModel.UpdateTypeLabel: {
-
-                            UpdateLabelModel model = new UpdateLabelModel();
-                            model.type = type;
-                            model.title = item.optString("title");
-                            model.key = item.optString("key");
-                            model.value = item.optString("value");
-                            model.required = item.optBoolean("required");
-                            this.items.add(model);
-                        }
-                        break;
-                        case UpdateBaseModel.UpdateTypeInput: {
-
-                            UpdateInputModel model = new UpdateInputModel();
-                            model.type = type;
-                            model.title = item.optString("title");
-                            model.key = item.optString("key");
-                            model.value = item.optString("value");
-                            model.scannable = item.optBoolean("scannable");
-                            model.required = item.optBoolean("required");
-                            this.items.add(model);
-                        }
-                        break;
-                        case UpdateBaseModel.UpdateTypeMultInput: {
-
-                            UpdateMultInputModel model = new UpdateMultInputModel();
-                            model.type = type;
-                            model.title = item.optString("title");
-                            model.key = item.optString("key");
-                            model.value = item.optString("value");
-                            model.required = item.optBoolean("required");
-                            this.items.add(model);
-                        }
-                        break;
-                        case UpdateBaseModel.UpdateTypePhoto: {
-
-                            UpdatePhotoModel model = new UpdatePhotoModel();
-                            model.type = type;
-                            model.title = item.optString("title");
-                            model.key = item.optString("key");
-                            model.setPhotoPath(item.optString("photoPath")); // 本地使用的,保存、恢复
-                            model.required = item.optBoolean("required");
-                            this.items.add(model);
-                        }
-                        break;
-                        case UpdateBaseModel.UpdateTypeSignature: {
-
-                            UpdateSignatureModel model = new UpdateSignatureModel();
-                            model.type = type;
-                            model.title = item.optString("title");
-                            model.key = item.optString("key");
-                            model.setSignaturePath(item.optString("signaturePath")); // 本地使用的,保存、恢复
-                            model.required = item.optBoolean("required");
-                            this.items.add(model);
+
+                    UpdateBaseModel model = createModelWithJsonObject(item);
+                    if (model != null) {
+
+                        this.items.add(model);
+
+                        if (model.expand != null && model.expand instanceof JSONObject) {
+                            JSONObject json = (JSONObject)model.expand;
+                            UpdateBaseModel expand = createModelWithJsonObject(json);
+                            if (expand != null) {
+                                this.items.add(expand);
+                                model.expand = expand;
+                            }
                         }
-                        break;
                     }
                 }
             }

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

@@ -1,14 +1,17 @@
 package com.usai.redant.apexdrivers.update.model;
 
+import com.usai.redant.apexdrivers.base.BasicObject;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.lang.ref.WeakReference;
 
-public class UpdateBaseModel {
+public class UpdateBaseModel extends BasicObject {
 
     public interface UpdateModelDelegate {
         void refresh();
+        void unbind();
     }
 
     public final static int UpdateTypeLabel = 0;
@@ -16,9 +19,10 @@ public class UpdateBaseModel {
     public final static int UpdateTypeMultInput= 2;
     public final static int UpdateTypePhoto = 3;
     public final static int UpdateTypeSignature = 4;
+    public final static int UpdateTypeDate = 5;
 
     public static int getTypeCount() {
-        return 5;
+        return 6;
     }
 
     public int type;
@@ -26,8 +30,17 @@ public class UpdateBaseModel {
     public String title;
     public boolean required;
 
+    public boolean autofill;
+    public Object expand;
+
+
     public WeakReference<UpdateModelDelegate> weakDelegate;
     public void setDelegate(UpdateModelDelegate delegate) {
+
+        if (weakDelegate != null && weakDelegate.get() != null) {
+            weakDelegate.get().unbind();
+        }
+
         if (delegate == null) {
             weakDelegate = null;
         } else {
@@ -55,4 +68,20 @@ public class UpdateBaseModel {
         return null;
     }
 
+    public void updateDefaultValue() {
+
+    }
+
+    @Override
+    public void setValuesForKeysWithJSON(JSONObject json) {
+        super.setValuesForKeysWithJSON(json);
+
+        if (autofill) {
+            updateDefaultValue();
+        }
+    }
+
+    public void setAutofill(boolean autofill) {
+        this.autofill = autofill;
+    }
 }

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

@@ -0,0 +1,54 @@
+package com.usai.redant.apexdrivers.update.model;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class UpdateDateModel extends UpdateBaseModel {
+
+    public static final int DateModeTime = 0;
+    public static final int DateModeDate = 1;
+    public static final int DateModeDateAndTime = 2;
+
+    public String format;
+    public Date date;
+    private String display;
+    public int mode;
+
+    @Override
+    public void updateDefaultValue() {
+
+        setDate(new Date());
+    }
+
+    private void updateDisplay() {
+        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
+        setDisplay(dateFormat.format(date));
+    }
+
+    public String getValue() {
+        if (date != null) {
+
+            return String.format("%.2f",date.getTime() * 1.0);
+
+        }
+        return "0";
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+
+        updateDisplay();
+    }
+
+    public String getDisplay() {
+        return display;
+    }
+
+    public void setDisplay(String display) {
+        this.display = display;
+
+        if (weakDelegate != null && weakDelegate.get() != null) {
+            weakDelegate.get().refresh();
+        }
+    }
+}

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

@@ -6,6 +6,7 @@ import org.json.JSONObject;
 public class UpdateLabelModel extends UpdateBaseModel {
 
     public String value;
+    public boolean detectTel;
 
     @Override
     public JSONObject model2Json() {
@@ -23,4 +24,8 @@ public class UpdateLabelModel extends UpdateBaseModel {
 
         return json;
     }
+
+    public void setDetectTel(boolean detectTel) {
+        this.detectTel = detectTel;
+    }
 }

+ 2 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/detail_location_cell.xml

@@ -10,6 +10,7 @@
         android:layout_height="wrap_content"
         android:layout_margin="5dp"
         android:textSize="19sp"
+        android:textStyle="bold"
         android:textColor="#000000"
         android:text="Pick Up"
         />
@@ -42,6 +43,7 @@
                 android:layout_toLeftOf="@id/detail_location_nav_btn"
                 android:textSize="17sp"
                 android:textColor="#000000"
+                android:textIsSelectable="true"
                 android:text="PORTS AMERICA - OAKLAND (W297)
 1599 MARITIME STREET
 OAKLAND,CA 94607

+ 2 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/detail_map_cell.xml

@@ -10,6 +10,7 @@
         android:layout_height="wrap_content"
         android:layout_margin="5dp"
         android:textSize="19sp"
+        android:textStyle="bold"
         android:textColor="#000000"
         android:text="Pick Up"
         />
@@ -52,6 +53,7 @@
             android:layout_toLeftOf="@id/detail_map_view"
             android:textSize="17sp"
             android:textColor="#000000"
+            android:textIsSelectable="true"
             android:text="PORTS AMERICA - OAKLAND (W297)
 1599 MARITIME STREET
 OAKLAND,CA 94607

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/detail_mult_line_cell.xml

@@ -12,6 +12,7 @@
         android:textSize="17sp"
         android:textColor="#000000"
         android:text="201805300010"
+        android:textIsSelectable="true"
         />
 
 </RelativeLayout>

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/detail_photo_cell.xml

@@ -33,6 +33,7 @@
             android:text="Container Photo"
             android:textColor="#000000"
             android:textSize="19sp"
+            android:textStyle="bold"
             />
 
     </RelativeLayout>

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/detail_signature_cell.xml

@@ -18,6 +18,7 @@
             android:textSize="19sp"
             android:textColor="#000000"
             android:text="Signature"
+            android:textStyle="bold"
             />
 
     </RelativeLayout>

+ 2 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/detail_single_line_cell.xml

@@ -11,6 +11,7 @@
         android:layout_margin="5dp"
         android:textSize="19sp"
         android:textColor="#000000"
+        android:textStyle="bold"
         android:text="Order ID"
         />
 
@@ -24,6 +25,7 @@
         android:layout_marginBottom="5dp"
         android:textSize="17sp"
         android:textColor="#000000"
+        android:textIsSelectable="true"
         android:text="201805300010"
         />
 

+ 1 - 1
ApexDrivers/apexdriverslib/src/main/res/layout/fragment_login.xml

@@ -104,7 +104,7 @@
                 android:layout_alignBottom="@+id/sign_in_button"
                 android:checked="true"
                 android:text="@string/str_savepass"
-                android:visibility="invisible" />
+                android:visibility="visible" />
 
             <Button
                 android:id="@+id/sign_in_button"

+ 3 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/home_header_view.xml

@@ -30,6 +30,7 @@
             >
 
             <LinearLayout
+                android:id="@+id/new_count_container"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
@@ -73,6 +74,7 @@
             </RelativeLayout>
 
             <LinearLayout
+                android:id="@+id/processing_count_container"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
@@ -116,6 +118,7 @@
             </RelativeLayout>
 
             <LinearLayout
+                android:id="@+id/finished_count_container"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"

+ 189 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/home_more_order_cell.xml

@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.usai.redant.apexdrivers.home.HomeCellLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+    <RelativeLayout
+        android:id="@+id/content_container"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="5dp"
+        >
+
+        <ImageView
+            android:id="@+id/order_mark_view"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="5dp"
+            android:layout_marginTop="5dp"
+            android:scaleType="centerInside"
+            android:src="@drawable/backend_flag"
+            />
+
+        <TextView
+            android:id="@+id/title_tv"
+            android:layout_width="match_parent"
+            android:layout_height="25dp"
+            android:layout_marginTop="5dp"
+            android:layout_marginLeft="60dp"
+            android:layout_marginBottom="5dp"
+            android:layout_marginRight="5dp"
+            android:layout_toLeftOf="@id/order_mark_view"
+            android:textSize="17sp"
+            android:textColor="#000000"
+            android:text="Pickup Order New"
+            />
+
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/title_tv"
+            >
+
+            <ImageView
+                android:id="@+id/status_view"
+                android:layout_width="50dp"
+                android:layout_height="50dp"
+                android:layout_marginLeft="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_centerVertical="true"
+                android:scaleType="centerInside"
+                />
+
+            <TextView
+                android:id="@+id/order_no_key_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_alignTop="@id/status_view"
+                android:layout_toRightOf="@id/status_view"
+                android:layout_marginRight="2dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:text="Order No.:"
+                />
+
+            <TextView
+                android:id="@+id/order_no_tv"
+                android:layout_width="match_parent"
+                android:layout_height="20dp"
+                android:layout_alignTop="@id/status_view"
+                android:layout_toRightOf="@id/order_no_key_tv"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:text="AFS180530001200"
+                />
+
+            <TextView
+                android:id="@+id/container_no_key_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_below="@id/order_no_tv"
+                android:layout_toRightOf="@id/status_view"
+                android:layout_marginRight="2dp"
+                android:layout_marginTop="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:text="Container No.:"
+                />
+
+            <TextView
+                android:id="@+id/container_no_tv"
+                android:layout_width="match_parent"
+                android:layout_height="20dp"
+                android:layout_below="@id/order_no_tv"
+                android:layout_toRightOf="@id/container_no_key_tv"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="5dp"
+                android:layout_marginTop="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:text="TCNU6432476"
+                />
+
+            <TextView
+                android:id="@+id/type2_key_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_below="@id/container_no_tv"
+                android:layout_toRightOf="@id/status_view"
+                android:layout_marginRight="2dp"
+                android:layout_marginTop="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:text="Order Type:"
+                />
+
+            <TextView
+                android:id="@+id/type2_tv"
+                android:layout_width="match_parent"
+                android:layout_height="20dp"
+                android:layout_below="@id/container_no_tv"
+                android:layout_toRightOf="@id/type2_key_tv"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="5dp"
+                android:layout_marginTop="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:text="Pick Up"
+                />
+
+            <TextView
+                android:id="@+id/date_key_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_below="@id/type2_key_tv"
+                android:layout_toRightOf="@id/status_view"
+                android:layout_marginRight="2dp"
+                android:layout_marginTop="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:text="Date:"
+                />
+
+            <TextView
+                android:id="@+id/date_tv"
+                android:layout_width="match_parent"
+                android:layout_height="20dp"
+                android:layout_below="@id/type2_tv"
+                android:layout_toRightOf="@id/date_key_tv"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="5dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginBottom="5dp"
+                android:textSize="17sp"
+                android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:text="5/30/2018"
+                />
+
+        </RelativeLayout>
+
+        <TextView
+            android:id="@+id/index_tv"
+            android:layout_width="50dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp"
+            android:layout_marginTop="20dp"
+            android:textColor="#E83A13"
+            android:textSize="17sp"
+            android:text="100"
+            android:textStyle="bold"
+            android:gravity="center"
+            />
+
+    </RelativeLayout>
+
+
+</com.usai.redant.apexdrivers.home.HomeCellLayout>

+ 8 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/home_order_cell.xml

@@ -71,6 +71,8 @@
                 android:layout_marginRight="5dp"
                 android:textSize="17sp"
                 android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
                 android:text="AFS180530001200"
                 />
 
@@ -98,6 +100,8 @@
                 android:layout_marginTop="5dp"
                 android:textSize="17sp"
                 android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
                 android:text="TCNU6432476"
                 />
 
@@ -125,6 +129,8 @@
                 android:layout_marginTop="5dp"
                 android:textSize="17sp"
                 android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
                 android:text="Pick Up"
                 />
 
@@ -153,6 +159,8 @@
                 android:layout_marginBottom="5dp"
                 android:textSize="17sp"
                 android:textColor="#000000"
+                android:ellipsize="end"
+                android:singleLine="true"
                 android:text="5/30/2018"
                 />
 

+ 71 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/update_date_cell.xml

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:background="#ffffff"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageButton
+        android:id="@+id/update_date_btn"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:layout_centerVertical="true"
+        android:layout_alignParentRight="true"
+        android:layout_margin="5dp"
+        android:background="@drawable/barcode_selector"
+        />
+
+    <RelativeLayout
+        android:id="@+id/update_date_title_container"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_toLeftOf="@id/update_date_btn"
+        >
+
+        <TextView
+            android:id="@+id/update_date_title_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_margin="5dp"
+            android:textSize="19sp"
+            android:textColor="#000000"
+            android:textStyle="bold"
+            android:text="File ID"
+            />
+
+        <TextView
+            android:id="@+id/update_date_required_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="#ff0000"
+            android:text="*"
+            android:textSize="19sp"
+            android:layout_toRightOf="@id/update_date_title_tv"
+            />
+
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/update_date_title_container"
+        android:layout_alignParentLeft="true"
+        android:layout_toLeftOf="@id/update_date_btn"
+        >
+
+        <TextView
+            android:id="@+id/update_date_value_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="5dp"
+            android:layout_marginBottom="5dp"
+            android:textSize="17sp"
+            android:textColor="#000000"
+            android:textIsSelectable="true"
+            android:text="AFS20180530001200"
+            />
+
+    </RelativeLayout>
+
+</RelativeLayout>

+ 3 - 1
ApexDrivers/apexdriverslib/src/main/res/layout/update_label_cell.xml

@@ -11,19 +11,21 @@
         android:layout_margin="5dp"
         android:textSize="19sp"
         android:textColor="#000000"
+        android:textStyle="bold"
         android:text="Order ID"
         />
 
     <TextView
         android:id="@+id/update_label_value_tv"
         android:layout_width="match_parent"
-        android:layout_height="20dp"
+        android:layout_height="wrap_content"
         android:layout_below="@id/update_label_title_tv"
         android:layout_alignLeft="@id/update_label_title_tv"
         android:layout_alignRight="@id/update_label_title_tv"
         android:layout_marginBottom="5dp"
         android:textSize="17sp"
         android:textColor="#000000"
+        android:textIsSelectable="true"
         android:text="AFS20180530001200"
         />
 

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/update_multinput_cell.xml

@@ -11,6 +11,7 @@
         android:layout_margin="5dp"
         android:textSize="19sp"
         android:textColor="#000000"
+        android:textStyle="bold"
         android:text="Instruction"
         />
 

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/update_photo_cell.xml

@@ -33,6 +33,7 @@
             android:text="Container Photo"
             android:textColor="#000000"
             android:textSize="19sp"
+            android:textStyle="bold"
             />
 
         <TextView

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/update_scanner_input_cell.xml

@@ -13,6 +13,7 @@
         android:layout_margin="5dp"
         android:textSize="19sp"
         android:textColor="#000000"
+        android:textStyle="bold"
         android:text="File ID"
         />
 

+ 1 - 0
ApexDrivers/apexdriverslib/src/main/res/layout/update_signature_cell.xml

@@ -17,6 +17,7 @@
             android:layout_margin="5dp"
             android:textSize="19sp"
             android:textColor="#000000"
+            android:textStyle="bold"
             android:text="Signature"
             />
         <TextView