|
|
@@ -42,12 +42,13 @@ import com.usai.redant.raimage.Model.ManufactureListActivity;
|
|
|
import com.usai.redant.raimage.PhotoList.PhotoGridActivity;
|
|
|
import com.usai.redant.rautils.receiver.RABroadcast;
|
|
|
import com.usai.redant.rautils.signature.SignatureActivity;
|
|
|
+import com.usai.redant.rautils.utils.RAUtil;
|
|
|
import com.usai.redant.rautils.zxing.codescanner.CaptureActivity;
|
|
|
import com.usai.util.AES;
|
|
|
import com.usai.util.MD5;
|
|
|
import com.usai.util.Network;
|
|
|
-import com.usai.util.RAUtil;
|
|
|
import com.usai.util.dbgUtil;
|
|
|
+import com.usai.util.utils;
|
|
|
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
|
@@ -382,7 +383,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
Bundle task = new Bundle();
|
|
|
|
|
|
task.putString("path",path);
|
|
|
- task.putString("file",RAUtil.lastPathComponent(path));
|
|
|
+ task.putString("file",utils.lastPathComponent(path));
|
|
|
task.putString("url",RedAntApplication.active_address + Network.URL_UPLOAD);
|
|
|
|
|
|
String md5 = MD5.md5sum(path);
|
|
|
@@ -420,7 +421,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
Bundle task = new Bundle();
|
|
|
|
|
|
task.putString("path",signature);
|
|
|
- task.putString("file",RAUtil.lastPathComponent(signature));
|
|
|
+ task.putString("file",utils.lastPathComponent(signature));
|
|
|
task.putString("url",RedAntApplication.active_address + Network.URL_UPLOAD);
|
|
|
|
|
|
String md5 = MD5.md5sum(signature);
|
|
|
@@ -553,7 +554,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
Bundle task = new Bundle();
|
|
|
|
|
|
task.putString("path",path);
|
|
|
- task.putString("file",RAUtil.lastPathComponent(path));
|
|
|
+ task.putString("file",utils.lastPathComponent(path));
|
|
|
task.putString("url",RedAntApplication.active_address + Network.URL_UPLOAD);
|
|
|
|
|
|
String md5 = MD5.md5sum(path);
|
|
|
@@ -1206,7 +1207,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
String imageFileName = barcode_title + timeStamp +".jpg";
|
|
|
|
|
|
|
|
|
- File routedFile = RAUtil.routeBitmap(imgFile,imageFileName);
|
|
|
+ File routedFile = utils.routeBitmap(imgFile,imageFileName);
|
|
|
|
|
|
SharedPreferences preferences = RedAntApplication.getInstance().getSharedPreferences("UploadManager", 0);
|
|
|
boolean auto_compress = preferences.getBoolean("compress",true);
|
|
|
@@ -1249,9 +1250,25 @@ public class MainActivity extends AppCompatActivity
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- Bitmap scaled = Bitmap.createScaledBitmap(source, width, height, true);
|
|
|
+// Bitmap scaled = Bitmap.createScaledBitmap(source, width, height, true);
|
|
|
|
|
|
|
|
|
+ Bitmap scaled =RAUtil.scale_bmp(source,width,height);
|
|
|
+//debug
|
|
|
+
|
|
|
+// if(true) {
|
|
|
+// Matrix m = new Matrix();
|
|
|
+//
|
|
|
+// final int swidth = source.getWidth();
|
|
|
+// final int sheight = source.getHeight();
|
|
|
+// if (swidth != width || sheight != height) {
|
|
|
+// final float sx = width / (float) swidth;
|
|
|
+// final float sy = height / (float) sheight;
|
|
|
+// m.setScale(sx, sy);
|
|
|
+// }
|
|
|
+// boolean transformed = !m.rectStaysRect();
|
|
|
+// Log.d(TAG, "transformed: "+transformed);
|
|
|
+// }
|
|
|
|
|
|
String scalePath = path.replace(".jpg", "_scaled.jpg");
|
|
|
File scaleFile = new File(scalePath);
|
|
|
@@ -1265,7 +1282,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
|
|
|
String rotedpath = routedFile.getAbsolutePath();
|
|
|
routedFile.delete();
|
|
|
- RAUtil.updateGallery(rotedpath);
|
|
|
+ utils.updateGallery(rotedpath);
|
|
|
// scaleFile.renameTo(new File(path));
|
|
|
return scaleFile;
|
|
|
|
|
|
@@ -1548,7 +1565,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
|
|
|
|
|
|
// Log.d(TAG, "File:" + image.getAbsolutePath());
|
|
|
- RAUtil.updateGallery(photoFile.toString());
|
|
|
+ utils.updateGallery(photoFile.toString());
|
|
|
StartCamera();
|
|
|
// iPhotoCount++;
|
|
|
// super.onActivityResult(requestCode, resultCode, data);
|
|
|
@@ -1575,7 +1592,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
|
|
|
String photopath=photoFile.getAbsolutePath();
|
|
|
photoFile.delete();
|
|
|
- RAUtil.updateGallery(photopath);
|
|
|
+ utils.updateGallery(photopath);
|
|
|
TextView countTextView = (TextView) findViewById(R.id.tvPhotoCount);
|
|
|
if (newVersion) {
|
|
|
countTextView = this.countTextView;
|
|
|
@@ -1638,7 +1655,7 @@ public class MainActivity extends AppCompatActivity
|
|
|
|
|
|
if (mode.equals("POP")||mode.equals("Returns"))
|
|
|
{
|
|
|
- if(!RAUtil.isNumeric(pid))
|
|
|
+ if(!utils.isNumeric(pid))
|
|
|
{
|
|
|
|
|
|
new AlertDialog.Builder(MainActivity.this)
|