├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── mipmap-xhdpi │ │ │ ├── add_icon.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── menu │ │ │ └── menu_pop.xml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ └── item_img.xml │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ └── drawable │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ └── com │ │ │ └── giftedcat │ │ │ └── dynamic │ │ │ ├── listener │ │ │ └── OnAddPicturesListener.java │ │ │ ├── activity │ │ │ └── BaseActivity.java │ │ │ ├── MainActivity.java │ │ │ └── adapter │ │ │ └── NineGridAdapter.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── pictureLibrary ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── public.xml │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── styles.xml │ │ │ ├── strings.xml │ │ │ └── attrs.xml │ │ ├── drawable-xxhdpi │ │ │ ├── mis_asv.png │ │ │ ├── mis_asy.png │ │ │ ├── mis_btn_selected.png │ │ │ ├── mis_default_check.png │ │ │ ├── mis_default_error.png │ │ │ ├── mis_btn_unselected.png │ │ │ └── mis_text_indicator.png │ │ ├── drawable │ │ │ ├── ic_empty_photo.png │ │ │ └── mis_action_btn.xml │ │ ├── drawable-xhdpi │ │ │ ├── mis_btn_back.png │ │ │ ├── mis_ic_menu_back.png │ │ │ ├── mis_default_check_s.png │ │ │ └── mis_selector_indicator.png │ │ ├── mipmap-xhdpi │ │ │ └── banner_default.png │ │ ├── color │ │ │ ├── mis_default_text_color.xml │ │ │ └── mis_folder_text_color.xml │ │ └── layout │ │ │ ├── mis_list_item_camera.xml │ │ │ ├── mis_list_item_image.xml │ │ │ ├── mis_activity_default.xml │ │ │ ├── mis_cmp_customer_actionbar.xml │ │ │ ├── mis_fragment_multi_image.xml │ │ │ └── mis_list_item_folder.xml │ │ ├── java │ │ └── com │ │ │ └── giftedcat │ │ │ └── picture │ │ │ └── lib │ │ │ ├── selector │ │ │ ├── Explain.java │ │ │ ├── bean │ │ │ │ ├── Folder.java │ │ │ │ └── Image.java │ │ │ ├── view │ │ │ │ ├── SquareFrameLayout.java │ │ │ │ └── SquaredImageView.java │ │ │ ├── utils │ │ │ │ ├── TimeUtils.java │ │ │ │ ├── ScreenUtils.java │ │ │ │ └── PermissionUtils.java │ │ │ ├── MultiImageSelector.java │ │ │ ├── adapter │ │ │ │ ├── FolderAdapter.java │ │ │ │ └── ImageGridAdapter.java │ │ │ └── MultiImageSelectorActivity.java │ │ │ ├── photoview │ │ │ ├── Explain.java │ │ │ ├── style │ │ │ │ ├── IIndexIndicator.java │ │ │ │ ├── IProgressIndicator.java │ │ │ │ ├── index │ │ │ │ │ ├── NumberIndexIndicator.java │ │ │ │ │ └── CircleIndexIndicator.java │ │ │ │ └── progress │ │ │ │ │ ├── ProgressBarIndicator.java │ │ │ │ │ └── ProgressPieIndicator.java │ │ │ ├── view │ │ │ │ ├── image │ │ │ │ │ ├── PhotoInfo.java │ │ │ │ │ └── RotateGestureDetector.java │ │ │ │ └── indicator │ │ │ │ │ ├── NumberIndicator.java │ │ │ │ │ └── CircleIndicator.java │ │ │ ├── loader │ │ │ │ └── ImageLoader.java │ │ │ ├── transfer │ │ │ │ ├── TransferAdapter.java │ │ │ │ ├── LocalThumbState.java │ │ │ │ ├── RemoteThumbState.java │ │ │ │ ├── EmptyThumbState.java │ │ │ │ ├── TransferState.java │ │ │ │ ├── DragCloseGesture.java │ │ │ │ ├── Transferee.java │ │ │ │ └── TransferLayout.java │ │ │ └── GlideImageLoader.java │ │ │ └── PictureUseHelpr.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── encodings.xml ├── vcs.xml ├── misc.xml ├── runConfigurations.xml └── gradle.xml ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /pictureLibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':pictureLibrary' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DynamicPublishing 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/add_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xhdpi/add_icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/values/public.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_asv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_asv.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_asy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_asy.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable/ic_empty_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable/ic_empty_photo.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xhdpi/mis_btn_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xhdpi/mis_btn_back.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/mipmap-xhdpi/banner_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/mipmap-xhdpi/banner_default.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #21282C 5 | 6 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xhdpi/mis_ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xhdpi/mis_ic_menu_back.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_btn_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_btn_selected.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_default_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_default_check.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_default_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_default_error.png -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_pop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xhdpi/mis_default_check_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xhdpi/mis_default_check_s.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_btn_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_btn_unselected.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xxhdpi/mis_text_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xxhdpi/mis_text_indicator.png -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable-xhdpi/mis_selector_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Giftedcat/DynamicPublishing/HEAD/pictureLibrary/src/main/res/drawable-xhdpi/mis_selector_indicator.png -------------------------------------------------------------------------------- /app/src/main/java/com/giftedcat/dynamic/listener/OnAddPicturesListener.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.dynamic.listener; 2 | 3 | public interface OnAddPicturesListener { 4 | 5 | void onAdd(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/Explain.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector; 2 | 3 | /** 4 | * 使用说明:图片选择 5 | * */ 6 | public class Explain { 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/photoview/Explain.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.photoview; 2 | 3 | /** 4 | * 使用说明:大图显示 5 | * */ 6 | public class Explain { 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 120dp 4 | 2dp 5 | 72dp 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 26 14:06:20 CST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/color/mis_default_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/color/mis_folder_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/bean/Folder.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.bean; 2 | 3 | import android.text.TextUtils; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 文件夹 9 | * Created by Nereo on 2015/4/7. 10 | */ 11 | public class Folder { 12 | public String name; 13 | public String path; 14 | public Image cover; 15 | public List images; 16 | 17 | @Override 18 | public boolean equals(Object o) { 19 | try { 20 | Folder other = (Folder) o; 21 | return TextUtils.equals(other.path, path); 22 | }catch (ClassCastException e){ 23 | e.printStackTrace(); 24 | } 25 | return super.equals(o); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/layout/mis_list_item_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 16 | 17 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/view/SquareFrameLayout.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.FrameLayout; 6 | 7 | /** 8 | * Created by nereo on 15/11/10. 9 | */ 10 | public class SquareFrameLayout extends FrameLayout{ 11 | public SquareFrameLayout(Context context) { 12 | super(context); 13 | } 14 | 15 | public SquareFrameLayout(Context context, AttributeSet attrs) { 16 | super(context, attrs); 17 | } 18 | 19 | @Override 20 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 21 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 22 | setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/bean/Image.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.bean; 2 | 3 | import android.text.TextUtils; 4 | 5 | /** 6 | * 图片实体 7 | * Created by Nereo on 2015/4/7. 8 | */ 9 | public class Image { 10 | public String path; 11 | public String name; 12 | public long time; 13 | 14 | public Image(String path, String name, long time){ 15 | this.path = path; 16 | this.name = name; 17 | this.time = time; 18 | } 19 | 20 | @Override 21 | public boolean equals(Object o) { 22 | try { 23 | Image other = (Image) o; 24 | return TextUtils.equals(this.path, other.path); 25 | }catch (ClassCastException e){ 26 | e.printStackTrace(); 27 | } 28 | return super.equals(o); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/view/SquaredImageView.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | 6 | import androidx.appcompat.widget.AppCompatImageView; 7 | 8 | /** An image view which always remains square with respect to its width. */ 9 | class SquaredImageView extends AppCompatImageView { 10 | public SquaredImageView(Context context) { 11 | super(context); 12 | } 13 | 14 | public SquaredImageView(Context context, AttributeSet attrs) { 15 | super(context, attrs); 16 | } 17 | 18 | @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 19 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 20 | setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pictureLibrary/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/photoview/style/IIndexIndicator.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.photoview.style; 2 | 3 | import android.widget.FrameLayout; 4 | 5 | import androidx.viewpager.widget.ViewPager; 6 | 7 | /** 8 | * 图片索引指示器接口,实现 IIndexIndicator 可扩展自己的图片指示器组件 9 | *

