">
+ sessionView.showToast("发现新增照片");
+ sessionView.addNewPhoto(bean);
}
@Override
@@ -147,7 +147,7 @@ public class UploadActivity extends BaseActivity implements UploadContract.View |
||
| 147 | 147 |
sessionBean.lensmanId = Preferences.getInstance(this).getLensManId(); |
| 148 | 148 |
sessionBean.sessionDate=20160813; |
| 149 | 149 |
sessionBean.sessionSeq = new Random().nextInt(10000); |
| 150 |
- sessionBean.sessionId ="chengzhenyu_test"; |
|
| 150 |
+ sessionBean.sessionId ="chengzhenyu_test"+sessionBean.sessionSeq; |
|
| 151 | 151 |
Intent intent = new Intent(this, SessionActivity.class); |
| 152 | 152 |
intent.putExtra("session",sessionBean);
|
| 153 | 153 |
startActivity(intent); |
@@ -0,0 +1,16 @@ |
||
| 1 |
+package ai.pai.lensman.utils; |
|
| 2 |
+ |
|
| 3 |
+import android.os.Environment; |
|
| 4 |
+ |
|
| 5 |
+/** |
|
| 6 |
+ * Created by chengzhenyu on 2016/8/13. |
|
| 7 |
+ */ |
|
| 8 |
+public class Constants {
|
|
| 9 |
+ |
|
| 10 |
+ public static final String APP_ROOT_DIR = Environment.getExternalStorageDirectory() + "/lensman"; |
|
| 11 |
+ public static final String APP_IMAGE_DIR = APP_ROOT_DIR + "/image"; |
|
| 12 |
+ public static final String ORIGIN_DIR_NAME = "origin"; |
|
| 13 |
+ public static final String THUMBNAIL_DIR_NAME = "thumbnail"; |
|
| 14 |
+ public static final String TMP_DIR_NAME = "tmp"; |
|
| 15 |
+ |
|
| 16 |
+} |
@@ -0,0 +1,40 @@ |
||
| 1 |
+package ai.pai.lensman.utils; |
|
| 2 |
+ |
|
| 3 |
+import android.graphics.Bitmap; |
|
| 4 |
+import android.widget.ImageView; |
|
| 5 |
+ |
|
| 6 |
+import com.nostra13.universalimageloader.core.DisplayImageOptions; |
|
| 7 |
+import com.nostra13.universalimageloader.core.ImageLoader; |
|
| 8 |
+import com.nostra13.universalimageloader.core.assist.ImageScaleType; |
|
| 9 |
+import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; |
|
| 10 |
+ |
|
| 11 |
+public class ImageLoaderUtils {
|
|
| 12 |
+ |
|
| 13 |
+ /** |
|
| 14 |
+ * display local image |
|
| 15 |
+ * @param uri |
|
| 16 |
+ * @param imageView |
|
| 17 |
+ * @param options |
|
| 18 |
+ */ |
|
| 19 |
+ public static void displayLocalImage(String uri, ImageView imageView, DisplayImageOptions options) {
|
|
| 20 |
+ ImageLoader.getInstance().displayImage("file://" + uri, new ImageViewAware(imageView), options, null, null);
|
|
| 21 |
+ } |
|
| 22 |
+ |
|
| 23 |
+ /** |
|
| 24 |
+ * display Drawable image |
|
| 25 |
+ * @param uri |
|
| 26 |
+ * @param imageView |
|
| 27 |
+ * @param options |
|
| 28 |
+ */ |
|
| 29 |
+ public static void displayDrawableImage(String uri, ImageView imageView, DisplayImageOptions options) {
|
|
| 30 |
+ ImageLoader.getInstance().displayImage("drawable://" + uri, new ImageViewAware(imageView), options, null, null);
|
|
| 31 |
+ } |
|
| 32 |
+ |
|
| 33 |
+ public static DisplayImageOptions getOptions(int drawable) {
|
|
| 34 |
+ return new DisplayImageOptions.Builder() |
|
| 35 |
+ .showImageForEmptyUri(drawable).showImageOnFail(drawable) |
|
| 36 |
+ .cacheInMemory(true).cacheOnDisk(true).considerExifParams(true) |
|
| 37 |
+ .bitmapConfig(Bitmap.Config.RGB_565).imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2).build(); |
|
| 38 |
+ } |
|
| 39 |
+ |
|
| 40 |
+} |