From e5ba6df086f358582f608d9d28b04a72368a0afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=93=E4=B8=80=E6=96=87?= <35919502@qq.com> Date: Tue, 23 Jan 2018 14:06:46 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easyPhotos/src/main/res/drawable/ic_selector_easy_photos.xml | 4 ++-- .../src/main/res/drawable/ic_selector_true_easy_photos.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/easyPhotos/src/main/res/drawable/ic_selector_easy_photos.xml b/easyPhotos/src/main/res/drawable/ic_selector_easy_photos.xml index 8978fea1..7875efd0 100644 --- a/easyPhotos/src/main/res/drawable/ic_selector_easy_photos.xml +++ b/easyPhotos/src/main/res/drawable/ic_selector_easy_photos.xml @@ -1,6 +1,6 @@ Date: Tue, 23 Jan 2018 14:52:25 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easyPhotos/src/main/res/drawable/bg_select_true_easy_photos.xml | 2 +- easyPhotos/src/main/res/layout/activity_easy_photos.xml | 2 +- easyPhotos/src/main/res/layout/activity_preview_easy_photos.xml | 2 +- .../main/res/layout/activity_puzzle_selector_easy_photos.xml | 2 +- easyPhotos/src/main/res/layout/item_rv_photos_easy_photos.xml | 2 +- easyPhotos/src/main/res/values/colors.xml | 2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/easyPhotos/src/main/res/drawable/bg_select_true_easy_photos.xml b/easyPhotos/src/main/res/drawable/bg_select_true_easy_photos.xml index e94e5931..3c115bcc 100644 --- a/easyPhotos/src/main/res/drawable/bg_select_true_easy_photos.xml +++ b/easyPhotos/src/main/res/drawable/bg_select_true_easy_photos.xml @@ -3,6 +3,6 @@ + android:color="@color/menu_text_easy_photos" /> \ No newline at end of file diff --git a/easyPhotos/src/main/res/layout/activity_easy_photos.xml b/easyPhotos/src/main/res/layout/activity_easy_photos.xml index f531c029..a07d44ed 100644 --- a/easyPhotos/src/main/res/layout/activity_easy_photos.xml +++ b/easyPhotos/src/main/res/layout/activity_easy_photos.xml @@ -226,7 +226,7 @@ android:background="@drawable/bg_menu_done_easy_photos" android:gravity="center" android:padding="6dp" - android:textColor="@color/white_easy_photos" + android:textColor="@color/menu_text_easy_photos" android:textSize="12sp" android:textStyle="bold" android:visibility="invisible" diff --git a/easyPhotos/src/main/res/layout/activity_preview_easy_photos.xml b/easyPhotos/src/main/res/layout/activity_preview_easy_photos.xml index 46557127..e700607a 100644 --- a/easyPhotos/src/main/res/layout/activity_preview_easy_photos.xml +++ b/easyPhotos/src/main/res/layout/activity_preview_easy_photos.xml @@ -77,7 +77,7 @@ android:gravity="center" android:maxWidth="200dp" android:padding="6dp" - android:textColor="@color/white_easy_photos" + android:textColor="@color/menu_text_easy_photos" android:textSize="12sp" android:textStyle="bold" /> diff --git a/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml b/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml index e20f5bfd..4f251b07 100644 --- a/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml +++ b/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml @@ -62,7 +62,7 @@ android:gravity="center" android:onClick="onClick" android:padding="6dp" - android:textColor="@color/white_easy_photos" + android:textColor="@color/menu_text_easy_photos" android:textSize="12sp" android:textStyle="bold" android:visibility="invisible" /> diff --git a/easyPhotos/src/main/res/layout/item_rv_photos_easy_photos.xml b/easyPhotos/src/main/res/layout/item_rv_photos_easy_photos.xml index bcd329fb..53036b05 100644 --- a/easyPhotos/src/main/res/layout/item_rv_photos_easy_photos.xml +++ b/easyPhotos/src/main/res/layout/item_rv_photos_easy_photos.xml @@ -24,7 +24,7 @@ android:layout_margin="8dp" android:background="@drawable/bg_select_true_easy_photos" android:gravity="center" - android:textColor="@color/white_easy_photos" + android:textColor="@color/menu_text_easy_photos" android:textSize="12sp" android:textStyle="bold" app:layout_constraintRight_toRightOf="parent" diff --git a/easyPhotos/src/main/res/values/colors.xml b/easyPhotos/src/main/res/values/colors.xml index 8186a64a..df22dd95 100644 --- a/easyPhotos/src/main/res/values/colors.xml +++ b/easyPhotos/src/main/res/values/colors.xml @@ -3,6 +3,8 @@ #303135 #00000000 #FFFFFF + #FFFFFF//按钮上的文字颜色,选择器上的文字颜色,选择器的边框颜色 + #FFFFFF//专辑项目列表的背景颜色 From 0412cd895c818268607cf490ad0b5fe320f90d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=93=E4=B8=80=E6=96=87?= <35919502@qq.com> Date: Fri, 26 Jan 2018 15:40:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8B=BC=E5=9B=BE?= =?UTF-8?q?=E6=96=87=E5=AD=97=E8=B4=B4=E7=BA=B8=E6=96=87=E5=AD=97=E5=9C=A8?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=90=8E=E4=BE=9D=E7=84=B6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E7=9A=84=E5=8F=AF=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/sticker/StickerModel.java | 12 ++++++++++ .../easyphotos/ui/adapter/PhotosAdapter.java | 2 +- easyPhotos/src/main/res/values/colors.xml | 24 +++++++++---------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/sticker/StickerModel.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/sticker/StickerModel.java index 0d178d7c..7e74eb5f 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/sticker/StickerModel.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/sticker/StickerModel.java @@ -129,6 +129,18 @@ public void save(Activity act, ViewGroup stickerGroup, View imageGroup, int imag this.currTextSticker.setUsing(false); } + for (BitmapSticker bs : bitmapStickers) { + if (bs.isUsing()) { + bs.setUsing(false); + } + } + + for (TextSticker ts : textStickers) { + if (ts.isUsing()) { + ts.setUsing(false); + } + } + Bitmap srcBitmap = Bitmap.createBitmap(stickerGroup.getWidth(), stickerGroup.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(srcBitmap); stickerGroup.draw(canvas); diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/adapter/PhotosAdapter.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/adapter/PhotosAdapter.java index 3e5d3ce7..e7882e9f 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/adapter/PhotosAdapter.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/adapter/PhotosAdapter.java @@ -189,7 +189,7 @@ private void updateSelector(TextView tvSelector, boolean selected, Photo photo, tvSelector.setBackgroundResource(R.drawable.bg_select_true_easy_photos); if (isSingle) { singlePosition = position; - tvSelector.setText("✔"); + tvSelector.setText("1"); } } else { if (unable) { diff --git a/easyPhotos/src/main/res/values/colors.xml b/easyPhotos/src/main/res/values/colors.xml index df22dd95..c027757a 100644 --- a/easyPhotos/src/main/res/values/colors.xml +++ b/easyPhotos/src/main/res/values/colors.xml @@ -13,18 +13,18 @@ - #d0021b - #f5a623 - #f8e71c - #7ed321 - #50e3c2 - #4a90e2 - #9013fe - #000000 - #4a4a4a - #ffffff - #2c2e30 - #393a3f + #d0021b//编辑字体颜色为红色 + #f5a623//编辑字体颜色为橙色 + #f8e71c//编辑字体颜色为黄色 + #7ed321//编辑字体颜色为绿色 + #50e3c2//编辑字体颜色为青色 + #4a90e2//编辑字体颜色为蓝色 + #9013fe//编辑字体颜色为紫色 + #000000//编辑字体颜色为黑色 + #4a4a4a//编辑字体颜色为灰色 + #ffffff//编辑字体颜色为白色 + #2c2e30//编辑界面背景色 + #393a3f//编辑界面操作栏颜色 From d702b093a2aef16625dddeffb44dce1981611f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=93=E4=B8=80=E6=96=87?= <35919502@qq.com> Date: Fri, 26 Jan 2018 17:04:39 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../easyphotos/models/album/AlbumModel.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java index bf2feb7e..7cb58375 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java @@ -74,15 +74,16 @@ private void initAlbum(Activity act) { Uri contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; - String sortOrder = MediaStore.Images.Media.DATE_ADDED + " DESC"; + String sortOrder = MediaStore.Images.Media.DATE_TAKEN + " DESC"; ContentResolver contentResolver = act.getContentResolver(); String[] projections = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { projections = new String[]{ + MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DISPLAY_NAME, - MediaStore.Images.Media.DATE_ADDED, + MediaStore.Images.Media.DATE_TAKEN, MediaStore.Images.Media.MIME_TYPE, MediaStore.Images.Media.WIDTH, MediaStore.Images.Media.HEIGHT, @@ -90,9 +91,10 @@ private void initAlbum(Activity act) { } else { projections = new String[]{ + MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.Media.DISPLAY_NAME, - MediaStore.Images.Media.DATE_ADDED, + MediaStore.Images.Media.DATE_TAKEN, MediaStore.Images.Media.MIME_TYPE, MediaStore.Images.Media.SIZE}; } @@ -103,7 +105,7 @@ private void initAlbum(Activity act) { String albumItem_all_name = act.getString(R.string.selector_folder_all_easy_photos); int pathCol = cursor.getColumnIndex(MediaStore.Images.Media.DATA); int nameCol = cursor.getColumnIndex(MediaStore.Images.Media.DISPLAY_NAME); - int DateCol = cursor.getColumnIndex(MediaStore.Images.Media.DATE_ADDED); + int DateCol = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); int mimeType = cursor.getColumnIndex(MediaStore.Images.Media.MIME_TYPE); int sizeCol = cursor.getColumnIndex(MediaStore.Images.Media.SIZE); int WidthCol = 0; From 031d6e322821d59976e3ee2263f663605c3fc9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=93=E4=B8=80=E6=96=87?= <35919502@qq.com> Date: Tue, 30 Jan 2018 16:54:15 +0800 Subject: [PATCH 5/6] 2.2.9 --- .../easyphotos/models/album/AlbumModel.java | 11 ++-- .../easyphotos/ui/EasyPhotosActivity.java | 31 ++++++----- .../easyphotos/ui/PreviewActivity.java | 1 + .../easyphotos/ui/PuzzleSelectorActivity.java | 5 ++ .../ui/widget/PressedImageView.java | 20 +++---- .../main/res/layout/activity_easy_photos.xml | 52 +++++++++---------- .../layout/activity_preview_easy_photos.xml | 1 - .../activity_puzzle_selector_easy_photos.xml | 5 -- sample/build.gradle | 7 ++- sample/src/main/AndroidManifest.xml | 1 + .../easyphotos/sample/MyApplication.java | 23 ++++++++ 11 files changed, 94 insertions(+), 63 deletions(-) create mode 100644 sample/src/main/java/com/huantansheng/easyphotos/sample/MyApplication.java diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java index 7cb58375..1010ada1 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/AlbumModel.java @@ -29,17 +29,17 @@ public class AlbumModel { private static final String TAG = "AlbumModel"; public static AlbumModel instance; public Album album; - private CallBack callBack; + /** * AlbumModel构造方法 + * * @param act 调用专辑的活动实体类 * @param callBack 初始化全部专辑后的回调 */ private AlbumModel(final Activity act, AlbumModel.CallBack callBack) { album = new Album(); - this.callBack = callBack; - init(act); + init(act, callBack); } public static AlbumModel getInstance(final Activity act, AlbumModel.CallBack callBack) { @@ -57,12 +57,13 @@ public static void clear() { instance = null; } - private void init(final Activity act) { + private void init(final Activity act, final CallBack callBack) { new Thread(new Runnable() { @Override public void run() { initAlbum(act); - callBack.onAlbumWorkedCallBack(); + if (null != callBack) + callBack.onAlbumWorkedCallBack(); } }).start(); } diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/EasyPhotosActivity.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/EasyPhotosActivity.java index c24f1e4c..f0e3133c 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/EasyPhotosActivity.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/EasyPhotosActivity.java @@ -7,7 +7,6 @@ import android.animation.ObjectAnimator; import android.app.Activity; import android.content.Intent; -import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Build; @@ -61,7 +60,7 @@ import java.util.Date; import java.util.Locale; -public class EasyPhotosActivity extends AppCompatActivity implements AlbumModel.CallBack, AlbumItemsAdapter.OnClickListener, PhotosAdapter.OnClickListener, AdListener, View.OnClickListener { +public class EasyPhotosActivity extends AppCompatActivity implements AlbumItemsAdapter.OnClickListener, PhotosAdapter.OnClickListener, AdListener, View.OnClickListener { private boolean isShowCamera, onlyStartCamera; @@ -97,6 +96,8 @@ public class EasyPhotosActivity extends AppCompatActivity implements AlbumModel. private TextView tvPermission; private View mBottomBar; + AlbumModel.CallBack albumModelCallBack; + public static void start(Activity activity, int requestCode) { Intent intent = new Intent(activity, EasyPhotosActivity.class); activity.startActivityForResult(intent, requestCode); @@ -118,7 +119,7 @@ protected void onCreate(Bundle savedInstanceState) { permissionView = (RelativeLayout) findViewById(R.id.rl_permissions_view); tvPermission = (TextView) findViewById(R.id.tv_permission); rootViewAlbumItems = (RelativeLayout) findViewById(R.id.root_view_album_items); - + setClick(R.id.iv_back); if (PermissionUtil.checkAndRequestPermissionsInActivity(this, getNeedPermissions())) { hasPermissions(); } @@ -132,7 +133,18 @@ private void hasPermissions() { } permissionView.setVisibility(View.GONE); AlbumModel.clear(); - albumModel = AlbumModel.getInstance(this, this); + albumModelCallBack = new AlbumModel.CallBack() { + @Override + public void onAlbumWorkedCallBack() { + runOnUiThread(new Runnable() { + @Override + public void run() { + onAlbumWorkedDo(); + } + }); + } + }; + albumModel = AlbumModel.getInstance(this, albumModelCallBack); } protected String[] getNeedPermissions() { @@ -395,15 +407,6 @@ private void onCameraResult() { } - @Override - public void onAlbumWorkedCallBack() { - runOnUiThread(new Runnable() { - @Override - public void run() { - onAlbumWorkedDo(); - } - }); - } private void onAlbumWorkedDo() { initView(); @@ -468,7 +471,7 @@ public int getSpanSize(int position) { initAlbumItems(); shouldShowMenuDone(); - setClick(R.id.tv_album_items, R.id.iv_album_items, R.id.root_view_album_items, R.id.iv_back, R.id.tv_done, R.id.tv_clear, R.id.tv_original, R.id.tv_preview, R.id.fab_camera, R.id.iv_second_menu, R.id.tv_puzzle); + setClick(R.id.tv_album_items, R.id.iv_album_items, R.id.root_view_album_items, R.id.tv_done, R.id.tv_clear, R.id.tv_original, R.id.tv_preview, R.id.fab_camera, R.id.iv_second_menu, R.id.tv_puzzle); } diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PreviewActivity.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PreviewActivity.java index 92aa2d4b..1f38e67f 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PreviewActivity.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PreviewActivity.java @@ -206,6 +206,7 @@ private void doBack() { } private void initView() { + findViewById(R.id.iv_back).setOnClickListener(this); mRootView = (FrameLayout) findViewById(R.id.m_root_view); mToolBar = (FrameLayout) findViewById(R.id.m_top_bar_layout); if (!SystemUtils.getInstance().hasNavigationBar(this)) { diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PuzzleSelectorActivity.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PuzzleSelectorActivity.java index 7198e311..87f122e9 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PuzzleSelectorActivity.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/PuzzleSelectorActivity.java @@ -76,10 +76,13 @@ protected void onCreate(Bundle savedInstanceState) { } private void initView() { + setClick(R.id.iv_back); tvAlbumItems = (PressedTextView) findViewById(R.id.tv_album_items); tvAlbumItems.setText(albumModel.getAlbumItems().get(0).name); rootSelectorView = (RelativeLayout) findViewById(R.id.m_selector_root); tvDone = (PressedTextView) findViewById(R.id.tv_done); + tvDone.setOnClickListener(this); + tvAlbumItems.setOnClickListener(this); initAlbumItems(); initPhotos(); initPreview(); @@ -109,6 +112,8 @@ private void initPhotos() { private void initAlbumItems() { rootViewAlbumItems = (RelativeLayout) findViewById(R.id.root_view_album_items); + rootViewAlbumItems.setOnClickListener(this); + setClick(R.id.iv_album_items); rvAlbumItems = (RecyclerView) findViewById(R.id.rv_album_items); LinearLayoutManager lm = new LinearLayoutManager(this); ArrayList list = new ArrayList(); diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/widget/PressedImageView.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/widget/PressedImageView.java index 3ae3ea59..e55771cd 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/widget/PressedImageView.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/ui/widget/PressedImageView.java @@ -1,8 +1,6 @@ package com.huantansheng.easyphotos.ui.widget; import android.content.Context; -import android.graphics.Color; -import android.graphics.PorterDuff; import android.support.annotation.Nullable; import android.util.AttributeSet; @@ -12,22 +10,22 @@ */ public class PressedImageView extends android.support.v7.widget.AppCompatImageView { - private int filterColor;//按压颜色 + private float scaleSize;//按压颜色 public PressedImageView(Context context) { super(context); - this.filterColor = Color.GRAY; + this.scaleSize = 0.97f; } public PressedImageView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); - this.filterColor = Color.GRAY; + this.scaleSize = 0.97f; } public PressedImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - this.filterColor = Color.GRAY; + this.scaleSize = 0.97f; } @@ -35,13 +33,15 @@ public PressedImageView(Context context, @Nullable AttributeSet attrs, int defSt public void setPressed(boolean pressed) { super.setPressed(pressed); if (isPressed()) { - setColorFilter(filterColor, PorterDuff.Mode.MULTIPLY); + setScaleX(this.scaleSize); + setScaleY(this.scaleSize); } else { - clearColorFilter(); + setScaleX(1.0f); + setScaleY(1.0f); } } - public void setPressedColor(int pressedColor) { - filterColor = pressedColor; + public void setScaleSize(float scaleSize) { + this.scaleSize = scaleSize; } } diff --git a/easyPhotos/src/main/res/layout/activity_easy_photos.xml b/easyPhotos/src/main/res/layout/activity_easy_photos.xml index a07d44ed..871518e7 100644 --- a/easyPhotos/src/main/res/layout/activity_easy_photos.xml +++ b/easyPhotos/src/main/res/layout/activity_easy_photos.xml @@ -27,6 +27,32 @@ app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/m_tool_bar_bottom_line" /> + + + + + + - - - - - diff --git a/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml b/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml index 4f251b07..9552b598 100644 --- a/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml +++ b/easyPhotos/src/main/res/layout/activity_puzzle_selector_easy_photos.xml @@ -60,7 +60,6 @@ android:layout_marginRight="8dp" android:background="@drawable/bg_menu_done_easy_photos" android:gravity="center" - android:onClick="onClick" android:padding="6dp" android:textColor="@color/menu_text_easy_photos" android:textSize="12sp" @@ -81,7 +80,6 @@ android:layout_width="0dp" android:layout_height="0dp" android:background="@color/easy_photos_bar_primary_translation" - android:onClick="onClick" android:paddingEnd="8dp" android:paddingLeft="8dp" android:paddingRight="8dp" @@ -109,7 +107,6 @@ android:layout_height="0dp" android:gravity="center" android:minWidth="70dp" - android:onClick="onClick" android:paddingEnd="6dp" android:paddingLeft="16dp" android:paddingRight="6dp" @@ -123,7 +120,6 @@ android:id="@+id/iv_album_items" android:layout_width="wrap_content" android:layout_height="0dp" - android:onClick="onClick" android:paddingTop="8dp" app:layout_constraintBottom_toBottomOf="@+id/tv_album_items" app:layout_constraintLeft_toRightOf="@+id/tv_album_items" @@ -153,7 +149,6 @@ android:id="@+id/iv_back" android:layout_width="42dp" android:layout_height="42dp" - android:onClick="onClick" android:padding="10dp" app:layout_constraintLeft_toLeftOf="@+id/m_tool_bar" app:layout_constraintTop_toTopOf="@+id/m_tool_bar" diff --git a/sample/build.gradle b/sample/build.gradle index b730c9d4..7b85245e 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.huantansheng.easyphotos.sample" minSdkVersion 15 targetSdkVersion 27 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.0.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -37,4 +37,7 @@ dependencies { exclude group: "com.android.support" } annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0' + //检测内存泄漏 + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' } diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 59f48629..bfaf4d39 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ Date: Tue, 30 Jan 2018 17:08:54 +0800 Subject: [PATCH 6/6] 2.2.9 --- .../com/huantansheng/easyphotos/models/album/entity/Photo.java | 2 +- .../java/com/huantansheng/easyphotos/sample/MainAdapter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/entity/Photo.java b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/entity/Photo.java index 3f644a34..528d0f0c 100644 --- a/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/entity/Photo.java +++ b/easyPhotos/src/main/java/com/huantansheng/easyphotos/models/album/entity/Photo.java @@ -17,7 +17,7 @@ public class Photo implements Parcelable { public int width;//图片宽度 public int height;//图片高度 public long size;//图片文件大小,单位:Bytes - public long time;//图片最后修改时间戳,单位:秒 + public long time;//图片拍摄的时间戳,单位:毫秒 public boolean selected;//是否被选中,内部使用,无需关心 public boolean selectedOriginal;//用户选择时是否选择了原图选项 diff --git a/sample/src/main/java/com/huantansheng/easyphotos/sample/MainAdapter.java b/sample/src/main/java/com/huantansheng/easyphotos/sample/MainAdapter.java index 5d047c61..a01a3a66 100644 --- a/sample/src/main/java/com/huantansheng/easyphotos/sample/MainAdapter.java +++ b/sample/src/main/java/com/huantansheng/easyphotos/sample/MainAdapter.java @@ -38,7 +38,7 @@ public MainVH onCreateViewHolder(ViewGroup parent, int viewType) { public void onBindViewHolder(MainVH holder, int position) { Photo photo = list.get(position); mGlide.load(photo.path).into(holder.ivPhoto); - holder.tvMessage.setText("[图片名称]: "+photo.name+"\n[宽]:"+photo.width+"\n[高]:"+photo.height+"\n[文件大小,单位bytes]:"+photo.size+"\n[日期,时间戳,秒]:"+photo.time+"\n[图片地址]:"+photo.path+"\n[图片类型]:"+photo.type+"\n[是否选择原图]:"+photo.selectedOriginal); + holder.tvMessage.setText("[图片名称]: "+photo.name+"\n[宽]:"+photo.width+"\n[高]:"+photo.height+"\n[文件大小,单位bytes]:"+photo.size+"\n[日期,时间戳,毫秒]:"+photo.time+"\n[图片地址]:"+photo.path+"\n[图片类型]:"+photo.type+"\n[是否选择原图]:"+photo.selectedOriginal); } @Override