10 | * email: 196425254@qq.com 11 | */ 12 | public interface IIndexIndicator { 13 | 14 | /** 15 | * 在父容器上添加一个图片索引指示器 UI 组件 16 | * 17 | * @param parent TransferImage 18 | */ 19 | void attach(FrameLayout parent); 20 | 21 | /** 22 | * 显示图片索引指示器 UI 组件 23 | * 24 | * @param viewPager TransferImage 25 | */ 26 | void onShow(ViewPager viewPager); 27 | 28 | /** 29 | * 隐藏图片索引指示器 UI 组件 30 | */ 31 | void onHide(); 32 | 33 | /** 34 | * 移除图片索引指示器 UI 组件 35 | */ 36 | void onRemove(); 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_img.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 所有照片 3 | 预览 4 | 没有系统相机 5 | 已经达到最高选择数量 6 | 完成 7 | 8 | 拍摄照片 9 | 图片错误 10 | 无权限 11 | 权限拒绝 12 | 13 | 拒绝 14 | 浏览图片需要您提供浏览存储的权限 15 | 保存拍照图片需要您提供写存储权限 16 | 17 | %1$s(%2$d/%3$d) 18 | 19 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/utils/TimeUtils.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.utils; 2 | 3 | import java.io.File; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | import java.util.Locale; 7 | 8 | /** 9 | * 时间处理工具 10 | * Created by Nereo on 2015/4/8. 11 | */ 12 | public class TimeUtils { 13 | 14 | public static String timeFormat(long timeMillis, String pattern){ 15 | SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.CHINA); 16 | return format.format(new Date(timeMillis)); 17 | } 18 | 19 | public static String formatPhotoDate(long time){ 20 | return timeFormat(time, "yyyy-MM-dd"); 21 | } 22 | 23 | public static String formatPhotoDate(String path){ 24 | File file = new File(path); 25 | if(file.exists()){ 26 | long time = file.lastModified(); 27 | return formatPhotoDate(time); 28 | } 29 | return "1970-01-01"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/utils/ScreenUtils.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.utils; 2 | 3 | import android.content.Context; 4 | import android.graphics.Point; 5 | import android.os.Build; 6 | import android.view.Display; 7 | import android.view.WindowManager; 8 | 9 | /** 10 | * 屏幕工具 11 | * Created by nereo on 15/11/19. 12 | * Updated by nereo on 2016/1/19. 13 | */ 14 | public class ScreenUtils { 15 | 16 | public static Point getScreenSize(Context context){ 17 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 18 | Display display = wm.getDefaultDisplay(); 19 | Point out = new Point(); 20 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { 21 | display.getSize(out); 22 | }else{ 23 | int width = display.getWidth(); 24 | int height = display.getHeight(); 25 | out.set(width, height); 26 | } 27 | return out; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/drawable/mis_action_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/photoview/view/image/PhotoInfo.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.photoview.view.image; 2 | 3 | import android.graphics.PointF; 4 | import android.graphics.RectF; 5 | import android.widget.ImageView; 6 | 7 | public class PhotoInfo { 8 | 9 | // 内部图片在整个手机界面的位置 10 | RectF mRect = new RectF(); 11 | 12 | // 控件在窗口的位置 13 | RectF mImgRect = new RectF(); 14 | 15 | RectF mWidgetRect = new RectF(); 16 | 17 | RectF mBaseRect = new RectF(); 18 | 19 | PointF mScreenCenter = new PointF(); 20 | 21 | float mScale; 22 | 23 | float mDegrees; 24 | 25 | ImageView.ScaleType mScaleType; 26 | 27 | public PhotoInfo(RectF rect, RectF img, RectF widget, RectF base, PointF screenCenter, float scale, float degrees, ImageView.ScaleType scaleType) { 28 | mRect.set(rect); 29 | mImgRect.set(img); 30 | mWidgetRect.set(widget); 31 | mScale = scale; 32 | mScaleType = scaleType; 33 | mDegrees = degrees; 34 | mBaseRect.set(base); 35 | mScreenCenter.set(screenCenter); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | 21 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/photoview/style/IProgressIndicator.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.photoview.style; 2 | 3 | import android.widget.FrameLayout; 4 | 5 | /** 6 | * 图片加载进度组件接口,实现 IProgressIndicator 可扩展自己的图片加载进度组件 7 | *

8 | * email: 196425254@qq.com 9 | */ 10 | public interface IProgressIndicator { 11 | 12 | /** 13 | * 在父容器上附加一个图片加载进度 UI 控件 14 | * 15 | * @param position 当前图片的索引 16 | * @param parent 父容器 17 | */ 18 | void attach(int position, FrameLayout parent); 19 | 20 | /** 21 | * 图片加载进度 UI 控件初始化 22 | * 23 | * @param position 索引下标 24 | */ 25 | void onStart(int position); 26 | 27 | /** 28 | * 图片加载进度 UI 控件显示对应的进度 29 | * 30 | * @param position 索引下标 31 | * @param progress 进度值(0 - 100) 32 | */ 33 | void onProgress(int position, int progress); 34 | 35 | /** 36 | * 隐藏 position 索引位置的图片加载进度 UI 控件 37 | * 38 | * @param position 索引下标 39 | */ 40 | void hideView(int position); 41 | 42 | /** 43 | * 图片加载完成, 移除图片加载进度 UI 控件 44 | * 45 | * @param position 索引下标 46 | */ 47 | void onFinish(int position); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/giftedcat/dynamic/activity/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.dynamic.activity; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Build; 6 | import android.os.Bundle; 7 | import android.view.Window; 8 | import android.view.WindowManager; 9 | 10 | public class BaseActivity extends Activity { 11 | 12 | public Context context; 13 | public Activity instans; 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | 19 | context = this; 20 | instans = this; 21 | setTranslucentStatus(true); 22 | } 23 | 24 | /** 25 | * 设置沉浸式状态栏 26 | * */ 27 | public void setTranslucentStatus(boolean b) { 28 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { 29 | //版本小于4.4 30 | return; 31 | } 32 | Window win = getWindow(); 33 | WindowManager.LayoutParams winParams = win.getAttributes(); 34 | final int bit = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; 35 | if (b) { 36 | winParams.flags |= bit; 37 | } else { 38 | winParams.flags &= ~bit; 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/layout/mis_list_item_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 19 | 20 | 28 | 29 | -------------------------------------------------------------------------------- /pictureLibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | buildToolsVersion "29.0.0" 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion 15 10 | targetSdkVersion 28 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | } 26 | 27 | dependencies { 28 | implementation fileTree(dir: 'libs', include: ['*.jar']) 29 | 30 | implementation 'androidx.appcompat:appcompat:1.0.0' 31 | testImplementation 'junit:junit:4.12' 32 | androidTestImplementation 'androidx.test:runner:1.1.0' 33 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 34 | 35 | implementation 'com.github.bumptech.glide:glide:4.9.0' 36 | annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' 37 | 38 | implementation 'jp.wasabeef:glide-transformations:4.0.0' 39 | implementation 'jp.co.cyberagent.android:gpuimage:2.0.4' 40 | 41 | implementation 'com.squareup.picasso:picasso:2.4.0' 42 | api 'androidx.recyclerview:recyclerview:1.0.0' 43 | 44 | } 45 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/java/com/giftedcat/picture/lib/selector/utils/PermissionUtils.java: -------------------------------------------------------------------------------- 1 | package com.giftedcat.picture.lib.selector.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.DialogInterface; 5 | 6 | import androidx.appcompat.app.AlertDialog; 7 | import androidx.core.app.ActivityCompat; 8 | 9 | import com.example.easylib.R; 10 | 11 | public class PermissionUtils { 12 | 13 | /** 14 | * 请求权限 15 | * */ 16 | public static void requestPermission(final Activity context, final String permission, String rationale, final int requestCode) { 17 | if (ActivityCompat.shouldShowRequestPermissionRationale(context, permission)) { 18 | new AlertDialog.Builder(context) 19 | .setTitle(R.string.mis_permission_dialog_title) 20 | .setMessage(rationale) 21 | .setPositiveButton(R.string.mis_permission_dialog_ok, new DialogInterface.OnClickListener() { 22 | @Override 23 | public void onClick(DialogInterface dialog, int which) { 24 | ActivityCompat.requestPermissions(context, new String[]{permission}, requestCode); 25 | } 26 | }) 27 | .setNegativeButton(R.string.mis_permission_dialog_cancel, null) 28 | .create().show(); 29 | } else { 30 | ActivityCompat.requestPermissions(context, new String[]{permission}, requestCode); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.2" 6 | defaultConfig { 7 | applicationId "com.giftedcat.dynamic" 8 | minSdkVersion 19 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | compileOptions { 22 | sourceCompatibility JavaVersion.VERSION_1_8 23 | targetCompatibility JavaVersion.VERSION_1_8 24 | } 25 | 26 | } 27 | 28 | dependencies { 29 | implementation fileTree(dir: 'libs', include: ['*.jar']) 30 | implementation 'androidx.appcompat:appcompat:1.1.0' 31 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 32 | testImplementation 'junit:junit:4.12' 33 | androidTestImplementation 'androidx.test:runner:1.2.0' 34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 35 | 36 | implementation project(':pictureLibrary') 37 | 38 | implementation 'com.zhy:base-rvadapter:3.0.3' 39 | 40 | api 'com.jakewharton:butterknife:10.2.1' 41 | annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' 42 | 43 | implementation 'com.github.bumptech.glide:glide:4.5.0' 44 | annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0' 45 | 46 | //气泡弹窗 47 | implementation 'me.kareluo.ui:popmenu:1.1.0' 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /pictureLibrary/src/main/res/layout/mis_activity_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 |