Explorar el Código

apex land 1.11

Ray Zhang hace 7 años
padre
commit
1e3102e33e
Se han modificado 49 ficheros con 720 adiciones y 171 borrados
  1. 4 2
      ApexDrivers/RAUtilsLibrary/build.gradle
  2. 37 0
      ApexDrivers/RAUtilsLibrary/proguard-project.txt
  3. 5 3
      ApexDrivers/RAUtilsLibrary/src/main/AndroidManifest.xml
  4. 8 2
      ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/camera/CameraHelper.java
  5. 44 49
      ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/service/RAService.java
  6. 8 2
      ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/signature/SignatureActivity.java
  7. 13 10
      ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/utils/ImageUtil.java
  8. 16 4
      ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/utils/dbgUtil.java
  9. 1 1
      ApexDrivers/apexdriverscn/src/main/res/values/strings.xml
  10. 23 2
      ApexDrivers/apexdriversi/build.gradle
  11. 216 0
      ApexDrivers/apexdriversi/proguard-project.txt
  12. 24 0
      ApexDrivers/apexdriversi/src/main/java/com/usai/apex/apexdriversi/ApplicationI.java
  13. 16 0
      ApexDrivers/apexdriversi/src/main/java/com/usai/apex/apexdriversi/TestMethod.java
  14. 1 1
      ApexDrivers/apexdriversi/src/main/res/values/strings.xml
  15. 5 2
      ApexDrivers/apexdriverslib/build.gradle
  16. 39 0
      ApexDrivers/apexdriverslib/proguard-project.txt
  17. 1 1
      ApexDrivers/apexdriverslib/src/main/AndroidManifest.xml
  18. 36 20
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriverApplication.java
  19. 11 5
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriversBackgroundService.java
  20. 3 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/MainActivity.java
  21. 52 6
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/base/BasicObject.java
  22. 4 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/base/NoProguard.java
  23. 1 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/detail/DetailActivity.java
  24. 1 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/home/HomeFragment.java
  25. 1 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/login/LoginFragment.java
  26. 2 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/network/Network.java
  27. 16 10
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/offline/OfflineHandler.java
  28. 1 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/photoCell/PhotoCell.java
  29. 6 1
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/photoCell/PhotoItemModel.java
  30. 64 5
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/photoCell/PhotoModel.java
  31. 22 9
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateActivity.java
  32. 10 9
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateAdapter.java
  33. 1 0
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateBaseModel.java
  34. 10 3
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateDateModel.java
  35. 2 2
      ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/model/UpdateMultPhotoModel.java
  36. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-hdpi/ic_action_bar.png
  37. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-hdpi/ic_action_bar_o.png
  38. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-mdpi/ic_action_bar.png
  39. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-mdpi/ic_action_bar_o.png
  40. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-xhdpi/ic_action_bar.png
  41. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-xhdpi/ic_action_bar_o.png
  42. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-xxhdpi/ic_action_bar.png
  43. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-xxhdpi/ic_action_bar_o.png
  44. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-xxxhdpi/ic_action_bar.png
  45. BIN
      ApexDrivers/apexdriverslib/src/main/res/drawable-xxxhdpi/ic_action_bar_o.png
  46. 1 0
      ApexDrivers/apexdriverslib/src/main/res/layout/activity_main.xml
  47. 12 13
      ApexDrivers/apexdriverslib/src/main/res/layout/fragment_login.xml
  48. 2 1
      ApexDrivers/apexdriverslib/src/main/res/layout/multiple_photo_item_cell.xml
  49. 1 1
      ApexDrivers/apexdriverslib/src/main/res/values/styles.xml

+ 4 - 2
ApexDrivers/RAUtilsLibrary/build.gradle

@@ -12,8 +12,10 @@ android {
     }
     buildTypes {
         release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            minifyEnabled true
+            zipAlignEnabled true
+//            shrinkResources true
+//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
         }
     }
     libraryVariants.all { variant ->

+ 37 - 0
ApexDrivers/RAUtilsLibrary/proguard-project.txt

@@ -0,0 +1,37 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+-dontwarn android.support.v4.**
+-dontwarn javax.naming.**
+
+
+
+
+#-keep class com.usai.redant.camera.CameraManager
+-keep class javax.naming.*
+# Remove all Verbose/Debug logging
+
+-optimizations code/removal/simple,code/removal/advanced
+-dontobfuscate
+-assumenosideeffects class android.util.Log {
+    public static *** d(...);
+    public static *** v(...);
+    public static *** i(...);
+}

+ 5 - 3
ApexDrivers/RAUtilsLibrary/src/main/AndroidManifest.xml

@@ -40,8 +40,10 @@
     <application
         android:allowBackup="true"
         android:supportsRtl="true"
-        android:theme="@style/AppTheme"
+
         >
+        <!--android:theme="@style/AppTheme"-->
+
 
         <!-- <service -->
         <!-- android:name=".Service.RAService" -->
@@ -86,9 +88,9 @@
             android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"/>
 
         <activity android:name=".signature.SignatureActivity"
-                  android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
-            />
 
+            />
+        <!--android:theme="@style/Theme.AppCompat.Light.DarkActionBar"-->
     </application>
 
 </manifest>

+ 8 - 2
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/camera/CameraHelper.java

@@ -10,6 +10,7 @@ import android.net.Uri;
 import android.os.Environment;
 import android.provider.MediaStore;
 import android.support.v4.content.PermissionChecker;
+import android.text.format.DateFormat;
 import android.widget.Toast;
 
 import com.usai.redant.rautils.R;
@@ -17,7 +18,7 @@ import com.usai.redant.rautils.utils.RAUtil;
 
 import java.io.File;
 import java.io.IOException;
-import java.text.SimpleDateFormat;
+//import java.text.SimpleDateFormat;
 import java.util.Date;
 
 public class CameraHelper {
@@ -71,7 +72,12 @@ public class CameraHelper {
 
     private static File createImageFile(Context context) throws IOException {
         // Create an image file name
-        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
+
+        String timeStamp=DateFormat.format(
+                "yyyyMMdd_kkmmss",
+                new Date().getTime()).toString();
+
+//        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
         String imageFileName = "JPEG_" + timeStamp + "_";
         String appName = RAUtil.getApplicationName(context);
 

+ 44 - 49
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/service/RAService.java

@@ -49,6 +49,8 @@ public abstract class RAService extends Service {
     protected static  String CHANNEL_ID = "RAService";
     protected static  String CHANNEL_NAME = "RAService";
     protected static  String LAUNCH_MSG = "SERVICE IS RUNNING";
+    public static  int FOREGROUND_ICON = R.drawable.ic_launcher_foreground;
+    public static  int BACKGROUND_ICON = R.drawable.ic_launcher_background;
     public static final int DEFAULT_LOCATION_TIMEINTERVAL = 30 * 1000;
 //    public static final int DEFAULT_DISTANCE = 0 * 50;
     public static final int DEFAULT_PUSHNOTIFICATION_TIMEINTERVAL = 30 * 1000;
@@ -62,6 +64,8 @@ public abstract class RAService extends Service {
 
     private static boolean System_Location_Flag = false;
 
+    protected static boolean backgroundLocationTracing = false;
+
     private Location mCurrentLocation; // 当前定位位置,可为空
     private Location mLastNotNullLocation; // 最后一次获取的非空Location
 
@@ -173,6 +177,13 @@ public abstract class RAService extends Service {
             //        Utils.setRequestingLocationUpdates(this, true);
 //        startService(new Intent(getApplicationContext(), LocationUpdatesService.class));
             try {
+
+                Log.d(TAG, "requestLocationUpdates: ");
+//                long dbg_l = mLocationRequest.getNumUpdates();
+//                if(backgroundLocationTracing)
+//                    mLocationRequest.setNumUpdates(0);
+//                else
+//                    mLocationRequest.setNumUpdates(1);
                 mFusedLocationClient.requestLocationUpdates(mLocationRequest,
                         mLocationCallback, null);
             } catch (SecurityException unlikely) {
@@ -617,7 +628,7 @@ public abstract class RAService extends Service {
             Notification notification = new NotificationCompat.Builder(this, "Service Start")
 //                    .setContentTitle("Apex Land is running.")
                     .setContentText(LAUNCH_MSG)
-                    .setCategory(Notification.CATEGORY_SERVICE).setSmallIcon(R.drawable.ic_launcher_foreground).setPriority(1000).build();
+                    .setCategory(Notification.CATEGORY_SERVICE).setSmallIcon(FOREGROUND_ICON).setPriority(1000).build();
 
             startForeground(101, notification);
         }
@@ -674,6 +685,7 @@ public abstract class RAService extends Service {
 
             if(mFusedLocationClient!=null)
                 return;
+            Log.d(TAG, "initLocation: ");
             mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
 
             mLocationCallback = new LocationCallback() {
@@ -681,7 +693,7 @@ public abstract class RAService extends Service {
                 public void onLocationResult(LocationResult locationResult) {
                     super.onLocationResult(locationResult);
 
-                    Log.i(TAG, "onLocationResult: " + locationResult.getLastLocation());
+                    Log.i(TAG, "FusedLocationClient onLocationResult: " + locationResult.getLastLocation());
 //                    onNewLocation(locationResult.getLastLocation());
 
                     Location location = locationResult.getLastLocation();
@@ -747,13 +759,16 @@ public abstract class RAService extends Service {
                     reachabilityCallback.networkStateChanged(networkInfo);
                 }
 
-            } else if (RABroadcast.ACTION_LOCATION_ENABLE_TRACING.equals(action)) {
+            } else
+                if (RABroadcast.ACTION_LOCATION_ENABLE_TRACING.equals(action)) {
                 enable_locationTracing();
-            } else if (RABroadcast.ACTION_LOCATION_DISABLE_TRACING
+            } else
+                if (RABroadcast.ACTION_LOCATION_DISABLE_TRACING
                     .equals(action)) {
 
                 disable_locationTracing();
-            } else if (RABroadcast.ACTION_LOCATION_REQUEST_LOCATION
+            } else
+                if (RABroadcast.ACTION_LOCATION_REQUEST_LOCATION
                     .equals(action)) {
 
 
@@ -882,6 +897,8 @@ public abstract class RAService extends Service {
 
     void disable_locationTracing() {
 
+
+        backgroundLocationTracing = false;
         if (System_Location_Flag) {
 
             removeLocationUpdates();
@@ -908,12 +925,14 @@ public abstract class RAService extends Service {
             return;
         }
 
+        backgroundLocationTracing = true;
         if (System_Location_Flag) {
 
             initLocation();
 
         } else {
 
+            Log.d(TAG, "enable_locationTracing: ");
             initLocation();
             requestLocationUpdates();
 //        locationManager.requestLocationUpdates(
@@ -954,24 +973,10 @@ public abstract class RAService extends Service {
 
     protected void request_location(final String receiverID) {
 
-        if (System_Location_Flag) {
-
-            return;
-        }
 
         if (receiverID == null)
             throw new IllegalArgumentException("receiverID can't be null");
 
-//        Criteria criteria = new Criteria();
-//        criteria.setAccuracy(Criteria.ACCURACY_COARSE);//低精度,如果设置为高精度,依然获取不了location。
-//        criteria.setAltitudeRequired(false);//不要求海拔
-//        criteria.setBearingRequired(false);//不要求方位
-//        criteria.setCostAllowed(true);//允许有花费
-//        criteria.setPowerRequirement(Criteria.POWER_LOW);//低功耗
-//
-//        //从可用的位置提供器中,匹配以上标准的最佳提供器
-//        String locationProvider = locationManager.getBestProvider(criteria, true);
-
 
         if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
             // TODO: Consider calling
@@ -984,44 +989,34 @@ public abstract class RAService extends Service {
             return;
         }
 
-        return;
-//        LocationListener singleListener = new LocationListener() {
-//            @Override
-//            public void onLocationChanged(Location location) {
-//
-//
-//
-//                if(location==null)
-//                    Log.d("ApexDriversB..Service", "onLocationChanged: null");
-//                else
-//                    Log.d("ApexDriversB..Service", "single location onLocationChanged: "+location.getLongitude()+" , "+location.getLatitude());
-//                Intent Bintent = new Intent(RABroadcast.EVENT_RETURN_LOCATION);
-//                Bintent.putExtra("location", location);
-//                Bintent.putExtra("receiverID", receiverID);
-//                sendBroadcast(Bintent);
-//
-//
-//            }
-//
-//            @Override
-//            public void onStatusChanged(String s, int i, Bundle bundle) {
+        backgroundLocationTracing = true;
+        if (System_Location_Flag) {
+
+            initLocation();
+
+        } else {
+
+            initLocation();
+            requestLocationUpdates();
+//        locationManager.requestLocationUpdates(
+//                "fused", timeInterval, distance,
+//                locationListener);
+//        if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
 //
-//            }
 //
-//            @Override
-//            public void onProviderEnabled(String s) {
 //
-//            }
 //
-//            @Override
-//            public void onProviderDisabled(String s) {
+//        } else if (locationManager
+//                .isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
 //
-//            }
-//        };
 //
+//            locationManager.requestLocationUpdates(
+//                    LocationManager.NETWORK_PROVIDER, timeInterval, distance,
+//                    locationListener);
 //
-//        locationManager.requestSingleUpdate("fused", singleListener, null);
+//        }
 
+        }
 
     }
 }

+ 8 - 2
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/signature/SignatureActivity.java

@@ -8,6 +8,7 @@ import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.support.v7.app.AppCompatActivity;
 import android.text.TextUtils;
+import android.text.format.DateFormat;
 import android.view.Menu;
 import android.view.MenuItem;
 
@@ -17,7 +18,7 @@ import com.usai.redant.rautils.utils.ImageUtil;
 
 import java.io.File;
 import java.io.IOException;
-import java.text.SimpleDateFormat;
+//import java.text.SimpleDateFormat;
 import java.util.Date;
 
 public class SignatureActivity extends AppCompatActivity {
@@ -100,7 +101,12 @@ public class SignatureActivity extends AppCompatActivity {
         Bitmap signature = mSignatureView.clearBlank(5);
         if (signature != null) {
 
-            String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
+
+            String timeStamp=DateFormat.format(
+                    "yyyyMMdd_kkmmss",
+                    new Date().getTime()).toString();
+//            MM/dd/yyyy kk:mm:ss
+//            String timeStamp = new SimpleDateFormat("yyyyMMdd_kkmmss").format(new Date());
             String signatureName = "JPEG_" + timeStamp + ".jpg";
 
 //            String root = FileManager.SDCardRoot();

+ 13 - 10
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/utils/ImageUtil.java

@@ -1,6 +1,7 @@
 package com.usai.redant.rautils.utils;
 
 import android.content.Context;
+import android.content.Intent;
 import android.content.res.ColorStateList;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
@@ -8,10 +9,8 @@ import android.graphics.BitmapFactory;
 import android.graphics.Matrix;
 import android.graphics.drawable.Drawable;
 import android.media.ExifInterface;
-import android.media.MediaScannerConnection;
 import android.net.Uri;
 import android.support.v4.graphics.drawable.DrawableCompat;
-import android.util.Log;
 
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayOutputStream;
@@ -21,8 +20,6 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
 
 public class ImageUtil {
 
@@ -173,12 +170,18 @@ public class ImageUtil {
         }
 
 //        Context context = getApplication().getApplicationContext();
-        MediaScannerConnection.scanFile(context, new String[] { filename }, null, new MediaScannerConnection.OnScanCompletedListener() {
-                    public void onScanCompleted(String path, Uri uri) {
-                        Log.i("ExternalStorage", "Scanned " + path + ":");
-                        Log.i("ExternalStorage", "-> uri=" + uri);
-                    }
-                });
+//        MediaScannerConnection.scanFile(context, new String[] { filename }, null, new MediaScannerConnection.OnScanCompletedListener() {
+//                    public void onScanCompleted(String path, Uri uri) {
+//                        Log.i("ExternalStorage", "Scanned " + path + ":");
+//                        Log.i("ExternalStorage", "-> uri=" + uri);
+//                    }
+//                });
+
+        File file = new File(filename);
+        Uri contentUri = Uri.fromFile(file);
+        Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+        mediaScanIntent.setData(contentUri);
+        context.sendBroadcast(mediaScanIntent);
     }
 
     public static String imageCachePath(Context context, URI uri) {

+ 16 - 4
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/utils/dbgUtil.java

@@ -3,6 +3,7 @@ package com.usai.redant.rautils.utils;
 import android.Manifest;
 import android.content.Context;
 import android.database.Cursor;
+import android.text.format.DateFormat;
 import android.util.Log;
 
 import java.io.BufferedWriter;
@@ -10,7 +11,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.text.SimpleDateFormat;
+//import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.concurrent.locks.ReadWriteLock;
@@ -82,7 +83,11 @@ public class dbgUtil
 
 		Calendar c = Calendar.getInstance();
 
-		String newtime = new SimpleDateFormat("yyyy-MM-dd").format(c.getTimeInMillis());
+
+		String newtime=DateFormat.format(
+				"yyyy-MM-dd",
+				c.getTime()).toString();
+//		String newtime = new SimpleDateFormat("yyyy-MM-dd").format(c.getTimeInMillis());
 
 		File[] f = dir.listFiles();
 		if(f==null) {
@@ -110,8 +115,15 @@ public class dbgUtil
 
 		// dir.listfiles
 
-		String file = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
-		String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+		String file=DateFormat.format(
+				"yyyy-MM-dd",
+				new Date().getTime()).toString();
+
+//		String file = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
+		String timeStamp=DateFormat.format(
+				"MM/dd/yyyy kk:mm:ss",
+				new Date().getTime()).toString();
+//		String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
 
 		FileOutputStream outputStream = null;
 

+ 1 - 1
ApexDrivers/apexdriverscn/src/main/res/values/strings.xml

@@ -1,3 +1,3 @@
 <resources>
-    <string name="app_name">ApexDriversCN</string>
+    <string name="app_name">Apex Land</string>
 </resources>

+ 23 - 2
ApexDrivers/apexdriversi/build.gradle

@@ -1,6 +1,22 @@
 apply plugin: 'com.android.application'
 
 android {
+    signingConfigs {
+        release {
+            keyAlias 'Apex Land'
+            keyPassword '#UL$dc01'
+            storeFile file('/Users/ray/Documents/usai android keystore/usai_keystore')
+            storePassword '#UL$dc01'
+        }
+    }
+    splits {
+        abi {
+            enable true
+            reset()
+            include 'armeabi-v7a'
+            universalApk true
+        }
+    }
     compileSdkVersion 26
     defaultConfig {
         applicationId "com.usai.apex.apexdriversi"
@@ -14,8 +30,13 @@ android {
     }
     buildTypes {
         release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            minifyEnabled true
+            zipAlignEnabled true
+            shrinkResources true
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
+            debuggable false
+        }
+        debug {
         }
     }
     gradle.projectsEvaluated {

+ 216 - 0
ApexDrivers/apexdriversi/proguard-project.txt

@@ -0,0 +1,216 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+-dontwarn android.support.v4.**
+-dontwarn javax.naming.**
+
+
+
+
+#-keep class com.usai.redant.camera.CameraManager
+-keep class javax.naming.*
+-keep class * extends com.usai.redant.apexdrivers.base.NoProguard {*;}
+
+# Remove all Verbose/Debug logging
+
+-optimizations code/removal/simple,code/removal/advanced
+-dontobfuscate
+-assumenosideeffects class android.util.Log {
+    public static *** d(...);
+    public static *** v(...);
+    public static *** i(...);
+}
+
+##
+##-------------------------------------------基本不用动区域----------------------------------------------
+##
+##
+## -----------------------------基本 -----------------------------
+##
+#
+## 指定代码的压缩级别 0 - 7(指定代码进行迭代优化的次数,在Android里面默认是5,这条指令也只有在可以优化时起作用。)
+#-optimizationpasses 5
+## 混淆时不会产生形形色色的类名(混淆时不使用大小写混合类名)
+#-dontusemixedcaseclassnames
+## 指定不去忽略非公共的库类(不跳过library中的非public的类)
+#-dontskipnonpubliclibraryclasses
+## 指定不去忽略包可见的库类的成员
+#-dontskipnonpubliclibraryclassmembers
+##不进行优化,建议使用此选项,
+#-dontoptimize
+# # 不进行预校验,Android不需要,可加快混淆速度。
+#-dontpreverify
+#
+#
+## 屏蔽警告
+#-ignorewarnings
+## 指定混淆是采用的算法,后面的参数是一个过滤器
+## 这个过滤器是谷歌推荐的算法,一般不做更改
+#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+## 保护代码中的Annotation不被混淆
+#-keepattributes *Annotation*
+## 避免混淆泛型, 这在JSON实体映射时非常重要
+#-keepattributes Signature
+## 抛出异常时保留代码行号
+#-keepattributes SourceFile,LineNumberTable
+# #优化时允许访问并修改有修饰符的类和类的成员,这可以提高优化步骤的结果。
+## 比如,当内联一个公共的getter方法时,这也可能需要外地公共访问。
+## 虽然java二进制规范不需要这个,要不然有的虚拟机处理这些代码会有问题。当有优化和使用-repackageclasses时才适用。
+##指示语:不能用这个指令处理库中的代码,因为有的类和类成员没有设计成public ,而在api中可能变成public
+#-allowaccessmodification
+##当有优化和使用-repackageclasses时才适用。
+##-repackageclasses com.test
+#
+# # 混淆时记录日志(打印混淆的详细信息)
+# # 这句话能够使我们的项目混淆后产生映射文件
+# # 包含有类名->混淆后类名的映射关系
+#-verbose
+#
+##
+## ----------------------------- 默认保留 -----------------------------
+##
+##----------------------------------------------------
+## 保持哪些类不被混淆
+##继承activity,application,service,broadcastReceiver,contentprovider....不进行混淆
+#-keep public class * extends android.app.Activity
+#-keep public class * extends android.app.Application
+#-keep public class * extends android.support.multidex.MultiDexApplication
+#-keep public class * extends android.app.Service
+#-keep public class * extends android.content.BroadcastReceiver
+#-keep public class * extends android.content.ContentProvider
+#-keep public class * extends android.app.backup.BackupAgentHelper
+#-keep public class * extends android.preference.Preference
+#-keep public class * extends android.view.View
+#-keep class android.support.** {*;}## 保留support下的所有类及其内部类
+#
+#-keep public class com.google.vending.licensing.ILicensingService
+#-keep public class com.android.vending.licensing.ILicensingService
+#
+#-keep class * extends com.usai.redant.apexdrivers.base.NoProguard {*;}
+#-keep class javax.naming.*
+##表示不混淆上面声明的类,最后这两个类我们基本也用不上,是接入Google原生的一些服务时使用的。
+##----------------------------------------------------
+#
+## 保留继承的
+#-keep public class * extends android.support.v4.**
+#-keep public class * extends android.support.v7.**
+#-keep public class * extends android.support.annotation.**
+#
+#
+##表示不混淆任何包含native方法的类的类名以及native方法名,这个和我们刚才验证的结果是一致
+#-keepclasseswithmembernames class * {
+#    native <methods>;
+#}
+#
+#
+##这个主要是在layout 中写的onclick方法android:onclick="onClick",不进行混淆
+##表示不混淆Activity中参数是View的方法,因为有这样一种用法,在XML中配置android:onClick=”buttonClick”属性,
+##当用户点击该按钮时就会调用Activity中的buttonClick(View view)方法,如果这个方法被混淆的话就找不到了
+#-keepclassmembers class * extends android.app.Activity{
+#    public void *(android.view.View);
+#}
+#
+##表示不混淆枚举中的values()和valueOf()方法,枚举我用的非常少,这个就不评论了
+#-keepclassmembers enum * {
+#    public static **[] values();
+#    public static ** valueOf(java.lang.String);
+#}
+#
+##表示不混淆任何一个View中的setXxx()和getXxx()方法,
+##因为属性动画需要有相应的setter和getter的方法实现,混淆了就无法工作了。
+#-keep public class * extends android.view.View{
+#    *** get*();
+#    void set*(***);
+#    public <init>(android.content.Context);
+#    public <init>(android.content.Context, android.util.AttributeSet);
+#    public <init>(android.content.Context, android.util.AttributeSet, int);
+#}
+#-keepclasseswithmembers class * {
+#    public <init>(android.content.Context, android.util.AttributeSet);
+#    public <init>(android.content.Context, android.util.AttributeSet, int);
+#}
+#
+##表示不混淆Parcelable实现类中的CREATOR字段,
+##毫无疑问,CREATOR字段是绝对不能改变的,包括大小写都不能变,不然整个Parcelable工作机制都会失败。
+#-keep class * implements android.os.Parcelable {
+#  public static final android.os.Parcelable$Creator *;
+#}
+## 这指定了继承Serizalizable的类的如下成员不被移除混淆
+#-keepclassmembers class * implements java.io.Serializable {
+#    static final long serialVersionUID;
+#    private static final java.io.ObjectStreamField[] serialPersistentFields;
+#    private void writeObject(java.io.ObjectOutputStream);
+#    private void readObject(java.io.ObjectInputStream);
+#    java.lang.Object writeReplace();
+#    java.lang.Object readResolve();
+#}
+## 保留R下面的资源
+#-keep class **.R$* {
+# *;
+#}
+##不混淆资源类下static的
+#-keepclassmembers class **.R$* {
+#    public static <fields>;
+#}
+#
+#
+#
+## 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
+#-keepclassmembers class * {
+#    void *(**On*Event);
+#    void *(**On*Listener);
+#}
+#
+## 保留我们自定义控件(继承自View)不被混淆
+#-keep public class * extends android.view.View{
+#    *** get*();
+#    void set*(***);
+#    public <init>(android.content.Context);
+#    public <init>(android.content.Context, android.util.AttributeSet);
+#    public <init>(android.content.Context, android.util.AttributeSet, int);
+#}
+#
+##
+##----------------------------- WebView(项目中没有可以忽略) -----------------------------
+##
+##webView需要进行特殊处理
+#-keepclassmembers class fqcn.of.javascript.interface.for.Webview {
+#   public *;
+#}
+#-keepclassmembers class * extends android.webkit.WebViewClient {
+#    public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
+#    public boolean *(android.webkit.WebView, java.lang.String);
+#}
+#-keepclassmembers class * extends android.webkit.WebViewClient {
+#    public void *(android.webkit.WebView, jav.lang.String);
+#}
+##在app中与HTML5的JavaScript的交互进行特殊处理
+##我们需要确保这些js要调用的原生方法不能够被混淆,于是我们需要做如下处理:
+#-keepclassmembers class com.ljd.example.JSInterface {
+#    <methods>;
+#}
+#
+##(可选)避免Log打印输出
+#-assumenosideeffects class android.util.Log {
+#   public static *** v(...);
+#   public static *** d(...);
+#   public static *** i(...);
+#   public static *** w(...);
+# }

+ 24 - 0
ApexDrivers/apexdriversi/src/main/java/com/usai/apex/apexdriversi/ApplicationI.java

@@ -11,6 +11,30 @@ public class ApplicationI extends ApexDriverApplication implements RAProviderHel
         super.onCreate();
         CHANNEL_ID = "Apex Land";
         CHANNEL_NAME = "Push Notification";
+
+
+//
+//        TestMethod m=new TestMethod();
+//
+//
+//
+//        try {
+//            Method method1=m.getClass().getMethod("f1");
+//            Method method2=m.getClass().getMethod("f2", String.class);
+//        } catch (NoSuchMethodException e) {
+//            e.printStackTrace();
+//        }
+//
+//
+//        String packagename=ApexDriverApplication.sharedApplication().getPackageName();
+//
+//        Log.e("Lib icon", "packagename: "+packagename );
+//        int resourceId = ApexDriverApplication.sharedApplication().getResources().getIdentifier("btn_add_photo", "drawable", packagename);
+//        Log.e("Lib icon", "resid: "+resourceId );
+////        ApexDriverApplication.sharedApplication().getres
+//        Bitmap bitmap = BitmapFactory.decodeResource(ApexDriverApplication.sharedApplication().getResources(),resourceId);
+//        Log.e("Lib icon", "bmp size: "+bitmap.getWidth() );
+
     }
 
     @Override

+ 16 - 0
ApexDrivers/apexdriversi/src/main/java/com/usai/apex/apexdriversi/TestMethod.java

@@ -0,0 +1,16 @@
+package com.usai.apex.apexdriversi;
+
+import com.usai.redant.apexdrivers.base.NoProguard;
+
+public class TestMethod extends NoProguard {
+
+
+    public void f1()
+    {
+
+    }
+    public void f2(String s)
+    {
+
+    }
+}

+ 1 - 1
ApexDrivers/apexdriversi/src/main/res/values/strings.xml

@@ -1,3 +1,3 @@
 <resources>
-    <string name="app_name">ApexDriversI</string>
+    <string name="app_name">Apex Land</string>
 </resources>

+ 5 - 2
ApexDrivers/apexdriverslib/build.gradle

@@ -14,9 +14,12 @@ android {
     }
     buildTypes {
         release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            minifyEnabled true
+            zipAlignEnabled true
+//            shrinkResources true
+//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
         }
+
     }
     libraryVariants.all { variant ->
 //        if (variant.buildType.name == 'release') {

+ 39 - 0
ApexDrivers/apexdriverslib/proguard-project.txt

@@ -0,0 +1,39 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+#-dontwarn android.support.v4.**
+#-dontwarn javax.naming.**
+#
+#
+#
+#
+##-keep class com.usai.redant.camera.CameraManager
+#-keep class javax.naming.*
+##-keep  class * extends com.loafersoft.tm.NoProguard {*;}
+#-keep class * extends com.usai.redant.apexdrivers.base.NoProguard {*;}
+## Remove all Verbose/Debug logging
+#
+#-optimizations code/removal/simple,code/removal/advanced
+#-dontobfuscate
+#-assumenosideeffects class android.util.Log {
+#    public static *** d(...);
+#    public static *** v(...);
+#    public static *** i(...);
+#}

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

@@ -106,7 +106,7 @@
         <activity android:name=".filter.OrderFilterActivity"
                   android:windowSoftInputMode="adjustPan"/>
 
-        <activity android:name=".signature.SignatureActivity"/>
+        <activity android:name=".signature.DriverThemeSignatureActivity"/>
 
         <receiver
             android:name=".receiver.ApexDriverAlarmReceiver"

+ 36 - 20
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriverApplication.java

@@ -50,6 +50,8 @@ public class ApexDriverApplication extends Application {
     public static  String CHANNEL_ID = "Apex & Drivers";
     public static  String CHANNEL_NAME = "Apex & Drivers";
     public static  String LAUNCH_MSG = "Apex Land is running";
+    public static  int FOREGROUND_ICON = R.drawable.ic_action_bar_o;
+    public static  int BACKGROUND_ICON = R.drawable.small_icon;
     public static boolean bUseGoogleLocation = true;
 
     private static ApexDriverApplication mApp;
@@ -74,7 +76,7 @@ public class ApexDriverApplication extends Application {
 
     private ServiceConnection mServiceConnection;
     private ApexDriversBackgroundService mService;
-    private boolean mRequiredLocation = false;
+    private boolean mRequiredBackgroundLocation = false;
 
     private Activity mCurActivity;
 
@@ -89,8 +91,11 @@ public class ApexDriverApplication extends Application {
 
     public void initLocation()
     {
-        if(mService!=null)
-            mService.initLocation();
+        if (mService != null) {
+
+            mService.startBackgroundLocation();
+
+        }
     }
 //    private BroadcastReceiver screen_event_receiver = new BroadcastReceiver() {
 //        @Override
@@ -128,6 +133,12 @@ public class ApexDriverApplication extends Application {
 //        bintent.putExtra("msg", msg.toString());
                 sendBroadcast(bintent);
 
+//                mService.requestLocation();
+                if (mService != null) {
+
+                        mService.startBackgroundLocation();
+
+                }
                 if (authExpired) {
                     showAuthoExpiredAlert(activity);
                 }
@@ -146,6 +157,17 @@ public class ApexDriverApplication extends Application {
             if(activityStartCount==0)
             {
                 isbackground = true;
+                if (mService != null) {
+                    if (mRequiredBackgroundLocation) {
+
+                        mService.startBackgroundLocation();
+
+                    } else {
+
+                        mService.stopBackgroundLocation();
+
+                    }
+                }
                 Log.d("ApexDriverApplication", "onActivityStopped: app go background");
             }
         }
@@ -203,7 +225,7 @@ public class ApexDriverApplication extends Application {
 //                Network.uploadToken(RAUtil.getDeviceId(getApplicationContext()));
 //            }
 
-            Log.d("ApexDriverApplication", "onCreate: u:"+user+" p:"+password);
+//            Log.d("ApexDriverApplication", "onCreate: u:"+user+" p:"+password);
             mServiceConnection = new ServiceConnection() {
                 @Override
                 public void onServiceConnected(ComponentName name, IBinder service) {
@@ -211,6 +233,10 @@ public class ApexDriverApplication extends Application {
                     ApexDriversBackgroundService.MyBinder binder = (ApexDriversBackgroundService.MyBinder)service;
                     mService = (ApexDriversBackgroundService)binder.getService();
 
+                    Log.d("app start", "onCreate: startlocation");
+                    mService.startBackgroundLocation();
+
+
                 }
 
                 @Override
@@ -292,24 +318,14 @@ public class ApexDriverApplication extends Application {
         return networkQueue;
     }
 
-    public void setRequiredLocation(boolean requiredLocation) {
-        mRequiredLocation = requiredLocation;
-
-        if (mService != null) {
-            if (mRequiredLocation) {
+    public void setRequiredBackgroundLocation(boolean requiredLocation) {
+        mRequiredBackgroundLocation = requiredLocation;
 
-                mService.startLocation();
 
-            } else {
-
-                mService.stopLocation();
-
-            }
-        }
     }
 
-    public boolean getRequiredLocation() {
-        return mRequiredLocation;
+    public boolean getRequiredBackgroundLocation() {
+        return mRequiredBackgroundLocation;
     }
 
     public Location getCurrentLocation() {
@@ -920,7 +936,7 @@ public class ApexDriverApplication extends Application {
             noti = new NotificationCompat.Builder(this, CHANNEL_ID)
                     .setContentTitle(title)
                     .setContentText(msg)
-                    .setSmallIcon(R.drawable.small_icon_clear)
+                    .setSmallIcon(R.drawable.ic_action_bar_o)
                     .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.large_notification_icon_clear))
                     .setContentIntent(contentIntent)
                     .setVisibility(VISIBILITY_PUBLIC)
@@ -932,7 +948,7 @@ public class ApexDriverApplication extends Application {
             noti = new Notification.Builder(this)
                     .setContentTitle(title)
                     .setContentText(msg)
-                    .setSmallIcon(R.drawable.small_icon_clear)
+                    .setSmallIcon(R.drawable.ic_action_bar_o)
                     .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.large_notification_icon_clear))
                     .setContentIntent(contentIntent)
                     .setVisibility(VISIBILITY_PUBLIC)

+ 11 - 5
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/ApexDriversBackgroundService.java

@@ -62,6 +62,8 @@ public class ApexDriversBackgroundService extends RAService implements RAService
         CHANNEL_ID=ApexDriverApplication.sharedApplication().CHANNEL_ID;
         CHANNEL_NAME=ApexDriverApplication.sharedApplication().CHANNEL_NAME;
         LAUNCH_MSG=ApexDriverApplication.sharedApplication().LAUNCH_MSG;
+        FOREGROUND_ICON=ApexDriverApplication.sharedApplication().FOREGROUND_ICON;
+        BACKGROUND_ICON=ApexDriverApplication.sharedApplication().BACKGROUND_ICON;
         initServiceLocation(ApexDriverApplication.sharedApplication().isbUseSystemLocation(),this);
 //        initServiceNotification(this,"replace this string with notification checking url");
 
@@ -105,8 +107,8 @@ public class ApexDriversBackgroundService extends RAService implements RAService
     public void onLocationChanged(Location location) {
 
         Log.d("ApexDriversB..Service", "onLocationChanged");
-        Log.d("ApexDriversB..Service", "request single location");
-        request_location("123");
+//        Log.d("ApexDriversB..Service", "request single location");
+//        request_location("123");
 //
 //        if(location==null)
 //            Log.d("ApexDriversB..Service", "onLocationChanged: null");
@@ -123,12 +125,16 @@ public class ApexDriversBackgroundService extends RAService implements RAService
     public void handleSilenceMessage(JSONObject msg) {
 
     }
-
-    public void startLocation() {
+//    public void requestLocation() {
+//        request_location("123");
+//    }
+    public void startBackgroundLocation() {
+        Log.d("driver lib", "startLocation: ");
         sendBroadcast(new Intent(RABroadcast.ACTION_LOCATION_ENABLE_TRACING));
     }
 
-    public void stopLocation() {
+    public void stopBackgroundLocation() {
+        Log.d("driver lib", "stopLocation: ");
         sendBroadcast(new Intent(RABroadcast.ACTION_LOCATION_DISABLE_TRACING));
     }
 

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

@@ -172,7 +172,7 @@ public class MainActivity extends BasicActivity implements LoginFragment.LoginCa
 
         initView();
 
-//        checkPowerManagement();
+        checkPowerManagement();
 
 //        Test();
         checkSysLocation();
@@ -360,13 +360,14 @@ public class MainActivity extends BasicActivity implements LoginFragment.LoginCa
             {
                 intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
                 intent.setData(Uri.parse("package:" + packageName));
+                startActivity(intent);
             }
 //                intent.setAction(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS);
 //            else {
 //                intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
 //                intent.setData(Uri.parse("package:" + packageName));
 //            }
-            startActivity(intent);
+
 
         }
     }

+ 52 - 6
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/base/BasicObject.java

@@ -5,26 +5,36 @@ import org.json.JSONObject;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
-public class BasicObject {
+public class BasicObject extends NoProguard {
 
     public void setValuesForKeysWithJSON(JSONObject json) {
-
+//        Log.e("BasicObject", "setValuesForKeysWithJSON: " );
         if (json == null || json.length() == 0) {
+
+//            Log.e("BasicObject", "setValuesForKeysWithJSON: json is null" );
             return;
         }
 
 
         try {
             Class cls = getClass();
-            while (cls != null && cls != Class.class) {
+//            Log.e("BasicObject", "cls != null "+(cls != null) );
+//            Log.e("BasicObject", "cls != Class.class "+(cls != Class.class) );
 
+//            Log.e("BasicObject", "Class.class "+Class.class );
+            while (cls != null && cls != Class.class) {
+//                Log.e("BasicObject", "cls "+cls );
                 Field[] fields = cls.getFields();
+
+//                Log.e("BasicObject", "fields  "+fields.length );
+//                Log.e("BasicObject", "fields  "+fields );
+
                 for (Field f : fields) {
 
                     String key = f.getName();
 
                     Object value = json.opt(key);
-
+//                    Log.e("BasicObject full info", "key "+key+" value "+value + " type "+f.getType());
                     if (value == null) {
                         continue;
                     }
@@ -66,7 +76,9 @@ public class BasicObject {
                         } else {
 
                             if (type == Object.class) {
-                                boolean success = invokeSetter(cls,f,type,key,value);
+                                boolean success = invokeObjectSetter(type,key,(Object) value);
+//                                Log.e("invokeObjectSetter", ""+cls+"  ,  "+f+","+type+"  ,  "+key+"  ,  "+value+"  ,  "+success );
+
                                 if (!success) {
                                     f.set(this,value);
                                 }
@@ -84,7 +96,41 @@ public class BasicObject {
         }
     }
 
+    public boolean invokeObjectSetter( Class type,String key,Object value) {
+
+        String setter = "set" + toUpperCaseFirstOne(key);
+        try {
+
+
+//            Class<?> myClassType = Class.forName(cls.getName());
+//            Class<?>[] types = new Class[] { File.class };
+//            Constructor<?> cons = myClassType.getConstructor(types);
+
+//            Log.e("invokeObjectSetter", "settler: "+setter+" type "+type );
+
+            Class[] cArg = new Class[1];
+            cArg[0] = type;
+//            Log.e("invokeObjectSetter", getClass().getName() );
+            Method method = getClass().getMethod(setter,cArg);
+            if (method != null) {
+
+                method.invoke(this,value);
+
+                return true;
+            }
+
+        }
+        catch(NoSuchMethodException e)
+        {
+            e.printStackTrace();
+        }
+        catch (Exception e) {
+//            dbgUtil.Logd("invokeSetter",e.getMessage());
+            e.printStackTrace();
+        }
 
+        return false;
+    }
     public boolean invokeSetter(Class cls, Field f, Class type,String key,Object value) {
 
         String setter = "set" + toUpperCaseFirstOne(key);
@@ -106,7 +152,7 @@ public class BasicObject {
         }
         catch(NoSuchMethodException e)
         {
-
+//            e.printStackTrace();
         }
         catch (Exception e) {
 //            dbgUtil.Logd("invokeSetter",e.getMessage());

+ 4 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/base/NoProguard.java

@@ -0,0 +1,4 @@
+package com.usai.redant.apexdrivers.base;
+
+public class NoProguard extends Object {
+}

+ 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().setRequiredLocation(true);
+                    ApexDriverApplication.sharedApplication().setRequiredBackgroundLocation(true);
                 }
 
                 handleRemoteAction(actionModel);

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

@@ -430,7 +430,7 @@ public class HomeFragment extends Fragment implements HomeHeaderView.HomeHeaderD
                                 }
                             });
                             boolean requiredLocation = json.optBoolean("requiredLocation");
-                            ApexDriverApplication.sharedApplication().setRequiredLocation(requiredLocation);
+                            ApexDriverApplication.sharedApplication().setRequiredBackgroundLocation(requiredLocation);
 
                             if(json.optBoolean("iscache"))
                             {

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

@@ -79,7 +79,7 @@ public class LoginFragment extends Fragment/* implements OnClickListener */
 		TextView tv_ver = (TextView) view.findViewById(R.id.tv_ver);
 
 		try {
-			tv_ver.setText(getText(R.string.str_ver) + "2.20." + getActivity().getPackageManager().getPackageInfo(getActivity().getApplicationContext().getPackageName(), 0).versionName);
+			tv_ver.setText(getText(R.string.str_ver)  + getActivity().getPackageManager().getPackageInfo(getActivity().getApplicationContext().getPackageName(), 0).versionName);
 		} catch (NameNotFoundException e1) {
 			// TODO Auto-generated catch block
 			e1.printStackTrace();

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

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

+ 16 - 10
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/offline/OfflineHandler.java

@@ -4,7 +4,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
-
+import android.text.format.DateFormat;
 
 import com.usai.redant.apexdrivers.ApexDriverApplication;
 import com.usai.redant.apexdrivers.R;
@@ -15,26 +15,26 @@ import com.usai.redant.rautils.receiver.RABroadcast;
 import com.usai.redant.rautils.utils.FileManager;
 import com.usai.redant.rautils.utils.Network;
 
+import net.lingala.zip4j.core.ZipFile;
+import net.lingala.zip4j.model.ZipParameters;
+import net.lingala.zip4j.util.Zip4jConstants;
+
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.io.File;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Locale;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-
-import net.lingala.zip4j.core.ZipFile;
-import net.lingala.zip4j.model.ZipParameters;
-import net.lingala.zip4j.util.Zip4jConstants;
-
 import static com.usai.redant.apexdrivers.detail.model.DetailSubActionModel.DetailActionSubType.DetailActionSubTypeAccept;
 import static com.usai.redant.apexdrivers.network.Network.URL_UPLOAD;
 import static com.usai.redant.rautils.utils.Network.RESULT_TRUE;
 
+//import java.text.SimpleDateFormat;
+
 public class OfflineHandler {
 
     private Context mCtx;
@@ -353,10 +353,16 @@ public class OfflineHandler {
 
     private String currentDate() {
 
-        Date date = new Date();
-        SimpleDateFormat format = new SimpleDateFormat("MM/dd/YYYY HH:mm");
+//        Date date = new Date();
+
 
-        return format.format(date);
+        String timeStamp=DateFormat.format(
+                "MM/dd/yyyy kk:mm",
+                new Date().getTime()).toString();
+        return timeStamp;
+//        SimpleDateFormat format = new SimpleDateFormat("MM/dd/YYYY HH:mm");
+//
+//        return format.format(date);
     }
 
     private void handleDownloadOfflineFile(File file) {

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

@@ -19,6 +19,7 @@ public class PhotoCell extends RelativeLayout implements PhotoModelDelegate,Phot
 
     public static PhotoCell photoCell(Context context) {
         if (context == null) {
+            Log.e("photo cell", "photoCell: create failed, context is null" );
             return null;
         }
         PhotoCell cell = (PhotoCell) LayoutInflater.from(context).inflate(R.layout.multiple_photo_cell,null);

+ 6 - 1
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/photoCell/PhotoItemModel.java

@@ -108,8 +108,13 @@ public class PhotoItemModel extends BasicObject {
         if (photo == null) {
             if (placeHolder != null) {
 
-                int resourceId = ApexDriverApplication.sharedApplication().getResources().getIdentifier(placeHolder, "drawable", ApexDriverApplication.sharedApplication().getPackageName());
+                String packagename=ApexDriverApplication.sharedApplication().getPackageName();
+                int resourceId = ApexDriverApplication.sharedApplication().getResources().getIdentifier(placeHolder, "drawable", packagename);
+//                Log.e("Lib icon", "packagename: "+packagename );
+//                Log.e("Lib icon", "resid: "+resourceId );
                 Bitmap bitmap = BitmapFactory.decodeResource(ApexDriverApplication.sharedApplication().getResources(),resourceId);
+
+//                Log.e("Lib icon", "bmp size: "+bitmap.getWidth() );
                 return bitmap;
 
             } else {

+ 64 - 5
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/photoCell/PhotoModel.java

@@ -15,27 +15,72 @@ public class PhotoModel extends BasicObject {
     public String key;
     public String title;
     public boolean required;
-    public Object photos;
+    public Object photos=null;
 
-    public ArrayList<PhotoItemModel> photoArray;
+    public ArrayList<PhotoItemModel> photoArray;// = new ArrayList<PhotoItemModel>();
 
     private WeakReference<PhotoModelDelegate> mDelegate;
 
+//    public boolean invokeObjectSetter( Class type,String key,Object value) {
+//
+//
+//        String setter = "set" + toUpperCaseFirstOne(key);
+//        try {
+//
+//
+////            Class<?> myClassType = Class.forName(cls.getName());
+////            Class<?>[] types = new Class[] { File.class };
+////            Constructor<?> cons = myClassType.getConstructor(types);
+//
+//            Log.e("invokeObjectSetter", "settler: "+setter+" type "+type );
+//
+//            Class[] cArg = new Class[1];
+//            cArg[0] = type;
+//            Log.e("invokeObjectSetter", getClass().getName() );
+//            Method method = getClass().getMethod(setter,cArg);
+//            if (method != null) {
+//
+//                method.invoke(this,value);
+//
+//                return true;
+//            }
+//
+//        }
+//        catch(NoSuchMethodException e)
+//        {
+//            e.printStackTrace();
+//        }
+//        catch (Exception e) {
+////            dbgUtil.Logd("invokeSetter",e.getMessage());
+//            e.printStackTrace();
+//        }
+//
+//        return false;
+//    }
+
     public void setPhotos(Object photos) {
 
+        this.photos = photos;
+
+//        Log.e("photomodel", "PhotoModel setPhotos: " );
+
         ArrayList<PhotoItemModel> models = new ArrayList<>();
+//        Log.e("photomodel", "creste models arr" );
         if (photos == null) {
+//            Log.e("photomodel", "setPhotos: no photo input" );
             photoArray = models;
             return;
         }
 
         if (photos instanceof JSONArray) {
-
+//            Log.e("photomodel", "setPhotos: input photo is a json array" );
             int size = ((JSONArray) photos).length();
             for (int i = 0; i < size; i++) {
                 JSONObject item = ((JSONArray) photos).optJSONObject(i);
                 if (item != null) {
+//                    Log.e("photomodel", "setPhotos:photo item not null create..." );
                     PhotoItemModel model = new PhotoItemModel();
+//                    Log.e("photomodel", "create PhotoItemModel "+ (model!=null) );
                     model.setValuesForKeysWithJSON(item);
                     models.add(model);
                 }
@@ -56,9 +101,24 @@ public class PhotoModel extends BasicObject {
         }
     }
 
-    public ArrayList<PhotoItemModel> getPhotos() {
+    public Object getPhotos() {
+
+        return photos;
+//        ArrayList<PhotoItemModel> models = new ArrayList<>();
+//        if(photoArray==null)
+//            return models;
+//        for (PhotoItemModel model : photoArray) {
+//            if (!model.isEmpty()) {
+//                models.add(model);
+//            }
+//        }
+//        return models;
+    }
+    public ArrayList<PhotoItemModel> getPhotoArray() {
 
         ArrayList<PhotoItemModel> models = new ArrayList<>();
+        if(photoArray==null)
+            return models;
         for (PhotoItemModel model : photoArray) {
             if (!model.isEmpty()) {
                 models.add(model);
@@ -66,7 +126,6 @@ public class PhotoModel extends BasicObject {
         }
         return models;
     }
-
     public ArrayList<PhotoItemModel> getAllPhotoItem() {
         return photoArray;
     }

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

@@ -23,6 +23,7 @@ import android.provider.MediaStore;
 import android.support.v4.content.PermissionChecker;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.text.TextUtils;
+import android.text.format.DateFormat;
 import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
@@ -38,11 +39,10 @@ import com.usai.redant.apexdrivers.ApexDriverApplication;
 import com.usai.redant.apexdrivers.R;
 import com.usai.redant.apexdrivers.SaveInstanceHelper;
 import com.usai.redant.apexdrivers.base.BasicActivity;
-import com.usai.redant.rautils.zxing.codescanner.CaptureActivity;
 import com.usai.redant.apexdrivers.home.HomeFragment;
 import com.usai.redant.apexdrivers.network.Network;
 import com.usai.redant.apexdrivers.photoCell.PhotoItemModel;
-import com.usai.redant.apexdrivers.signature.SignatureActivity;
+import com.usai.redant.apexdrivers.signature.DriverThemeSignatureActivity;
 import com.usai.redant.apexdrivers.update.model.UpdateBaseModel;
 import com.usai.redant.apexdrivers.update.model.UpdateDateModel;
 import com.usai.redant.apexdrivers.update.model.UpdateImageBaseModel;
@@ -55,6 +55,7 @@ import com.usai.redant.rautils.receiver.RABroadcast;
 import com.usai.redant.rautils.utils.FileManager;
 import com.usai.redant.rautils.utils.ImageUtil;
 import com.usai.redant.rautils.utils.RAUtil;
+import com.usai.redant.rautils.zxing.codescanner.CaptureActivity;
 
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -66,7 +67,7 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.lang.ref.WeakReference;
-import java.text.SimpleDateFormat;
+//import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -77,6 +78,8 @@ import static com.usai.redant.apexdrivers.update.model.UpdateDateModel.DateModeD
 import static com.usai.redant.apexdrivers.update.model.UpdateDateModel.DateModeTime;
 import static com.usai.redant.rautils.utils.Network.RESULT_TRUE;
 
+//import com.usai.redant.apexdrivers.signature.SignatureActivity;
+
 public class UpdateActivity extends BasicActivity implements UpdateAdapter.UpdateAdapterDelegate {
 
     private final static String OrderIDKey = "OrderID";
@@ -743,7 +746,7 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
         if (mOrderType2 != null) {
             params.putString("orderType2",mOrderType2);
         }
-        if (ApexDriverApplication.sharedApplication().getRequiredLocation()) {
+        if (ApexDriverApplication.sharedApplication().getRequiredBackgroundLocation()) {
             Location location = ApexDriverApplication.sharedApplication().getCurrentLocation();
 
             String locationStr = null;
@@ -838,7 +841,7 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
                                 if (result == RESULT_TRUE) {
 
                                     boolean requiredLocation = json.optBoolean("requiredLocation");
-                                    ApexDriverApplication.sharedApplication().setRequiredLocation(requiredLocation);
+                                    ApexDriverApplication.sharedApplication().setRequiredBackgroundLocation(requiredLocation);
 
 //                                if (photoArr.size() > 0) {
 //                                    syncUploadPhotos(photoArr,json);
@@ -1027,8 +1030,11 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
         final ArrayList<UpdateImageBaseModel> photoArr = photos;
 
         Date currentTime = new Date();
-        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/YYYY HH:mm");
-        String dateString = formatter.format(currentTime);
+        String dateString=DateFormat.format(
+                "MM/dd/yyyy kk:mm",
+                currentTime.getTime()).toString();
+//        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/YYYY HH:mm");
+//        String dateString = formatter.format(currentTime);
 
         final String serial = json.optString("serial");
 
@@ -1275,7 +1281,7 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
         }
         mSignatueModel = model;
 
-        SignatureActivity.startSignature(this,REQUEST_SIGNATURE_CODE);
+        DriverThemeSignatureActivity.startSignature(this,REQUEST_SIGNATURE_CODE);
     }
 
     @Override
@@ -1370,7 +1376,11 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
     private File createImageFile() throws IOException
     {
         // Create an image file name
-        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
+
+        String timeStamp=DateFormat.format(
+                "MM/dd/yyyy kk:mm",
+                new Date().getTime()).toString();
+//        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmSS").format(new Date());
         String imageFileName = "JPEG_" + timeStamp + "_";
         String appName = RAUtil.getApplicationName(mCtx);
 
@@ -1463,6 +1473,9 @@ public class UpdateActivity extends BasicActivity implements UpdateAdapter.Updat
                             int restul = json.getInt("result");
                             if (restul == RESULT_TRUE) {
                                 activity.mEmptyView.setVisibility(View.GONE);
+
+                                boolean requiredLocation = json.optBoolean("requiredLocation");
+                                ApexDriverApplication.sharedApplication().setRequiredBackgroundLocation(requiredLocation);
                                 activity.handleJSON(json);
 
                             } else {

+ 10 - 9
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/update/UpdateAdapter.java

@@ -1,17 +1,12 @@
 package com.usai.redant.apexdrivers.update;
 
 import android.content.Context;
-import android.content.Intent;
 import android.telephony.PhoneNumberUtils;
 import android.text.Editable;
 import android.text.Spannable;
-import android.text.SpannableString;
 import android.text.Spanned;
-import android.text.TextPaint;
 import android.text.TextWatcher;
 import android.text.method.LinkMovementMethod;
-import android.text.style.ClickableSpan;
-import android.text.style.ForegroundColorSpan;
 import android.text.style.URLSpan;
 import android.text.util.Linkify;
 import android.util.Log;
@@ -21,20 +16,17 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.BaseExpandableListAdapter;
-import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.TextView;
 
-
 import com.google.i18n.phonenumbers.PhoneNumberMatch;
 import com.google.i18n.phonenumbers.PhoneNumberUtil;
 import com.usai.redant.apexdrivers.R;
 import com.usai.redant.apexdrivers.photoCell.PhotoCell;
 import com.usai.redant.apexdrivers.photoCell.PhotoCellDelegate;
 import com.usai.redant.apexdrivers.photoCell.PhotoItemModel;
-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;
@@ -50,7 +42,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.Locale;
 
-import static android.text.util.Linkify.PHONE_NUMBERS;
+//import com.usai.redant.apexdrivers.signature.SignatureActivity;
 
 public class UpdateAdapter extends BaseExpandableListAdapter {
 
@@ -255,17 +247,26 @@ public class UpdateAdapter extends BaseExpandableListAdapter {
             break;
             case UpdateBaseModel.UpdateTypeMultPhoto: {
 
+//                Log.e("update photo", "getChildView: ");
                 MultPhotoHolder holder;
                 PhotoCell cell = (PhotoCell)convertView;
                 if (cell == null) {
+//                    Log.e("update photo", "no cell ");
                     cell = PhotoCell.photoCell(mCtx);
+//                    Log.e("update photo", "create cell "+ (cell!=null));
                     holder = new MultPhotoHolder(cell);
+//                    Log.e("update photo", "create holder "+ (holder!=null));
                 } else {
+
+//                    Log.e("update photo", "set holder ");
                     holder = (MultPhotoHolder)cell.getTag();
                 }
                 convertView = cell;
 
                 UpdateMultPhotoModel photoModel = (UpdateMultPhotoModel)model;
+//                Log.e("update photo", "photoModel.getMapModel().photoArray.size()"+photoModel.getMapModel().photoArray.size() );;
+//                Log.e("update photo", "get model "+ (photoModel!=null));
+
                 holder.setModel(photoModel);
             }
             break;

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

@@ -98,6 +98,7 @@ public class UpdateBaseModel extends BasicObject {
 
     @Override
     public void setValuesForKeysWithJSON(JSONObject json) {
+//        Log.e("UpdateBaseModel", "setValuesForKeysWithJSON: " );
         super.setValuesForKeysWithJSON(json);
 
         if (autofill) {

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

@@ -1,9 +1,10 @@
 package com.usai.redant.apexdrivers.update.model;
 
+import android.text.format.DateFormat;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
-import java.text.SimpleDateFormat;
 import java.util.Date;
 
 public class UpdateDateModel extends UpdateBaseModel {
@@ -25,8 +26,14 @@ public class UpdateDateModel extends UpdateBaseModel {
     }
 
     private void updateDisplay() {
-        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
-        setDisplay(dateFormat.format(date));
+
+        String display_date=DateFormat.format(
+                format,
+                date.getTime()).toString();
+
+//        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
+//        setDisplay(dateFormat.format(date));
+        setDisplay(display_date);
     }
 
     public String getValue() {

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

@@ -3,7 +3,6 @@ package com.usai.redant.apexdrivers.update.model;
 import com.usai.redant.apexdrivers.photoCell.PhotoItemModel;
 import com.usai.redant.apexdrivers.photoCell.PhotoModel;
 
-import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.ArrayList;
@@ -14,6 +13,7 @@ public class UpdateMultPhotoModel extends UpdateBaseModel {
 
     @Override
     public void setValuesForKeysWithJSON(JSONObject json) {
+//        Log.e("UpdateMultPhotoModel", "setValuesForKeysWithJSON: " );
         super.setValuesForKeysWithJSON(json);
         mapModel.setValuesForKeysWithJSON(json);
     }
@@ -60,7 +60,7 @@ public class UpdateMultPhotoModel extends UpdateBaseModel {
     }
 
     public ArrayList<PhotoItemModel> getPhotos() {
-        return mapModel.getPhotos();
+        return mapModel.getPhotoArray();
     }
 
     public ArrayList<PhotoItemModel> getAllPhotos() {

BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-hdpi/ic_action_bar.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-hdpi/ic_action_bar_o.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-mdpi/ic_action_bar.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-mdpi/ic_action_bar_o.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-xhdpi/ic_action_bar.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-xhdpi/ic_action_bar_o.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-xxhdpi/ic_action_bar.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-xxhdpi/ic_action_bar_o.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-xxxhdpi/ic_action_bar.png


BIN
ApexDrivers/apexdriverslib/src/main/res/drawable-xxxhdpi/ic_action_bar_o.png


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

@@ -10,6 +10,7 @@
         android:id="@+id/root_container"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:background="@color/ApexDriverWhite"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"

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

@@ -2,7 +2,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
-     >
+    android:background="@color/ApexDriverWhite">
 
     <!-- Login progress -->
 
@@ -15,7 +15,7 @@
         android:layout_gravity="center"
         android:gravity="center_horizontal"
         android:orientation="vertical"
-        android:visibility="gone" >
+        android:visibility="gone">
 
         <ProgressBar
             style="?android:attr/progressBarStyleLarge"
@@ -50,13 +50,12 @@
         android:layout_height="wrap_content"
         android:layout_below="@id/tv_ver"
         android:layout_centerHorizontal="true"
-        android:layout_marginBottom="5dp"
         android:layout_marginLeft="16dp"
-        android:layout_marginRight="16dp"
         android:layout_marginTop="15dp"
+        android:layout_marginRight="16dp"
+        android:layout_marginBottom="5dp"
         android:scaleType="fitXY"
-        android:src="@drawable/driver_logo_0"
-        />
+        android:src="@drawable/driver_logo_0" />
 
     <!-- Login form -->
     <LinearLayout
@@ -65,7 +64,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_below="@id/login_logo"
-        android:orientation="vertical" >
+        android:orientation="vertical">
 
         <EditText
             android:id="@+id/user"
@@ -75,8 +74,8 @@
             android:inputType="textAutoComplete"
             android:maxLines="1"
             android:singleLine="true"
-            android:textColor="#000000"
-            android:text="" />
+            android:text=""
+            android:textColor="#000000" />
 
         <EditText
             android:id="@+id/password"
@@ -95,7 +94,7 @@
 
         <RelativeLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" >
+            android:layout_height="wrap_content">
 
             <CheckBox
                 android:id="@+id/cb_save"
@@ -110,14 +109,14 @@
                 android:id="@+id/sign_in_button"
                 android:layout_width="wrap_content"
                 android:layout_height="39dp"
-                android:layout_alignParentRight="true"
                 android:layout_alignParentTop="true"
+                android:layout_alignParentRight="true"
                 android:background="@drawable/btn_bg"
                 android:paddingLeft="32dp"
                 android:paddingRight="32dp"
-                android:textColor="@android:color/holo_blue_dark"
+                android:text="@string/action_sign_in_register"
                 android:textAllCaps="false"
-                android:text="@string/action_sign_in_register" />
+                android:textColor="@android:color/holo_blue_dark" />
 
         </RelativeLayout>
 

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

@@ -11,7 +11,8 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="1dp"
+
         android:scaleType="centerCrop"
-        />
+        android:src="@drawable/btn_add_photo" />
 
 </com.usai.redant.apexdrivers.photoCell.PhotoItemCell>

+ 1 - 1
ApexDrivers/apexdriverslib/src/main/res/values/styles.xml

@@ -27,7 +27,7 @@
 
     <style name="ApexDriverTheme" parent="Theme.AppCompat.Light.DarkActionBar">
 
-        <item name="android:windowBackground">@color/ApexDriverWhite</item>
+        <!--<item name="android:windowBackground">@color/ApexDriverWhite</item>-->
         <item name="colorPrimary">@color/ApexDriverOrange</item> <!--Action Bar-->
 
         <item name="colorPrimaryDark">@color/ApexDriverOrangeWhiteColor</item> <!--Status Bar-->