├── .gitignore
├── .gitignore.bak
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── dictionaries
│ └── wangyanjing.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── README.md.bak
├── assets
├── crop.png
├── edit_erweima.png
├── edit_image.png
├── mosaic.png
└── paint.png
├── build.gradle
├── demo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── stickers
│ │ ├── type1
│ │ ├── 1.png
│ │ ├── 2.png
│ │ ├── 3.png
│ │ ├── 4.png
│ │ └── 5.png
│ │ ├── type2
│ │ ├── 11.png
│ │ ├── 12.png
│ │ ├── 6.png
│ │ ├── 7.png
│ │ └── 8.png
│ │ ├── type3
│ │ ├── 13.png
│ │ ├── 14.png
│ │ ├── 15.png
│ │ ├── 16.png
│ │ └── 17.png
│ │ ├── type4
│ │ ├── 18.png
│ │ ├── 21.png
│ │ ├── 22.png
│ │ ├── 23.png
│ │ └── 24.png
│ │ ├── type5
│ │ ├── 25.png
│ │ ├── 26.png
│ │ ├── 27.png
│ │ └── 28.png
│ │ └── type6
│ │ ├── 20.png
│ │ ├── 22.png
│ │ ├── 23.png
│ │ ├── 3.png
│ │ └── 7.png
│ ├── java
│ └── com
│ │ └── yjing
│ │ └── imageeditandroid
│ │ ├── FileUtils.java
│ │ └── MainActivity.java
│ └── res
│ ├── layout
│ └── activity_main.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ ├── values-zh
│ └── strings.xml
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── imageeditlibrary
├── .gitignore
├── build.gradle
├── jni
│ ├── Android.mk
│ ├── Application.mk
│ ├── bicubic_resize.c
│ ├── bitmap.c
│ ├── bitmap.h
│ ├── blur.c
│ ├── colour_space.c
│ ├── colour_space.h
│ ├── filter.c
│ ├── matrix.c
│ ├── mem_utils.c
│ ├── mem_utils.h
│ ├── nanojpeg.c
│ ├── photo_processing.c
│ ├── transform.c
│ └── transform.h
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── yjing
│ │ └── imageeditlibrary
│ │ ├── BaseActivity.java
│ │ ├── editimage
│ │ ├── EditImageActivity.java
│ │ ├── StrickerAdapter.java
│ │ ├── contorl
│ │ │ └── SaveMode.java
│ │ ├── fliter
│ │ │ └── PhotoProcessing.java
│ │ ├── fragment
│ │ │ ├── AddTextFragment.java
│ │ │ ├── BaseFragment.java
│ │ │ ├── CropFragment.java
│ │ │ ├── FliterListFragment.java
│ │ │ ├── MainMenuFragment.java
│ │ │ ├── MosaicFragment.java
│ │ │ ├── PaintFragment.java
│ │ │ ├── RotateFragment.java
│ │ │ └── StirckerFragment.java
│ │ ├── inter
│ │ │ ├── EditFunctionOperationInterface.java
│ │ │ ├── ImageEditInte.java
│ │ │ └── SaveCompletedInte.java
│ │ ├── model
│ │ │ ├── RatioItem.java
│ │ │ └── StickerBean.java
│ │ ├── task
│ │ │ └── StickerTask.java
│ │ ├── ui
│ │ │ └── ColorPicker.java
│ │ └── view
│ │ │ ├── ColorSeekBar.java
│ │ │ ├── Constants.java
│ │ │ ├── CropImageView.java
│ │ │ ├── CustomPaintView.java
│ │ │ ├── CustomViewPager.java
│ │ │ ├── PaintModeView.java
│ │ │ ├── PaintPath.java
│ │ │ ├── RotateImageView.java
│ │ │ ├── StickerItem.java
│ │ │ ├── StickerView.java
│ │ │ ├── TextStickerView.java
│ │ │ ├── imagezoom
│ │ │ ├── ImageViewTouch.java
│ │ │ ├── ImageViewTouchBase.java
│ │ │ ├── easing
│ │ │ │ ├── Back.java
│ │ │ │ ├── Bounce.java
│ │ │ │ ├── Circ.java
│ │ │ │ ├── Cubic.java
│ │ │ │ ├── Easing.java
│ │ │ │ ├── Elastic.java
│ │ │ │ ├── Expo.java
│ │ │ │ ├── Linear.java
│ │ │ │ ├── Quad.java
│ │ │ │ ├── Quart.java
│ │ │ │ ├── Quint.java
│ │ │ │ └── Sine.java
│ │ │ ├── graphic
│ │ │ │ ├── FastBitmapDrawable.java
│ │ │ │ └── IBitmapDrawable.java
│ │ │ └── utils
│ │ │ │ ├── DecodeUtils.java
│ │ │ │ ├── ExifUtils.java
│ │ │ │ ├── IDisposable.java
│ │ │ │ └── IOUtils.java
│ │ │ └── mosaic
│ │ │ ├── MosaicPath.java
│ │ │ ├── MosaicUtil.java
│ │ │ └── MosaicView.java
│ │ ├── picchooser
│ │ ├── BucketItem.java
│ │ ├── BucketsFragment.java
│ │ ├── GalleryAdapter.java
│ │ ├── GridItem.java
│ │ ├── ImagesFragment.java
│ │ ├── Logger.java
│ │ ├── SelectPictureActivity.java
│ │ └── SquareImageView.java
│ │ └── utils
│ │ ├── BitmapUtils.java
│ │ ├── DensityUtil.java
│ │ ├── FileUtils.java
│ │ ├── Matrix3.java
│ │ ├── PaintUtil.java
│ │ └── RectUtil.java
│ ├── jniLibs
│ ├── arm64-v8a
│ │ └── libphotoprocessing.so
│ ├── armeabi-v7a
│ │ └── libphotoprocessing.so
│ ├── armeabi
│ │ └── libphotoprocessing.so
│ ├── mips
│ │ └── libphotoprocessing.so
│ ├── mips64
│ │ └── libphotoprocessing.so
│ ├── x86
│ │ └── libphotoprocessing.so
│ └── x86_64
│ │ └── libphotoprocessing.so
│ └── res
│ ├── anim
│ ├── in_bottom_to_top.xml
│ ├── menuhide.xml
│ ├── menushow.xml
│ └── out_bottom_to_top.xml
│ ├── drawable-hdpi
│ ├── back_arrow.png
│ ├── blue_thumb_default.png
│ ├── blue_thumb_pressed.png
│ ├── green_thumb_default.png
│ ├── green_thumb_pressed.png
│ ├── icon_title_bar_back.png
│ ├── red_thumb_default.png
│ └── red_thumb_pressed.png
│ ├── drawable-mdpi
│ ├── blue_thumb_default.png
│ ├── blue_thumb_pressed.png
│ ├── green_thumb_default.png
│ ├── green_thumb_pressed.png
│ ├── red_thumb_default.png
│ └── red_thumb_pressed.png
│ ├── drawable-xhdpi
│ ├── back_arrow.png
│ ├── blue_thumb_default.png
│ ├── blue_thumb_pressed.png
│ ├── crop_normal.png
│ ├── crop_pressed.png
│ ├── edit_image_brush_mosaic_btn.png
│ ├── edit_image_brush_mosaic_btn_select.png
│ ├── edit_image_cancel_btn.png
│ ├── edit_image_cancel_btn_select.png
│ ├── edit_image_confirm_btn.png
│ ├── edit_image_confirm_btn_select.png
│ ├── edit_image_crop_btn.png
│ ├── edit_image_crop_btn_select.png
│ ├── edit_image_emotion_btn.png
│ ├── edit_image_emotion_btn_select.png
│ ├── edit_image_mosaic_tool_btn.png
│ ├── edit_image_mosaic_tool_btn_select.png
│ ├── edit_image_pen_tool_btn.png
│ ├── edit_image_pen_tool_btn_select.png
│ ├── edit_image_revoke_btn.png
│ ├── edit_image_text_tool_btn.png
│ ├── edit_image_text_tool_btn_select.png
│ ├── edit_image_traditional_mosaic_btn.png
│ ├── edit_image_traditional_mosaic_btn_select.png
│ ├── eraser_normal.png
│ ├── eraser_seleced.png
│ ├── fliters_normal.png
│ ├── fliters_pressed.png
│ ├── green_thumb_default.png
│ ├── green_thumb_pressed.png
│ ├── hi4.png
│ ├── ic_menu_gallery.png
│ ├── image_edit_back.png
│ ├── red_thumb_default.png
│ ├── red_thumb_pressed.png
│ ├── sticker_delete.png
│ ├── sticker_normal.png
│ ├── sticker_pressed.png
│ ├── sticker_rotate.png
│ ├── stickers_type_animal.png
│ ├── stickers_type_cos.png
│ ├── stickers_type_decoration.png
│ ├── stickers_type_frame.png
│ ├── stickers_type_mark.png
│ ├── stickers_type_motion.png
│ ├── stickers_type_number.png
│ ├── stickers_type_profession.png
│ ├── stickers_type_spring.png
│ ├── stickers_type_text.png
│ ├── texture_normal.png
│ ├── texture_pressed.png
│ └── yd_image_tx.png
│ ├── drawable-xxhdpi
│ ├── blue_thumb_default.png
│ ├── blue_thumb_pressed.png
│ ├── edit_image_brush_mosaic_btn.png
│ ├── edit_image_brush_mosaic_btn_select.png
│ ├── edit_image_cancel_btn.png
│ ├── edit_image_cancel_btn_select.png
│ ├── edit_image_confirm_btn.png
│ ├── edit_image_confirm_btn_select.png
│ ├── edit_image_crop_btn.png
│ ├── edit_image_crop_btn_select.png
│ ├── edit_image_emotion_board_roll.png
│ ├── edit_image_emotion_btn.png
│ ├── edit_image_emotion_btn_select.png
│ ├── edit_image_mosaic_tool_btn.png
│ ├── edit_image_mosaic_tool_btn_select.png
│ ├── edit_image_pen_tool_btn.png
│ ├── edit_image_pen_tool_btn_select.png
│ ├── edit_image_revoke_btn.png
│ ├── edit_image_text_tool_btn.png
│ ├── edit_image_text_tool_btn_select.png
│ ├── edit_image_traditional_mosaic_btn.png
│ ├── edit_image_traditional_mosaic_btn_select.png
│ ├── green_thumb_default.png
│ ├── green_thumb_pressed.png
│ ├── red_thumb_default.png
│ └── red_thumb_pressed.png
│ ├── drawable
│ ├── edit_image_brush_mosaic_selector.xml
│ ├── edit_image_cancel_selector.xml
│ ├── edit_image_confirm_selector.xml
│ ├── edit_image_crop_selector.xml
│ ├── edit_image_emotion_selector.xml
│ ├── edit_image_mosaic_tool_selector.xml
│ ├── edit_image_pen_tool_selector.xml
│ ├── edit_image_text_tool_selector.xml
│ ├── edit_image_traditional_mosaic_selector.xml
│ ├── image_edit_icon_crop.xml
│ ├── image_edit_icon_filter.xml
│ ├── image_edit_icon_sticker.xml
│ ├── image_edit_icon_text.xml
│ ├── materialcolorpicker__blue_progress.xml
│ ├── materialcolorpicker__blue_thumb_drawable.xml
│ ├── materialcolorpicker__color_button.xml
│ ├── materialcolorpicker__color_button_16.xml
│ ├── materialcolorpicker__green_progress.xml
│ ├── materialcolorpicker__green_thumb_drawable.xml
│ ├── materialcolorpicker__red_thumb_drawable.xml
│ ├── red_progress.xml
│ └── shape_rect.xml
│ ├── layout
│ ├── activity_image_edit.xml
│ ├── activity_main.xml
│ ├── bucketitem.xml
│ ├── edit_image_header.xml
│ ├── fragment_edit_image_add_text.xml
│ ├── fragment_edit_image_crop.xml
│ ├── fragment_edit_image_fliter.xml
│ ├── fragment_edit_image_main_menu.xml
│ ├── fragment_edit_image_rotate.xml
│ ├── fragment_edit_image_sticker_type.xml
│ ├── fragment_edit_paint.xml
│ ├── fragment_mosaic.xml
│ ├── gallery.xml
│ ├── imageitem.xml
│ ├── materialcolorpicker__layout_color_picker.xml
│ ├── materialcolorpicker__layout_color_picker_old_android.xml
│ ├── view_color_more_panel.xml
│ ├── view_set_stoke_width.xml
│ ├── view_sticker_item.xml
│ └── view_sticker_type_item.xml
│ ├── values-w820dp
│ └── dimens.xml
│ ├── values-zh
│ └── strings.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 | # Files for the ART/Dalvik VM
5 | *.dex
6 | # Java class files
7 | *.class
8 | # Generated files
9 | bin/
10 | gen/
11 | out/
12 | # Gradle files
13 | .gradle/
14 | build/
15 | # Local configuration file (sdk path, etc)
16 | local.properties
17 | # Proguard folder generated by Eclipse
18 | proguard/
19 | # Log Files
20 | *.log
21 | # Android Studio Navigation editor temp files
22 | .navigation/
23 | # Android Studio captures folder
24 | captures/
25 | # Intellij
26 | *.iml
27 | .idea/workspace.xml
28 | .idea/libraries
29 | # Keystore files
30 | *.jks
--------------------------------------------------------------------------------
/.gitignore.bak:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/dictionaries/wangyanjing.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/misc.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 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | Android
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | C:\Users\wangyanjing\AppData\Roaming\Subversion
64 |
65 |
66 |
67 |
68 |
69 | 1.8
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SimpleImageEditor
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 | * 1.0.0 涂鸦,贴图,添加文字,马赛克,截图功能,对操作进行撤销
32 | * 1.0.1 马赛克功能可以自由在不同的样式之间切换
33 |
34 | ### APK Demo
35 |
36 | 扫码下载
37 |
38 | 
39 |
40 | 二维码显示不出请点击 [下载Demo](https://fir.im/imageEditAndroid )
--------------------------------------------------------------------------------
/README.md.bak:
--------------------------------------------------------------------------------
1 | # SimpleImageEditor
2 | 高仿微信的图片编辑器,包括涂鸦,贴图,添加文字,马赛克,截图功能
3 |
4 | ### APK Demo
5 | 扫码下载
6 | 
7 | 二维码显示不出请点击 [下载Demo](http://fir.im/imageEditAndroid )
--------------------------------------------------------------------------------
/assets/crop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/assets/crop.png
--------------------------------------------------------------------------------
/assets/edit_erweima.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/assets/edit_erweima.png
--------------------------------------------------------------------------------
/assets/edit_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/assets/edit_image.png
--------------------------------------------------------------------------------
/assets/mosaic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/assets/mosaic.png
--------------------------------------------------------------------------------
/assets/paint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/assets/paint.png
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 |
22 | subprojects {
23 | ext.compileSdkVer = 24
24 | ext.buildToolsVer = "25.0.0"
25 | ext.supportLibVer = "24.0.0"
26 | }
27 |
28 |
29 | ext {
30 | compileSdkVersion = 24
31 | buildToolsVersion = "25.0.0"
32 | minsdkVersion = 14
33 | targetSdkVersion = 23
34 | }
35 |
--------------------------------------------------------------------------------
/demo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/demo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion '25.0.2'
6 |
7 | lintOptions {
8 | checkReleaseBuilds false//不开启lint检查,建议抽空开启为true打包,然后修复各种不规范的地方;
9 | abortOnError false
10 | }
11 |
12 | defaultConfig {
13 | applicationId "com.yjing.imageeditor"
14 | minSdkVersion 16
15 | targetSdkVersion 23
16 | versionCode 101
17 | versionName "1.0.1"
18 | }
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | }
26 |
27 | dependencies {
28 | compile fileTree(include: ['*.jar'], dir: 'libs')
29 | compile 'com.android.support:appcompat-v7:23.1.1'
30 | compile project(':imageeditlibrary')
31 | }
32 |
--------------------------------------------------------------------------------
/demo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\android\android-sdk-windows/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/demo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
9 |
10 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type1/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type1/1.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type1/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type1/2.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type1/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type1/3.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type1/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type1/4.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type1/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type1/5.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type2/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type2/11.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type2/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type2/12.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type2/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type2/6.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type2/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type2/7.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type2/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type2/8.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type3/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type3/13.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type3/14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type3/14.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type3/15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type3/15.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type3/16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type3/16.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type3/17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type3/17.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type4/18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type4/18.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type4/21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type4/21.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type4/22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type4/22.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type4/23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type4/23.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type4/24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type4/24.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type5/25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type5/25.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type5/26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type5/26.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type5/27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type5/27.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type5/28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type5/28.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type6/20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type6/20.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type6/22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type6/22.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type6/23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type6/23.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type6/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type6/3.png
--------------------------------------------------------------------------------
/demo/src/main/assets/stickers/type6/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/assets/stickers/type6/7.png
--------------------------------------------------------------------------------
/demo/src/main/java/com/yjing/imageeditandroid/FileUtils.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditandroid;
2 |
3 | import java.io.File;
4 | import java.io.FileOutputStream;
5 | import java.io.IOException;
6 | import java.math.BigDecimal;
7 |
8 | import android.content.Context;
9 | import android.graphics.Bitmap;
10 | import android.net.ConnectivityManager;
11 | import android.net.NetworkInfo;
12 | import android.os.Environment;
13 |
14 | /**
15 | * 文件相关辅助类
16 | */
17 | public class FileUtils {
18 | public static final String FOLDER_NAME = "imageeidtor";
19 |
20 | /**
21 | * 获取存贮文件的文件夹路径
22 | *
23 | * @return
24 | */
25 | public static File createFolders() {
26 | File baseDir;
27 | if (android.os.Build.VERSION.SDK_INT < 8) {
28 | baseDir = Environment.getExternalStorageDirectory();
29 | } else {
30 | baseDir = Environment
31 | .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
32 | }
33 | if (baseDir == null)
34 | return Environment.getExternalStorageDirectory();
35 | File aviaryFolder = new File(baseDir, FOLDER_NAME);
36 | if (aviaryFolder.exists())
37 | return aviaryFolder;
38 | if (aviaryFolder.isFile())
39 | aviaryFolder.delete();
40 | if (aviaryFolder.mkdirs())
41 | return aviaryFolder;
42 | return Environment.getExternalStorageDirectory();
43 | }
44 |
45 | public static File genEditFile() {
46 | return FileUtils.getEmptyFile("tietu"
47 | + System.currentTimeMillis() + ".jpg");
48 | }
49 |
50 | public static File getEmptyFile(String name) {
51 | File folder = FileUtils.createFolders();
52 | if (folder != null) {
53 | if (folder.exists()) {
54 | File file = new File(folder, name);
55 | return file;
56 | }
57 | }
58 | return null;
59 | }
60 |
61 | /**
62 | * 删除指定文件
63 | *
64 | * @param path
65 | * @return
66 | */
67 | public static boolean deleteFileNoThrow(String path) {
68 | File file;
69 | try {
70 | file = new File(path);
71 | } catch (NullPointerException e) {
72 | return false;
73 | }
74 |
75 | if (file.exists()) {
76 | return file.delete();
77 | }
78 | return false;
79 | }
80 |
81 | /**
82 | * 保存图片
83 | *
84 | * @param bitName
85 | * @param mBitmap
86 | */
87 | public static String saveBitmap(String bitName, Bitmap mBitmap) {
88 | File baseFolder = createFolders();
89 | File f = new File(baseFolder.getAbsolutePath(), bitName);
90 | FileOutputStream fOut = null;
91 | try {
92 | f.createNewFile();
93 | fOut = new FileOutputStream(f);
94 | } catch (IOException e) {
95 | e.printStackTrace();
96 | }
97 | mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
98 | try {
99 | fOut.flush();
100 | fOut.close();
101 | } catch (IOException e) {
102 | e.printStackTrace();
103 | }
104 | return f.getAbsolutePath();
105 | }
106 |
107 | // 获取文件夹大小
108 | public static long getFolderSize(File file) throws Exception {
109 | long size = 0;
110 | try {
111 | File[] fileList = file.listFiles();
112 | for (int i = 0; i < fileList.length; i++) { // 如果下面还有文件
113 | if (fileList[i].isDirectory()) {
114 | size = size + getFolderSize(fileList[i]);
115 | } else {
116 | size = size + fileList[i].length();
117 | }
118 | }
119 | } catch (Exception e) {
120 | e.printStackTrace();
121 | }
122 | return size;
123 | }
124 |
125 | /**
126 | * 格式化单位 * * @param size * @return
127 | */
128 | public static String getFormatSize(double size) {
129 | double kiloByte = size / 1024d;
130 | int megaByte = (int) (kiloByte / 1024d);
131 | return megaByte + "MB";
132 | }
133 |
134 | public static boolean isConnect(Context context) {
135 | try {
136 | ConnectivityManager connectivity = (ConnectivityManager) context
137 | .getSystemService(Context.CONNECTIVITY_SERVICE);
138 | if (connectivity != null) {
139 | NetworkInfo info = connectivity.getActiveNetworkInfo();
140 | if (info != null && info.isConnected()) {
141 | if (info.getState() == NetworkInfo.State.CONNECTED) {
142 | return true;
143 | }
144 | }
145 | }
146 | } catch (Exception e) {
147 |
148 | }
149 | return false;
150 | }
151 |
152 | }// end
153 |
--------------------------------------------------------------------------------
/demo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
9 |
10 |
16 |
17 |
22 |
23 |
28 |
29 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/demo/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/demo/src/main/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 图片编辑
3 | Hello world!
4 | Settings
5 | 选择一张需要编辑的图片
6 | 编辑图片
7 | 保存到路径: %s
8 | 拍摄照片
9 |
10 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ImageEditAndroid
3 | Hello world!
4 | Settings
5 | choose a image for edit
6 | edit image
7 | save path : %s
8 | take_photo
9 |
10 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Mar 27 17:17:42 CST 2017
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-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/imageeditlibrary/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/imageeditlibrary/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion compileSdkVer
5 | buildToolsVersion buildToolsVer
6 |
7 | defaultConfig {
8 | minSdkVersion minsdkVersion
9 | targetSdkVersion targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(include: ['*.jar'], dir: 'libs')
23 | compile 'com.android.support:appcompat-v7:24.1.1'
24 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
25 | compile 'com.android.support:recyclerview-v7:24.1.1'
26 | compile 'com.android.support:support-v4:24.2.1'
27 | }
28 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := photoprocessing
6 |
7 | LOCAL_CFLAGS := -DANDROID_NDK \
8 | -DDISABLE_IMPORTGL
9 |
10 | LOCAL_SRC_FILES := nanojpeg.c mem_utils.c bitmap.c bicubic_resize.c filter.c transform.c colour_space.c matrix.c blur.c photo_processing.c
11 | LOCAL_LDLIBS := -lm -llog
12 |
13 | include $(BUILD_SHARED_LIBRARY)
--------------------------------------------------------------------------------
/imageeditlibrary/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_OPTIM := release
2 | APP_ABI := all
--------------------------------------------------------------------------------
/imageeditlibrary/jni/bicubic_resize.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | int resizeChannelBicubic(const unsigned char *src, int srcWidth, int srcHeight, unsigned char *dst, int dstWidth, int dstHeight) {
21 | unsigned char *xVector;
22 | int i, nextCol, nextRow, numRows, ty, x, y;
23 | double factor, *s, *scanline, *scaleScanline, *t, xScale, xSpan,
24 | yScale, ySpan, *yVector;
25 |
26 | factor = (double) dstWidth / (double) srcWidth;
27 |
28 | if (dst == NULL) {
29 | return -1;
30 | }
31 |
32 | /* No scaling needed. */
33 | if (srcWidth == dstWidth) {
34 | memcpy(dst, src, srcWidth * srcHeight);
35 | return 0;
36 | }
37 |
38 | int returnCode = newUnsignedCharArray(srcWidth, &xVector);
39 | if (returnCode != MEMORY_OK) {
40 | return returnCode;
41 | }
42 |
43 | returnCode = newDoubleArray(srcWidth, &yVector);
44 | if (returnCode != MEMORY_OK) {
45 | freeUnsignedCharArray(&xVector);
46 | return returnCode;
47 | }
48 |
49 | returnCode = newDoubleArray(srcWidth, &scanline);
50 | if (returnCode != MEMORY_OK) {
51 | freeUnsignedCharArray(&xVector);
52 | freeDoubleArray(&yVector);
53 | return returnCode;
54 | }
55 |
56 | returnCode = newDoubleArray((dstWidth + 1), &scaleScanline);
57 | if (returnCode != MEMORY_OK) {
58 | freeUnsignedCharArray(&xVector);
59 | freeDoubleArray(&yVector);
60 | freeDoubleArray(&scanline);
61 | return returnCode;
62 | }
63 |
64 | numRows = 0;
65 | nextRow = 1;
66 | ySpan = 1.0;
67 | yScale = factor;
68 | i = 0;
69 |
70 | for (y = 0; y < dstHeight; y++) {
71 | ty = y * dstWidth;
72 |
73 | memset(yVector, 0, srcWidth * sizeof(double));
74 | memset(scaleScanline, 0, dstWidth * sizeof(double));
75 |
76 | /* Scale Y-dimension. */
77 | while (yScale < ySpan) {
78 | if (nextRow && numRows < srcHeight) {
79 | /* Read a new scanline. */
80 | memcpy(xVector, src, srcWidth);
81 | src += srcWidth;
82 | numRows++;
83 | }
84 | for (x = 0; x < srcWidth; x++) {
85 | yVector[x] += yScale * (double) xVector[x];
86 | }
87 | ySpan -= yScale;
88 | yScale = factor;
89 | nextRow = 1;
90 | }
91 | if (nextRow && numRows < srcHeight) {
92 | /* Read a new scanline. */
93 | memcpy(xVector, src, srcWidth);
94 | src += srcWidth;
95 | numRows++;
96 | nextRow = 0;
97 | }
98 | s = scanline;
99 | for (x = 0; x < srcWidth; x++) {
100 | yVector[x] += ySpan * (double) xVector[x];
101 | *s = yVector[x];
102 | s++;
103 | }
104 | yScale -= ySpan;
105 | if (yScale <= 0) {
106 | yScale = factor;
107 | nextRow = 1;
108 | }
109 | ySpan = 1.0;
110 |
111 | nextCol = 0;
112 | xSpan = 1.0;
113 | s = scanline;
114 | t = scaleScanline;
115 |
116 | /* Scale X dimension. */
117 | for (x = 0; x < srcWidth; x++) {
118 | xScale = factor;
119 | while (xScale >= xSpan) {
120 | if (nextCol) {
121 | t++;
122 | }
123 | t[0] += xSpan * s[0];
124 | xScale -= xSpan;
125 | xSpan = 1.0;
126 | nextCol = 1;
127 | }
128 | if (xScale > 0) {
129 | if (nextCol) {
130 | nextCol = 0;
131 | t++;
132 | }
133 | t[0] += xScale * s[0];
134 | xSpan -= xScale;
135 | }
136 | s++;
137 | }
138 |
139 | /* Copy scanline to target. */
140 | t = scaleScanline;
141 | for (x = 0; x < dstWidth; x++) {
142 | dst[ty + x] = (unsigned char) t[x];
143 | }
144 | }
145 |
146 | freeUnsignedCharArray(&xVector);
147 | freeDoubleArray(&yVector);
148 | freeDoubleArray(&scanline);
149 | freeDoubleArray(&scaleScanline);
150 |
151 | return MEMORY_OK;
152 | }
153 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/bitmap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef BITMAP
18 | #define BITMAP
19 | #endif
20 |
21 | #include
22 |
23 | static const int INCONSISTENT_BITMAP_ERROR = 5;
24 |
25 | typedef struct {
26 | unsigned int width;
27 | unsigned int height;
28 |
29 | unsigned int redWidth;
30 | unsigned int redHeight;
31 | unsigned int greenWidth;
32 | unsigned int greenHeight;
33 | unsigned int blueWidth;
34 | unsigned int blueHeight;
35 |
36 | unsigned char* red;
37 | unsigned char* green;
38 | unsigned char* blue;
39 |
40 | TransformList transformList;
41 | } Bitmap;
42 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/colour_space.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 |
21 | #define LOG_TAG "colour_space.c"
22 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
23 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
24 |
25 | void rgbToHsb(unsigned char red, unsigned char green, unsigned char blue, HSBColour* hsb) {
26 | float min, max;
27 | if (red < green) {
28 | min = red;
29 | max = green;
30 | } else {
31 | min = green;
32 | max = red;
33 | }
34 | if (blue > max) {
35 | max = blue;
36 | } else if (blue < min) {
37 | min = blue;
38 | }
39 | float delta = max - min;
40 |
41 | (*hsb).b = max/255;
42 | if (max != 0.0) {
43 | (*hsb).s = delta/max;
44 | } else {
45 | (*hsb).s = 0.0;
46 | }
47 |
48 | if ((*hsb).s == 0.0) {
49 | (*hsb).h = 0;
50 | } else {
51 | delta *= 6;
52 | if (red == max) {
53 | (*hsb).h = (green - blue)/delta;
54 | } else if (green == max) {
55 | (*hsb).h = 0.333333f + (blue - red)/delta;
56 | } else if (blue == max) {
57 | (*hsb).h = 0.666666f + (red - green)/delta;
58 | }
59 |
60 | if ((*hsb).h < 0) {
61 | (*hsb).h++;
62 | }
63 | }
64 | }
65 |
66 | void getBrightness(unsigned char red, unsigned char green, unsigned char blue, float* brightness) {
67 | float min, max;
68 | if (red < green) {
69 | min = red;
70 | max = green;
71 | } else {
72 | min = green;
73 | max = red;
74 | }
75 | if (blue > max) {
76 | max = blue;
77 | } else if (blue < min) {
78 | min = blue;
79 | }
80 | float delta = max - min;
81 |
82 | (*brightness) = max/255;
83 | }
84 |
85 | inline unsigned char convert(float val) {
86 | return floorf((255 * val) + 0.5f);
87 | }
88 |
89 | void hsbToRgb(HSBColour* hsb, unsigned char* red, unsigned char* green, unsigned char* blue) {
90 | if ((*hsb).s == 0) {
91 | *red = *green = *blue = convert((*hsb).b);
92 | } else {
93 | register unsigned int i;
94 | register float aa, bb, cc, f;
95 |
96 | register float h = (*hsb).h;
97 | register float s = (*hsb).s;
98 | register float b = (*hsb).b;
99 |
100 | if (h == 1.0) {
101 | h = 0;
102 | }
103 |
104 | h *= 6.0;
105 | i = floorf(h);
106 | f = h - i;
107 | aa = b * (1 - s);
108 | bb = b * (1 - (s * f));
109 | cc = b * (1 - (s * (1 - f)));
110 | switch (i) {
111 | case 0:
112 | *red = convert(b);
113 | *green = convert(cc);
114 | *blue = convert(aa);
115 | break;
116 | case 1:
117 | *red = convert(bb);
118 | *green = convert(b);
119 | *blue = convert(aa);
120 | break;
121 | case 2:
122 | *red = convert(aa);
123 | *green = convert(b);
124 | *blue = convert(cc);
125 | break;
126 | case 3:
127 | *red = convert(aa);
128 | *green = convert(bb);
129 | *blue = convert(b);
130 | break;
131 | case 4:
132 | *red = convert(cc);
133 | *green = convert(aa);
134 | *blue = convert(b);
135 | break;
136 | case 5:
137 | *red = convert(b);
138 | *green = convert(aa);
139 | *blue = convert(bb);
140 | break;
141 | }
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/colour_space.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef COLOUR_SPACE
18 | #define COLOUR_SPACE
19 | #endif
20 |
21 | typedef struct {
22 | float h; /* Hue degree between 0.0 and 360.0 */
23 | float s; /* Saturation between 0.0 (gray) and 1.0 */
24 | float b; /* Value between 0.0 (black) and 1.0 */
25 | } HSBColour ;
26 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/matrix.c:
--------------------------------------------------------------------------------
1 | // Based on work preseted here presented http://www.graficaobscura.com/matrix/index.html
2 | // By Paul Haeberli - 1993
3 |
4 | #include
5 | #include "bitmap.h"
6 |
7 | #define RLUM (0.3086f)
8 | #define GLUM (0.6094f)
9 | #define BLUM (0.0820f)
10 |
11 | void applyMatrix(Bitmap* bitmap, float matrix[4][4])
12 | {
13 | unsigned char* red = (*bitmap).red;
14 | unsigned char* green = (*bitmap).green;
15 | unsigned char* blue = (*bitmap).blue;
16 |
17 | unsigned int length = (*bitmap).width * (*bitmap).height;
18 |
19 | float r1, g1, b1, r2, g2, b2;
20 |
21 | unsigned int i;
22 | for(i = 0; i < length; i++) {
23 | r1 = red[i];
24 | g1 = green[i];
25 | b1 = blue[i];
26 | r2 = r1*matrix[0][0] + g1*matrix[1][0] + b1*matrix[2][0] + matrix[3][0];
27 | g2 = r1*matrix[0][1] + g1*matrix[1][1] + b1*matrix[2][1] + matrix[3][1];
28 | b2 = r1*matrix[0][2] + g1*matrix[1][2] + b1*matrix[2][2] + matrix[3][2];
29 | if(r2<0) r2 = 0;
30 | if(r2>255) r2 = 255;
31 | if(g2<0) g2 = 0;
32 | if(g2>255) g2 = 255;
33 | if(b2<0) b2 = 0;
34 | if(b2>255) b2 = 255;
35 | red[i] = r2;
36 | green[i] = g2;
37 | blue[i] = b2;
38 | }
39 | }
40 |
41 | void applyMatrixToPixel(unsigned char* red, unsigned char* green, unsigned char* blue, float matrix[4][4])
42 | {
43 | float r1, g1, b1, r2, g2, b2;
44 |
45 | r1 = (*red);
46 | g1 = (*green);
47 | b1 = (*blue);
48 | r2 = r1*matrix[0][0] + g1*matrix[1][0] + b1*matrix[2][0] + matrix[3][0];
49 | g2 = r1*matrix[0][1] + g1*matrix[1][1] + b1*matrix[2][1] + matrix[3][1];
50 | b2 = r1*matrix[0][2] + g1*matrix[1][2] + b1*matrix[2][2] + matrix[3][2];
51 | if(r2<0) r2 = 0;
52 | if(r2>255) r2 = 255;
53 | if(g2<0) g2 = 0;
54 | if(g2>255) g2 = 255;
55 | if(b2<0) b2 = 0;
56 | if(b2>255) b2 = 255;
57 | (*red) = r2;
58 | (*green) = g2;
59 | (*blue) = b2;
60 | }
61 |
62 | identMatrix(float *matrix) {
63 | *matrix++ = 1.0f; /* row 1 */
64 | *matrix++ = 0.0f;
65 | *matrix++ = 0.0f;
66 | *matrix++ = 0.0f;
67 | *matrix++ = 0.0f; /* row 2 */
68 | *matrix++ = 1.0f;
69 | *matrix++ = 0.0f;
70 | *matrix++ = 0.0f;
71 | *matrix++ = 0.0f; /* row 3 */
72 | *matrix++ = 0.0f;
73 | *matrix++ = 1.0f;
74 | *matrix++ = 0.0f;
75 | *matrix++ = 0.0f; /* row 4 */
76 | *matrix++ = 0.0f;
77 | *matrix++ = 0.0f;
78 | *matrix++ = 1.0f;
79 | }
80 |
81 | void saturateMatrix(float matrix[4][4], float* saturation)
82 | {
83 | float sat = (*saturation);
84 | float mmatrix[4][4];
85 | float a, b, c, d, e, f, g, h, i;
86 | float rwgt, gwgt, bwgt;
87 |
88 | rwgt = RLUM;
89 | gwgt = GLUM;
90 | bwgt = BLUM;
91 |
92 | a = (1.0f-sat)*rwgt + sat;
93 | b = (1.0f-sat)*rwgt;
94 | c = (1.0f-sat)*rwgt;
95 | d = (1.0f-sat)*gwgt;
96 | e = (1.0f-sat)*gwgt + sat;
97 | f = (1.0f-sat)*gwgt;
98 | g = (1.0f-sat)*bwgt;
99 | h = (1.0f-sat)*bwgt;
100 | i = (1.0f-sat)*bwgt + sat;
101 | mmatrix[0][0] = a;
102 | mmatrix[0][1] = b;
103 | mmatrix[0][2] = c;
104 | mmatrix[0][3] = 0.0f;
105 |
106 | mmatrix[1][0] = d;
107 | mmatrix[1][1] = e;
108 | mmatrix[1][2] = f;
109 | mmatrix[1][3] = 0.0f;
110 |
111 | mmatrix[2][0] = g;
112 | mmatrix[2][1] = h;
113 | mmatrix[2][2] = i;
114 | mmatrix[2][3] = 0.0f;
115 |
116 | mmatrix[3][0] = 0.0f;
117 | mmatrix[3][1] = 0.0f;
118 | mmatrix[3][2] = 0.0f;
119 | mmatrix[3][3] = 1.0f;
120 | multiplyMatricies(mmatrix, matrix, matrix);
121 | }
122 |
123 | multiplyMatricies(float a[4][4], float b[4][4], float c[4][4]) {
124 | int x, y;
125 | float temp[4][4];
126 |
127 | for(y=0; y<4 ; y++) {
128 | for(x=0 ; x<4 ; x++) {
129 | temp[y][x] = b[y][0] * a[0][x]
130 | + b[y][1] * a[1][x]
131 | + b[y][2] * a[2][x]
132 | + b[y][3] * a[3][x];
133 | }
134 | }
135 |
136 | for(y=0; y<4; y++) {
137 | for(x=0; x<4; x++) {
138 | c[y][x] = temp[y][x];
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/mem_utils.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | int newIntArray(unsigned int size, int** arrayPointer) {
21 | unsigned int numBytes = size * sizeof(int);
22 | *arrayPointer = (int*) malloc(numBytes);
23 | if (arrayPointer == NULL) {
24 | return INT_ARRAY_ERROR;
25 | }
26 |
27 | memset(*arrayPointer, 0, numBytes);
28 | return MEMORY_OK;
29 | }
30 |
31 | int newUnsignedIntArray(unsigned int size, unsigned int** arrayPointer) {
32 | unsigned int numBytes = size * sizeof(unsigned int);
33 | *arrayPointer = (int*) malloc(numBytes);
34 | if (arrayPointer == NULL) {
35 | return INT_ARRAY_ERROR;
36 | }
37 |
38 | memset(*arrayPointer, 0, numBytes);
39 | return MEMORY_OK;
40 | }
41 |
42 | int newDoubleArray(unsigned int size, double** arrayPointer) {
43 | unsigned int numBytes = size * sizeof(double);
44 | *arrayPointer = (double*) malloc(numBytes);
45 | if (arrayPointer == NULL) {
46 | return DOUBLE_ARRAY_ERROR;
47 | }
48 |
49 | memset(*arrayPointer, 0, numBytes);
50 | return MEMORY_OK;
51 | }
52 |
53 | int newUnsignedCharArray(unsigned int size, unsigned char** arrayPointer) {
54 | unsigned int numBytes = size * sizeof(unsigned char);
55 | *arrayPointer = (unsigned char*) malloc(numBytes);
56 | if (arrayPointer == NULL) {
57 | return UCHAR_ARRAY_ERROR;
58 | }
59 |
60 | memset(*arrayPointer, 0, numBytes);
61 | return MEMORY_OK;
62 | }
63 |
64 | int newFloatArray(unsigned int size, float** arrayPointer) {
65 | unsigned int numBytes = size * sizeof(float);
66 | *arrayPointer = (float*) malloc(numBytes);
67 | if (arrayPointer == NULL) {
68 | return FLOAT_ARRAY_ERROR;
69 | }
70 |
71 | memset(*arrayPointer, 0, numBytes);
72 | return MEMORY_OK;
73 | }
74 |
75 | void freeIntArray(int** arrayPointer) {
76 | if (*arrayPointer != NULL) {
77 | free(*arrayPointer);
78 | *arrayPointer = NULL;
79 | }
80 | }
81 |
82 | void freeUnsignedIntArray(unsigned int** arrayPointer) {
83 | if (*arrayPointer != NULL) {
84 | free(*arrayPointer);
85 | *arrayPointer = NULL;
86 | }
87 | }
88 |
89 | void freeDoubleArray(double** arrayPointer) {
90 | if (*arrayPointer != NULL) {
91 | free(*arrayPointer);
92 | *arrayPointer = NULL;
93 | }
94 | }
95 |
96 | void freeUnsignedCharArray(unsigned char** arrayPointer) {
97 | if (*arrayPointer != NULL) {
98 | free(*arrayPointer);
99 | *arrayPointer = NULL;
100 | }
101 | }
102 |
103 | void freeFloatArray(float** arrayPointer) {
104 | if (*arrayPointer != NULL) {
105 | free(*arrayPointer);
106 | *arrayPointer = NULL;
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/mem_utils.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef MEM_UTILS
18 | #define MEM_UTILS
19 | #endif
20 |
21 | static const int MEMORY_OK = 0;
22 | static const int INT_ARRAY_ERROR = 1;
23 | static const int DOUBLE_ARRAY_ERROR = 2;
24 | static const int UCHAR_ARRAY_ERROR = 3;
25 | static const int FLOAT_ARRAY_ERROR = 4;
26 | static const int JNI_GET_INT_ARRAY_ERROR = 5;
27 |
28 | int newIntArray(unsigned int size, int** arrayPointer);
29 | int newUnsignedIntArray(unsigned int size, unsigned int** arrayPointer);
30 | int newDoubleArray(unsigned int size, double** arrayPointer);
31 | int newUnsignedCharArray(unsigned int size, unsigned char** arrayPointer);
32 | int newFloatArray(unsigned int size, float** arrayPointer);
33 | void freeIntArray(int** arrayPointer);
34 | void freeUnsignedIntArray(unsigned int** arrayPointer);
35 | void freeDoubleArray(double** arrayPointer);
36 | void freeUnsignedCharArray(unsigned char** arrayPointer);
37 | void freeFloatArray(float** arrayPointer);
38 |
--------------------------------------------------------------------------------
/imageeditlibrary/jni/transform.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Lightbox
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef TRANSFORM
18 | #define TRANSFORM
19 | #endif
20 |
21 | static const char FLIP_HORIZONTALLY = 'h';
22 | static const char FLIP_VERTICALLY = 'v';
23 | static const char ROTATE_90 = 'r';
24 | static const char ROTATE_180 = 'u';
25 | static const char CROP = 'c';
26 |
27 | typedef struct {
28 | float cropBounds[4]; //left, top, right, bottom
29 | unsigned char* transforms;
30 | int size;
31 | } TransformList;
32 |
--------------------------------------------------------------------------------
/imageeditlibrary/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\android\android-sdk-windows/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary;
2 |
3 | import android.app.Dialog;
4 | import android.app.ProgressDialog;
5 | import android.content.Context;
6 | import android.support.v7.app.AppCompatActivity;
7 |
8 | import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
9 | import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator;
10 | import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;
11 | import com.nostra13.universalimageloader.core.DisplayImageOptions;
12 | import com.nostra13.universalimageloader.core.ImageLoader;
13 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
14 | import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
15 | import com.nostra13.universalimageloader.core.decode.BaseImageDecoder;
16 | import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
17 | import com.nostra13.universalimageloader.utils.StorageUtils;
18 |
19 | import java.io.File;
20 |
21 | public class BaseActivity extends AppCompatActivity {
22 |
23 | /**
24 | * 检测图片载入框架是否导入 若没有 则导入并初始化
25 | */
26 | protected void checkInitImageLoader() {
27 | if (!ImageLoader.getInstance().isInited()) {
28 | initImageLoader();
29 | }
30 | }
31 |
32 | /**
33 | * 初始化图片载入框架
34 | */
35 | private void initImageLoader() {
36 | File cacheDir = StorageUtils.getCacheDirectory(this);
37 | int MAXMEMONRY = (int) (Runtime.getRuntime().maxMemory());
38 | // System.out.println("dsa-->"+MAXMEMONRY+" "+(MAXMEMONRY/5));//.memoryCache(new
39 | // LruMemoryCache(50 * 1024 * 1024))
40 | DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
41 | .cacheInMemory(true)
42 | .cacheOnDisk(true)
43 | .build();
44 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
45 | this).memoryCacheExtraOptions(480, 800).defaultDisplayImageOptions(defaultOptions)
46 | .diskCacheExtraOptions(480, 800, null).threadPoolSize(3)
47 | .threadPriority(Thread.NORM_PRIORITY - 2)
48 | .tasksProcessingOrder(QueueProcessingType.FIFO)
49 | .denyCacheImageMultipleSizesInMemory()
50 | .memoryCache(new LruMemoryCache(MAXMEMONRY / 5))
51 | .diskCache(new UnlimitedDiskCache(cacheDir))
52 | .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
53 | .imageDownloader(new BaseImageDownloader(this)) // default
54 | .imageDecoder(new BaseImageDecoder(false)) // default
55 | .defaultDisplayImageOptions(DisplayImageOptions.createSimple()).build();
56 |
57 | ImageLoader.getInstance().init(config);
58 | }
59 |
60 | public static Dialog getLoadingDialog(Context context, int titleId,
61 | boolean canCancel) {
62 | return getLoadingDialog(context, context.getString(titleId), canCancel);
63 | }
64 |
65 |
66 | public static Dialog getLoadingDialog(Context context, String title,
67 | boolean canCancel) {
68 | ProgressDialog dialog = new ProgressDialog(context);
69 | dialog.setCancelable(canCancel);
70 | dialog.setMessage(title);
71 | return dialog;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/StrickerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage;
2 |
3 | import android.view.LayoutInflater;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 | import android.widget.BaseAdapter;
7 | import android.widget.ImageView;
8 |
9 | import com.nostra13.universalimageloader.core.DisplayImageOptions;
10 | import com.nostra13.universalimageloader.core.ImageLoader;
11 | import com.yjing.imageeditlibrary.R;
12 | import com.yjing.imageeditlibrary.editimage.fragment.StirckerFragment;
13 |
14 | import java.io.File;
15 | import java.io.IOException;
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | /**
20 | * Created by wangyanjing on 2018/2/27.
21 | */
22 |
23 | public class StrickerAdapter extends BaseAdapter {
24 |
25 | public DisplayImageOptions imageOption = new DisplayImageOptions.Builder()
26 | .cacheInMemory(true).showImageOnLoading(R.drawable.yd_image_tx)
27 | .build();// 下载图片显示
28 |
29 | private final StirckerFragment mStirckerFragment;
30 | private List pathList = new ArrayList();// 图片路径列表
31 |
32 | public static final String[] stickerPath = {"stickers/type1", "stickers/type2", "stickers/type3", "stickers/type4", "stickers/type5", "stickers/type6"};
33 |
34 | public StrickerAdapter(StirckerFragment fragment) {
35 | super();
36 | this.mStirckerFragment = fragment;
37 | for (String path : stickerPath) {
38 | addStickerImages(path);
39 | }
40 | }
41 |
42 | @Override
43 | public int getCount() {
44 | return pathList.size();
45 | }
46 |
47 | @Override
48 | public Object getItem(int i) {
49 | return pathList.get(i);
50 | }
51 |
52 | @Override
53 | public long getItemId(int i) {
54 | return i;
55 | }
56 |
57 | @Override
58 | public View getView(int i, View view, ViewGroup viewGroup) {
59 |
60 | View v = null;
61 | v = LayoutInflater.from(viewGroup.getContext()).inflate(
62 | R.layout.view_sticker_item, viewGroup, false);
63 | ImageHolder imageHoler = new ImageHolder(v);
64 |
65 | String path = pathList.get(i);
66 | ImageLoader.getInstance().displayImage("assets://" + path,
67 | imageHoler.image, imageOption);
68 | v.setTag(path);
69 |
70 | imageHoler.image.setOnClickListener(new View.OnClickListener() {
71 | @Override
72 | public void onClick(View view) {
73 | mStirckerFragment.selectedStickerItem((String) view.getTag());
74 | }
75 | });
76 | return v;
77 | }
78 |
79 |
80 | public class ImageHolder {
81 | public ImageView image;
82 |
83 | public ImageHolder(View itemView) {
84 | this.image = (ImageView) itemView.findViewById(R.id.img);
85 | }
86 | }// end inner class
87 |
88 | public void addStickerImages(String folderPath) {
89 | pathList.clear();
90 | try {
91 | String[] files = mStirckerFragment.getActivity().getAssets()
92 | .list(folderPath);
93 | for (String name : files) {
94 | pathList.add(folderPath + File.separator + name);
95 | }
96 | } catch (IOException e) {
97 | e.printStackTrace();
98 | }
99 | this.notifyDataSetChanged();
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/fragment/BaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.fragment;
2 |
3 |
4 | import android.support.v4.app.Fragment;
5 |
6 | import com.yjing.imageeditlibrary.editimage.EditImageActivity;
7 | import com.yjing.imageeditlibrary.editimage.contorl.SaveMode;
8 |
9 | public abstract class BaseFragment extends Fragment {
10 |
11 | public BaseFragment() {
12 | }
13 |
14 | protected EditImageActivity activity;
15 |
16 | @Override
17 | public void onHiddenChanged(boolean hidden) {
18 | super.onHiddenChanged(hidden);
19 |
20 | switch (SaveMode.getInstant().getMode()) {
21 | case PAINT:
22 |
23 | }
24 | if (hidden) {
25 |
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/inter/EditFunctionOperationInterface.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.inter;
2 |
3 | /**
4 | * Created by wangyanjing on 2017/5/9.
5 | */
6 |
7 | public interface EditFunctionOperationInterface {
8 | void setIsOperation(boolean isOperation);
9 | Boolean getIsOperation();
10 | }
11 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/inter/ImageEditInte.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.inter;
2 |
3 | /**
4 | * Created by wangyanjing on 2017/4/13.
5 | */
6 |
7 | public interface ImageEditInte {
8 | void appleEdit(SaveCompletedInte inte);
9 |
10 | /**
11 | * 退出当前模式要保存的一些状态,或者改变
12 | */
13 | void backToMain();
14 |
15 | void onShow();
16 |
17 | void method2();
18 |
19 | void method3();
20 | }
21 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/inter/SaveCompletedInte.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.inter;
2 |
3 | /**
4 | * Created by wangyanjing on 2017/4/19.
5 | */
6 |
7 | public interface SaveCompletedInte {
8 | void completed();
9 | }
10 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/model/RatioItem.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.model;
2 |
3 | public class RatioItem {
4 | private String text;
5 | private Float ratio;
6 | private int index;
7 |
8 | public RatioItem(String text, Float ratio) {
9 | super();
10 | this.text = text;
11 | this.ratio = ratio;
12 | }
13 |
14 | public String getText() {
15 | return text;
16 | }
17 |
18 | public void setText(String text) {
19 | this.text = text;
20 | }
21 |
22 | public Float getRatio() {
23 | return ratio;
24 | }
25 |
26 | public void setRatio(Float ratio) {
27 | this.ratio = ratio;
28 | }
29 |
30 |
31 | public int getIndex() {
32 | return index;
33 | }
34 |
35 | public void setIndex(int index) {
36 | this.index = index;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/model/StickerBean.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.model;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class StickerBean {
7 | private String coverPath;//封面路径
8 | private List pathList;
9 |
10 | public StickerBean() {
11 | pathList = new ArrayList();
12 | }
13 |
14 | public String getCoverPath() {
15 | return coverPath;
16 | }
17 |
18 | public void setCoverPath(String coverPath) {
19 | this.coverPath = coverPath;
20 | }
21 |
22 | public List getPathList() {
23 | return pathList;
24 | }
25 |
26 | public void setPathList(List pathList) {
27 | this.pathList = pathList;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/task/StickerTask.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.task;
2 |
3 | import android.annotation.TargetApi;
4 | import android.app.Dialog;
5 | import android.graphics.Bitmap;
6 | import android.graphics.Canvas;
7 | import android.graphics.Matrix;
8 | import android.os.AsyncTask;
9 | import android.os.Build;
10 |
11 | import com.yjing.imageeditlibrary.R;
12 | import com.yjing.imageeditlibrary.editimage.EditImageActivity;
13 | import com.yjing.imageeditlibrary.editimage.inter.SaveCompletedInte;
14 | import com.yjing.imageeditlibrary.utils.Matrix3;
15 |
16 | /**
17 | * 贴图合成任务 抽象类
18 | */
19 | public abstract class StickerTask extends AsyncTask {
20 | private final SaveCompletedInte inte;
21 | private Dialog dialog;
22 |
23 | private EditImageActivity mContext;
24 |
25 | public StickerTask(EditImageActivity activity, SaveCompletedInte saveInte) {
26 | this.mContext = activity;
27 | this.inte = saveInte;
28 | }
29 |
30 | @Override
31 | protected void onPreExecute() {
32 | super.onPreExecute();
33 |
34 | if (mContext.isFinishing())
35 | return;
36 |
37 | dialog = mContext.getLoadingDialog(mContext, R.string.saving_image,
38 | false);
39 | dialog.show();
40 | }
41 |
42 | @Override
43 | protected Bitmap doInBackground(Bitmap... params) {
44 | // System.out.println("保存贴图!");
45 | Matrix touchMatrix = mContext.mainImage.getImageViewMatrix();
46 |
47 | Bitmap resultBit = Bitmap.createBitmap(params[0]).copy(
48 | Bitmap.Config.RGB_565, true);
49 | Canvas canvas = new Canvas(resultBit);
50 |
51 | float[] data = new float[9];
52 | touchMatrix.getValues(data);// 底部图片变化记录矩阵原始数据
53 | Matrix3 cal = new Matrix3(data);// 辅助矩阵计算类
54 | Matrix3 inverseMatrix = cal.inverseMatrix();// 计算逆矩阵
55 | Matrix m = new Matrix();
56 | m.setValues(inverseMatrix.getValues());
57 |
58 | handleImage(canvas, m);
59 |
60 | //BitmapUtils.saveBitmap(resultBit, mContext.saveFilePath);
61 | return resultBit;
62 | }
63 |
64 | @Override
65 | protected void onCancelled() {
66 | super.onCancelled();
67 | dialog.dismiss();
68 | }
69 |
70 | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
71 | @Override
72 | protected void onCancelled(Bitmap result) {
73 | super.onCancelled(result);
74 | dialog.dismiss();
75 | }
76 |
77 | @Override
78 | protected void onPostExecute(Bitmap result) {
79 | super.onPostExecute(result);
80 | onPostResult(result);
81 |
82 | mContext.runOnUiThread(new Runnable() {
83 | @Override
84 | public void run() {
85 | if (inte != null) {
86 | inte.completed();
87 | }
88 | }
89 | });
90 |
91 | dialog.dismiss();
92 | }
93 |
94 | public abstract void handleImage(Canvas canvas, Matrix m);
95 |
96 | public abstract void onPostResult(Bitmap result);
97 | }
98 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/Constants.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view;
2 |
3 | public class Constants {
4 | public static final int STICKER_BTN_HALF_SIZE = 30;
5 | }
6 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/CustomViewPager.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 |
7 | /**
8 | * 禁用ViewPager滑动事件
9 | *
10 | */
11 | public class CustomViewPager extends ViewPager {
12 | private boolean isCanScroll = false;
13 |
14 | public CustomViewPager(Context context) {
15 | super(context);
16 | }
17 |
18 | @Override
19 | public void setCurrentItem(int item, boolean smoothScroll) {
20 | isCanScroll = true;
21 | super.setCurrentItem(item, smoothScroll);
22 | isCanScroll = false;
23 | }
24 |
25 | @Override
26 | public void setCurrentItem(int item) {
27 | setCurrentItem(item, false);
28 | }
29 |
30 | public CustomViewPager(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | }
33 |
34 | public void setScanScroll(boolean isCanScroll) {
35 | this.isCanScroll = isCanScroll;
36 | }
37 |
38 | @Override
39 | public void scrollTo(int x, int y) {
40 | if (isCanScroll) {
41 | super.scrollTo(x, y);
42 | }
43 | }
44 | }// end class
45 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/PaintModeView.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.os.Build;
8 | import android.support.annotation.RequiresApi;
9 | import android.util.AttributeSet;
10 | import android.view.MotionEvent;
11 | import android.view.View;
12 |
13 | import com.yjing.imageeditlibrary.editimage.inter.EditFunctionOperationInterface;
14 |
15 | import static android.R.attr.x;
16 |
17 | public class PaintModeView extends View implements EditFunctionOperationInterface {
18 | private Paint mPaint;
19 |
20 | private int mStokeColor;
21 | private float mStokeWidth =x -1;
22 |
23 | private float mRadius;
24 | private boolean isOperation = false;
25 |
26 | public PaintModeView(Context context) {
27 | super(context);
28 | initView(context);
29 | }
30 |
31 | public PaintModeView(Context context, AttributeSet attrs) {
32 | super(context, attrs);
33 | initView(context);
34 | }
35 |
36 | public PaintModeView(Context context, AttributeSet attrs, int defStyleAttr) {
37 | super(context, attrs, defStyleAttr);
38 | initView(context);
39 | }
40 |
41 | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
42 | public PaintModeView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
43 | super(context, attrs, defStyleAttr, defStyleRes);
44 | initView(context);
45 | }
46 |
47 | protected void initView(Context context) {
48 | mPaint = new Paint();
49 | mPaint.setAntiAlias(true);
50 | mPaint.setColor(Color.RED);
51 |
52 | //mStokeWidth = 10;
53 | //mStokeColor = Color.RED;
54 | }
55 |
56 | @Override
57 | protected void onDraw(Canvas canvas) {
58 | super.onDraw(canvas);
59 | mPaint.setColor(mStokeColor);
60 | mRadius = mStokeWidth;
61 |
62 | canvas.drawCircle(getWidth() >> 1, getHeight() >> 1, mRadius, mPaint);
63 | }
64 |
65 | public void setPaintStrokeColor(final int newColor) {
66 | this.mStokeColor = newColor;
67 | this.invalidate();
68 | }
69 |
70 | public void setPaintStrokeWidth(final float width) {
71 | this.mStokeWidth = width;
72 | this.invalidate();
73 | }
74 |
75 | public float getStokenWidth() {
76 | if (mStokeWidth < 0) {
77 | mStokeWidth = getMeasuredHeight();
78 | }
79 | return mStokeWidth;
80 | }
81 |
82 | public int getStokenColor() {
83 | return mStokeColor;
84 | }
85 |
86 | @Override
87 | public boolean onTouchEvent(MotionEvent event) {
88 | return isOperation ? super.onTouchEvent(event) : isOperation;
89 | }
90 |
91 | @Override
92 | public void setIsOperation(boolean isOperation) {
93 | this.isOperation = isOperation;
94 | }
95 |
96 | @Override
97 | public Boolean getIsOperation() {
98 | return null;
99 | }
100 | }//end class
101 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/PaintPath.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view;
2 |
3 | import android.graphics.Paint;
4 | import android.graphics.Path;
5 |
6 | /**
7 | * 装饰设计模式
8 | * 一段路径 包含path对象和paint对象的一些信息
9 | * Created by wangyanjing on 2017/5/17.
10 | */
11 |
12 | class PaintPath {
13 |
14 |
15 | private final Path path;
16 | private final Paint paint;
17 |
18 | public PaintPath(Path path, Paint paint) {
19 | this.path = path;
20 | this.paint = paint;
21 | }
22 |
23 | public Path getPath() {
24 | return path;
25 | }
26 |
27 | public Paint getPaint() {
28 | return paint;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/RotateImageView.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.graphics.Canvas;
6 | import android.graphics.Matrix;
7 | import android.graphics.Paint;
8 | import android.graphics.Rect;
9 | import android.graphics.RectF;
10 | import android.util.AttributeSet;
11 | import android.view.View;
12 |
13 | import com.yjing.imageeditlibrary.utils.PaintUtil;
14 |
15 | /**
16 | * 旋转图片
17 | *
18 | */
19 | public class RotateImageView extends View {
20 | private Rect srcRect;
21 | private RectF dstRect;
22 | private Rect maxRect;// 最大限制矩形框
23 |
24 | private Bitmap bitmap;
25 | private Matrix matrix = new Matrix();// 辅助计算矩形
26 |
27 | private float scale;// 缩放比率
28 | private int rotateAngle;
29 |
30 | private RectF wrapRect = new RectF();// 图片包围矩形
31 | private Paint bottomPaint;
32 | private RectF originImageRect;
33 |
34 | public RotateImageView(Context context) {
35 | super(context);
36 | init(context);
37 | }
38 |
39 | public RotateImageView(Context context, AttributeSet attrs) {
40 | super(context, attrs);
41 | init(context);
42 | }
43 |
44 | public RotateImageView(Context context, AttributeSet attrs, int defStyleAttr) {
45 | super(context, attrs, defStyleAttr);
46 | init(context);
47 | }
48 |
49 | private void init(Context context) {
50 | srcRect = new Rect();
51 | dstRect = new RectF();
52 | maxRect = new Rect();
53 | bottomPaint = PaintUtil.newRotateBottomImagePaint();
54 | originImageRect = new RectF();
55 | }
56 |
57 | public void addBit(Bitmap bit, RectF imageRect) {
58 | bitmap = bit;
59 | srcRect.set(0, 0, bitmap.getWidth(), bitmap.getHeight());
60 | dstRect = imageRect;
61 |
62 | originImageRect.set(0, 0, bit.getWidth(), bit.getHeight());
63 | this.invalidate();
64 | }
65 |
66 | public void rotateImage(int angle) {
67 | rotateAngle = angle;
68 | this.invalidate();
69 | }
70 |
71 | public void reset() {
72 | rotateAngle = 0;
73 | scale = 1;
74 | invalidate();
75 | }
76 |
77 | @Override
78 | public void draw(Canvas canvas) {
79 | super.draw(canvas);
80 | if (bitmap == null)
81 | return;
82 | maxRect.set(0, 0, getWidth(), getHeight());// 最大边界矩形
83 |
84 | calculateWrapBox();
85 | scale = 1;
86 | if (wrapRect.width() > getWidth()) {
87 | scale = getWidth() / wrapRect.width();
88 | }
89 |
90 | // 绘制图形
91 | canvas.save();
92 | canvas.scale(scale, scale, canvas.getWidth() >> 1,
93 | canvas.getHeight() >> 1);
94 | canvas.drawRect(wrapRect, bottomPaint);
95 | canvas.rotate(rotateAngle, canvas.getWidth() >> 1,
96 | canvas.getHeight() >> 1);
97 | canvas.drawBitmap(bitmap, srcRect, dstRect, null);
98 | canvas.restore();
99 | }
100 |
101 | /**
102 | * 计算出矩形包围盒
103 | */
104 | private void calculateWrapBox() {
105 | wrapRect.set(dstRect);
106 | matrix.reset();// 重置矩阵为单位矩阵
107 | int centerX = getWidth() >> 1;
108 | int centerY = getHeight() >> 1;
109 | matrix.postRotate(rotateAngle, centerX, centerY);// 旋转后的角度
110 | // System.out.println("旋转之前-->" + wrapRect.left + " " + wrapRect.top
111 | // + " " + wrapRect.right + " " + wrapRect.bottom);
112 | matrix.mapRect(wrapRect);
113 | // System.out.println("旋转之后-->" + wrapRect.left + " " + wrapRect.top
114 | // + " " + wrapRect.right + " " + wrapRect.bottom);
115 | }
116 |
117 | /**
118 | * 取得旋转后新图片的大小
119 | *
120 | * @return
121 | */
122 | public RectF getImageNewRect() {
123 | Matrix m = new Matrix();
124 | m.postRotate(this.rotateAngle, originImageRect.centerX(),
125 | originImageRect.centerY());
126 | m.mapRect(originImageRect);
127 | return originImageRect;
128 | }
129 |
130 | /**
131 | * 缩放比率
132 | * @return
133 | */
134 | public synchronized float getScale() {
135 | return scale;
136 | }
137 |
138 | /**
139 | * 旋转角度
140 | * @return
141 | */
142 | public synchronized int getRotateAngle() {
143 | return rotateAngle;
144 | }
145 | }// end class
146 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Back.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Back implements Easing {
4 |
5 | @Override
6 | public double easeOut( double time, double start, double end, double duration ) {
7 | return easeOut( time, start, end, duration, 0 );
8 | }
9 |
10 | @Override
11 | public double easeIn( double time, double start, double end, double duration ) {
12 | return easeIn( time, start, end, duration, 0 );
13 | }
14 |
15 | @Override
16 | public double easeInOut( double time, double start, double end, double duration ) {
17 | return easeInOut( time, start, end, duration, 0.9 );
18 | }
19 |
20 | public double easeIn( double t, double b, double c, double d, double s ) {
21 | if ( s == 0 ) s = 1.70158;
22 | return c * ( t /= d ) * t * ( ( s + 1 ) * t - s ) + b;
23 | }
24 |
25 | public double easeOut( double t, double b, double c, double d, double s ) {
26 | if ( s == 0 ) s = 1.70158;
27 | return c * ( ( t = t / d - 1 ) * t * ( ( s + 1 ) * t + s ) + 1 ) + b;
28 | }
29 |
30 | public double easeInOut( double t, double b, double c, double d, double s ) {
31 | if ( s == 0 ) s = 1.70158;
32 | if ( ( t /= d / 2 ) < 1 ) return c / 2 * ( t * t * ( ( ( s *= ( 1.525 ) ) + 1 ) * t - s ) ) + b;
33 | return c / 2 * ( ( t -= 2 ) * t * ( ( ( s *= ( 1.525 ) ) + 1 ) * t + s ) + 2 ) + b;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Bounce.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Bounce implements Easing {
4 |
5 | @Override
6 | public double easeOut( double t, double b, double c, double d ) {
7 | if ( ( t /= d ) < ( 1.0 / 2.75 ) ) {
8 | return c * ( 7.5625 * t * t ) + b;
9 | } else if ( t < ( 2.0 / 2.75 ) ) {
10 | return c * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + .75 ) + b;
11 | } else if ( t < ( 2.5 / 2.75 ) ) {
12 | return c * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + .9375 ) + b;
13 | } else {
14 | return c * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + .984375 ) + b;
15 | }
16 | }
17 |
18 | @Override
19 | public double easeIn( double t, double b, double c, double d ) {
20 | return c - easeOut( d - t, 0, c, d ) + b;
21 | }
22 |
23 | @Override
24 | public double easeInOut( double t, double b, double c, double d ) {
25 | if ( t < d / 2.0 )
26 | return easeIn( t * 2.0, 0, c, d ) * .5 + b;
27 | else
28 | return easeOut( t * 2.0 - d, 0, c, d ) * .5 + c * .5 + b;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Circ.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Circ implements Easing {
4 |
5 | @Override
6 | public double easeOut( double time, double start, double end, double duration ) {
7 | return end * Math.sqrt( 1.0 - ( time = time / duration - 1.0 ) * time ) + start;
8 | }
9 |
10 | @Override
11 | public double easeIn( double time, double start, double end, double duration ) {
12 | return -end * ( Math.sqrt( 1.0 - ( time /= duration ) * time ) - 1.0 ) + start;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double time, double start, double end, double duration ) {
17 | if ( ( time /= duration / 2 ) < 1 ) return -end / 2.0 * ( Math.sqrt( 1.0 - time * time ) - 1.0 ) + start;
18 | return end / 2.0 * ( Math.sqrt( 1.0 - ( time -= 2.0 ) * time ) + 1.0 ) + start;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Cubic.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Cubic implements Easing {
4 |
5 | @Override
6 | public double easeOut( double time, double start, double end, double duration ) {
7 | return end * ( ( time = time / duration - 1.0 ) * time * time + 1.0 ) + start;
8 | }
9 |
10 | @Override
11 | public double easeIn( double time, double start, double end, double duration ) {
12 | return end * ( time /= duration ) * time * time + start;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double time, double start, double end, double duration ) {
17 | if ( ( time /= duration / 2.0 ) < 1.0 ) return end / 2.0 * time * time * time + start;
18 | return end / 2.0 * ( ( time -= 2.0 ) * time * time + 2.0 ) + start;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Easing.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public interface Easing {
4 |
5 | double easeOut(double time, double start, double end, double duration);
6 |
7 | double easeIn(double time, double start, double end, double duration);
8 |
9 | double easeInOut(double time, double start, double end, double duration);
10 | }
11 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Elastic.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Elastic implements Easing {
4 |
5 | @Override
6 | public double easeIn( double time, double start, double end, double duration ) {
7 | return easeIn( time, start, end, duration, start + end, duration );
8 | }
9 |
10 | public double easeIn( double t, double b, double c, double d, double a, double p ) {
11 | double s;
12 | if ( t == 0 ) return b;
13 | if ( ( t /= d ) == 1 ) return b + c;
14 | if ( !( p > 0 ) ) p = d * .3;
15 | if ( !( a > 0 ) || a < Math.abs( c ) ) {
16 | a = c;
17 | s = p / 4;
18 | } else
19 | s = p / ( 2 * Math.PI ) * Math.asin( c / a );
20 | return -( a * Math.pow( 2, 10 * ( t -= 1 ) ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) ) + b;
21 | }
22 |
23 | @Override
24 | public double easeOut( double time, double start, double end, double duration ) {
25 | return easeOut( time, start, end, duration, start + end, duration );
26 | }
27 |
28 | public double easeOut( double t, double b, double c, double d, double a, double p ) {
29 | double s;
30 | if ( t == 0 ) return b;
31 | if ( ( t /= d ) == 1 ) return b + c;
32 | if ( !( p > 0 ) ) p = d * .3;
33 | if ( !( a > 0 ) || a < Math.abs( c ) ) {
34 | a = c;
35 | s = p / 4;
36 | } else
37 | s = p / ( 2 * Math.PI ) * Math.asin( c / a );
38 | return ( a * Math.pow( 2, -10 * t ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) + c + b );
39 | }
40 |
41 | @Override
42 | public double easeInOut( double t, double b, double c, double d ) {
43 | return easeInOut( t, b, c, d, b + c, d );
44 | }
45 |
46 | public double easeInOut( double t, double b, double c, double d, double a, double p ) {
47 | double s;
48 |
49 | if ( t == 0 ) return b;
50 | if ( ( t /= d / 2 ) == 2 ) return b + c;
51 | if ( !( p > 0 ) ) p = d * ( .3 * 1.5 );
52 | if ( !( a > 0 ) || a < Math.abs( c ) ) {
53 | a = c;
54 | s = p / 4;
55 | } else
56 | s = p / ( 2 * Math.PI ) * Math.asin( c / a );
57 | if ( t < 1 ) return -.5 * ( a * Math.pow( 2, 10 * ( t -= 1 ) ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) ) + b;
58 | return a * Math.pow( 2, -10 * ( t -= 1 ) ) * Math.sin( ( t * d - s ) * ( 2 * Math.PI ) / p ) * .5 + c + b;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Expo.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Expo implements Easing {
4 |
5 | @Override
6 | public double easeOut( double time, double start, double end, double duration ) {
7 | return ( time == duration ) ? start + end : end * ( -Math.pow( 2.0, -10.0 * time / duration ) + 1 ) + start;
8 | }
9 |
10 | @Override
11 | public double easeIn( double time, double start, double end, double duration ) {
12 | return ( time == 0 ) ? start : end * Math.pow( 2.0, 10.0 * ( time / duration - 1.0 ) ) + start;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double time, double start, double end, double duration ) {
17 | if ( time == 0 ) return start;
18 | if ( time == duration ) return start + end;
19 | if ( ( time /= duration / 2.0 ) < 1.0 ) return end / 2.0 * Math.pow( 2.0, 10.0 * ( time - 1.0 ) ) + start;
20 | return end / 2.0 * ( -Math.pow( 2.0, -10.0 * --time ) + 2.0 ) + start;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Linear.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Linear implements Easing {
4 |
5 | public double easeNone( double time, double start, double end, double duration ) {
6 | return end * time / duration + start;
7 | }
8 |
9 | @Override
10 | public double easeOut( double time, double start, double end, double duration ) {
11 | return end * time / duration + start;
12 | }
13 |
14 | @Override
15 | public double easeIn( double time, double start, double end, double duration ) {
16 | return end * time / duration + start;
17 | }
18 |
19 | @Override
20 | public double easeInOut( double time, double start, double end, double duration ) {
21 | return end * time / duration + start;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Quad.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Quad implements Easing {
4 |
5 | @Override
6 | public double easeOut( double t, double b, double c, double d ) {
7 | return -c * ( t /= d ) * ( t - 2 ) + b;
8 | }
9 |
10 | @Override
11 | public double easeIn( double t, double b, double c, double d ) {
12 | return c * ( t /= d ) * t + b;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double t, double b, double c, double d ) {
17 | if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t + b;
18 | return -c / 2 * ( ( --t ) * ( t - 2 ) - 1 ) + b;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Quart.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Quart implements Easing {
4 |
5 | @Override
6 | public double easeOut( double t, double b, double c, double d ) {
7 | return -c * ( ( t = t / d - 1 ) * t * t * t - 1 ) + b;
8 | }
9 |
10 | @Override
11 | public double easeIn( double t, double b, double c, double d ) {
12 | return c * ( t /= d ) * t * t * t + b;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double t, double b, double c, double d ) {
17 | if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t + b;
18 | return -c / 2 * ( ( t -= 2 ) * t * t * t - 2 ) + b;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Quint.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Quint implements Easing {
4 |
5 | @Override
6 | public double easeOut( double t, double b, double c, double d ) {
7 | return c * ( ( t = t / d - 1 ) * t * t * t * t + 1 ) + b;
8 | }
9 |
10 | @Override
11 | public double easeIn( double t, double b, double c, double d ) {
12 | return c * ( t /= d ) * t * t * t * t + b;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double t, double b, double c, double d ) {
17 | if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t * t + b;
18 | return c / 2 * ( ( t -= 2 ) * t * t * t * t + 2 ) + b;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/easing/Sine.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.easing;
2 |
3 | public class Sine implements Easing {
4 |
5 | @Override
6 | public double easeOut( double t, double b, double c, double d ) {
7 | return c * Math.sin( t / d * ( Math.PI / 2 ) ) + b;
8 | }
9 |
10 | @Override
11 | public double easeIn( double t, double b, double c, double d ) {
12 | return -c * Math.cos( t / d * ( Math.PI / 2 ) ) + c + b;
13 | }
14 |
15 | @Override
16 | public double easeInOut( double t, double b, double c, double d ) {
17 | return -c / 2 * ( Math.cos( Math.PI * t / d ) - 1 ) + b;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/graphic/FastBitmapDrawable.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.graphic;
2 |
3 | import java.io.InputStream;
4 | import android.content.res.Resources;
5 | import android.graphics.Bitmap;
6 | import android.graphics.BitmapFactory;
7 | import android.graphics.Canvas;
8 | import android.graphics.ColorFilter;
9 | import android.graphics.Paint;
10 | import android.graphics.PixelFormat;
11 | import android.graphics.drawable.Drawable;
12 |
13 | /**
14 | * Fast bitmap drawable. Does not support states. it only
15 | * support alpha and colormatrix
16 | * @author alessandro
17 | *
18 | */
19 | public class FastBitmapDrawable extends Drawable implements IBitmapDrawable {
20 |
21 | protected Bitmap mBitmap;
22 | protected Paint mPaint;
23 |
24 | public FastBitmapDrawable( Bitmap b ) {
25 | mBitmap = b;
26 | mPaint = new Paint();
27 | mPaint.setDither( true );
28 | mPaint.setFilterBitmap( true );
29 | }
30 |
31 | public FastBitmapDrawable( Resources res, InputStream is ){
32 | this(BitmapFactory.decodeStream(is));
33 | }
34 |
35 | @Override
36 | public void draw( Canvas canvas ) {
37 | canvas.drawBitmap( mBitmap, 0.0f, 0.0f, mPaint );
38 | }
39 |
40 | @Override
41 | public int getOpacity() {
42 | return PixelFormat.TRANSLUCENT;
43 | }
44 |
45 | @Override
46 | public void setAlpha( int alpha ) {
47 | mPaint.setAlpha( alpha );
48 | }
49 |
50 | @Override
51 | public void setColorFilter( ColorFilter cf ) {
52 | mPaint.setColorFilter( cf );
53 | }
54 |
55 | @Override
56 | public int getIntrinsicWidth() {
57 | return mBitmap.getWidth();
58 | }
59 |
60 | @Override
61 | public int getIntrinsicHeight() {
62 | return mBitmap.getHeight();
63 | }
64 |
65 | @Override
66 | public int getMinimumWidth() {
67 | return mBitmap.getWidth();
68 | }
69 |
70 | @Override
71 | public int getMinimumHeight() {
72 | return mBitmap.getHeight();
73 | }
74 |
75 | public void setAntiAlias( boolean value ){
76 | mPaint.setAntiAlias( value );
77 | invalidateSelf();
78 | }
79 |
80 | @Override
81 | public Bitmap getBitmap() {
82 | return mBitmap;
83 | }
84 | }
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/graphic/IBitmapDrawable.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.graphic;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | public interface IBitmapDrawable {
6 |
7 | Bitmap getBitmap();
8 | }
9 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/utils/IDisposable.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.utils;
2 |
3 | public interface IDisposable {
4 | void dispose();
5 | }
6 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/imagezoom/utils/IOUtils.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.editimage.view.imagezoom.utils;
2 |
3 | import java.io.Closeable;
4 | import android.content.ContentResolver;
5 | import android.content.Context;
6 | import android.database.Cursor;
7 | import android.net.Uri;
8 | import android.os.ParcelFileDescriptor;
9 | import android.provider.MediaStore.Images.ImageColumns;
10 |
11 | /**
12 | * Various I/O utilities
13 | *
14 | * @author alessandro
15 | *
16 | */
17 | public class IOUtils {
18 |
19 | /**
20 | * Close a {@link Closeable} stream without throwing any exception
21 | *
22 | * @param c
23 | */
24 | public static void closeSilently( final Closeable c ) {
25 | if ( c == null ) return;
26 | try {
27 | c.close();
28 | } catch ( final Throwable t ) {}
29 | }
30 |
31 | public static void closeSilently( final ParcelFileDescriptor c ) {
32 | if ( c == null ) return;
33 | try {
34 | c.close();
35 | } catch ( final Throwable t ) {}
36 | }
37 |
38 | public static void closeSilently( Cursor cursor ) {
39 | if ( cursor == null ) return;
40 | try {
41 | if ( cursor != null ) cursor.close();
42 | } catch ( Throwable t ) {}
43 | }
44 |
45 | /**
46 | * Try to return the absolute file path from the given Uri
47 | *
48 | * @param context
49 | * @param uri
50 | * @return the file path or null
51 | */
52 | public static String getRealFilePath( final Context context, final Uri uri ) {
53 |
54 | if ( null == uri ) return null;
55 |
56 | final String scheme = uri.getScheme();
57 | String data = null;
58 |
59 | if ( scheme == null )
60 | data = uri.getPath();
61 | else if ( ContentResolver.SCHEME_FILE.equals( scheme ) ) {
62 | data = uri.getPath();
63 | } else if ( ContentResolver.SCHEME_CONTENT.equals( scheme ) ) {
64 | Cursor cursor = context.getContentResolver().query( uri, new String[] { ImageColumns.DATA }, null, null, null );
65 | if ( null != cursor ) {
66 | if ( cursor.moveToFirst() ) {
67 | int index = cursor.getColumnIndex( ImageColumns.DATA );
68 | if ( index > -1 ) {
69 | data = cursor.getString( index );
70 | }
71 | }
72 | cursor.close();
73 | }
74 | }
75 | return data;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/editimage/view/mosaic/MosaicPath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 jarlen
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *
16 | */
17 | package com.yjing.imageeditlibrary.editimage.view.mosaic;
18 |
19 | import android.graphics.Path;
20 |
21 | /**
22 | * @author jarlen
23 | */
24 | public class MosaicPath
25 | {
26 | /**
27 | * 绘画路径
28 | */
29 | public Path drawPath;
30 |
31 | /**
32 | * 绘画粗细
33 | */
34 | public int paintWidth;
35 |
36 | /**
37 | * 马赛克效果
38 | */
39 | public MosaicUtil.Effect effect;
40 | }
41 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/BucketItem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Thomas Hoffmann
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yjing.imageeditlibrary.picchooser;
17 |
18 | class BucketItem extends GridItem {
19 |
20 | final int id;
21 | int images = 1;
22 |
23 | /**
24 | * Creates a new BucketItem
25 | *
26 | * @param n the name of the bucket
27 | * @param p the absolute path to the bucket
28 | * @param i the bucket ID
29 | */
30 | public BucketItem(final String n, final String p, final String taken, int i) {
31 | super(n, p, taken, 0);
32 | id = i;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/BucketsFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Thomas Hoffmann
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yjing.imageeditlibrary.picchooser;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | import android.database.Cursor;
22 | import android.os.Bundle;
23 | import android.provider.MediaStore;
24 | import android.support.v4.app.Fragment;
25 | import android.view.LayoutInflater;
26 | import android.view.View;
27 | import android.view.ViewGroup;
28 | import android.widget.AdapterView;
29 | import android.widget.AdapterView.OnItemClickListener;
30 | import android.widget.GridView;
31 | import android.widget.Toast;
32 |
33 | import com.yjing.imageeditlibrary.R;
34 |
35 |
36 | public class BucketsFragment extends Fragment {
37 |
38 | @Override
39 | public View onCreateView(final LayoutInflater inflater,
40 | final ViewGroup container, final Bundle savedInstanceState) {
41 | View v = inflater.inflate(R.layout.gallery, null);
42 |
43 | String[] projection = new String[]{MediaStore.Images.Media.DATA,
44 | MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
45 | MediaStore.Images.Media.BUCKET_ID};
46 |
47 | Cursor cur = getActivity().getContentResolver().query(
48 | MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
49 | projection,
50 | null,
51 | null,
52 | MediaStore.Images.Media.BUCKET_DISPLAY_NAME + " ASC, "
53 | + MediaStore.Images.Media.DATE_MODIFIED + " DESC");
54 |
55 | final List buckets = new ArrayList();
56 | BucketItem lastBucket = null;
57 |
58 | if (cur != null) {
59 | if (cur.moveToFirst()) {
60 | while (!cur.isAfterLast()) {
61 | if (lastBucket == null
62 | || !lastBucket.name.equals(cur.getString(1))) {
63 | lastBucket = new BucketItem(cur.getString(1),
64 | cur.getString(0), "", cur.getInt(2));
65 | buckets.add(lastBucket);
66 | } else {
67 | lastBucket.images++;
68 | }
69 | cur.moveToNext();
70 | }
71 | }
72 | cur.close();
73 | }
74 |
75 | if (buckets.isEmpty()) {
76 | Toast.makeText(getActivity(), R.string.no_images,
77 | Toast.LENGTH_SHORT).show();
78 | getActivity().finish();
79 | } else {
80 | GridView grid = (GridView) v.findViewById(R.id.grid);
81 | grid.setAdapter(new GalleryAdapter(getActivity(), buckets));
82 | grid.setOnItemClickListener(new OnItemClickListener() {
83 | @Override
84 | public void onItemClick(AdapterView> parent, View view,
85 | int position, long id) {
86 | ((SelectPictureActivity) getActivity())
87 | .showBucket(((BucketItem) buckets.get(position)).id);
88 | }
89 | });
90 | }
91 | return v;
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/GalleryAdapter.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.picchooser;
2 |
3 | import java.util.List;
4 |
5 | import android.content.Context;
6 | import android.graphics.Bitmap;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.BaseAdapter;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | import com.nostra13.universalimageloader.core.DisplayImageOptions;
15 | import com.nostra13.universalimageloader.core.ImageLoader;
16 | import com.nostra13.universalimageloader.core.assist.ImageScaleType;
17 | import com.yjing.imageeditlibrary.R;
18 |
19 |
20 | class GalleryAdapter extends BaseAdapter {
21 |
22 | private final Context context;
23 | private final List items;
24 | private final LayoutInflater mInflater;
25 |
26 | private static final DisplayImageOptions options = new DisplayImageOptions.Builder()
27 | .resetViewBeforeLoading(true)
28 | .cacheInMemory(true)
29 | .cacheOnDisk(false)
30 | .considerExifParams(true)
31 | .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
32 | .bitmapConfig(Bitmap.Config.RGB_565)
33 | .build();
34 |
35 | public GalleryAdapter(final Context context, final List buckets) {
36 | this.items = buckets;
37 | this.context = context;
38 | this.mInflater = LayoutInflater.from(context);
39 | }
40 |
41 | @Override
42 | public int getCount() {
43 | return items.size();
44 | }
45 |
46 | @Override
47 | public Object getItem(int position) {
48 | return items.get(position);
49 | }
50 |
51 | @Override
52 | public long getItemId(int position) {
53 | return items.get(position).hashCode();
54 | }
55 |
56 | @Override
57 | public View getView(int position, View convertView, final ViewGroup parent) {
58 | if (items.get(0) instanceof BucketItem) { // show buckets
59 | ViewHolder holder;
60 | if (convertView == null) {
61 | convertView = mInflater.inflate(R.layout.bucketitem, null);
62 | holder = new ViewHolder();
63 | holder.icon = (ImageView) convertView.findViewById(R.id.icon);
64 | holder.text = (TextView) convertView.findViewById(R.id.text);
65 | convertView.setTag(holder);
66 | } else {
67 | holder = (ViewHolder) convertView.getTag();
68 | }
69 | BucketItem bi = (BucketItem) items.get(position);
70 | holder.text.setText(bi.images > 1 ?
71 | bi.name + " - " + context.getString(R.string.images, bi.images) :
72 | bi.name);
73 | ImageLoader.getInstance().displayImage("file://" + bi.path, holder.icon);
74 | return convertView;
75 | } else { // show images in a bucket
76 | ImageView imageView;
77 | if (convertView == null) { // if it's not recycled, initialize some attributes
78 | imageView = (ImageView) mInflater.inflate(R.layout.imageitem, null);
79 | } else {
80 | imageView = (ImageView) convertView;
81 | }
82 | ImageLoader.getInstance().displayImage("file://" + items.get(position).path, imageView, options);
83 | return imageView;
84 | }
85 | }
86 |
87 | private static class ViewHolder {
88 | private ImageView icon;
89 | private TextView text;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/GridItem.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.picchooser;
2 |
3 | class GridItem {
4 | final String name;
5 | final String path;
6 | final String imageTaken;
7 | final long imageSize;
8 |
9 | public GridItem(final String n, final String p, final String imageTaken, final long imageSize) {
10 | name = n;
11 | path = p;
12 | this.imageTaken = imageTaken;
13 | this.imageSize = imageSize;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/ImagesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Thomas Hoffmann
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yjing.imageeditlibrary.picchooser;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | import android.database.Cursor;
22 | import android.os.Bundle;
23 | import android.provider.MediaStore;
24 | import android.support.v4.app.Fragment;
25 | import android.view.LayoutInflater;
26 | import android.view.View;
27 | import android.view.ViewGroup;
28 | import android.widget.AdapterView;
29 | import android.widget.AdapterView.OnItemClickListener;
30 | import android.widget.GridView;
31 |
32 | import com.yjing.imageeditlibrary.R;
33 |
34 |
35 | public class ImagesFragment extends Fragment {
36 |
37 | @Override
38 | public View onCreateView(final LayoutInflater inflater,
39 | final ViewGroup container, final Bundle savedInstanceState) {
40 | View v = inflater.inflate(R.layout.gallery, null);
41 |
42 | Cursor cur = getActivity().getContentResolver()
43 | .query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
44 | new String[]{MediaStore.Images.Media.DATA,
45 | MediaStore.Images.Media.DISPLAY_NAME,
46 | MediaStore.Images.Media.DATE_TAKEN, MediaStore.Images.Media.SIZE},
47 | MediaStore.Images.Media.BUCKET_ID + " = ?",
48 | new String[]{String.valueOf(getArguments().getInt(
49 | "bucket"))},
50 | MediaStore.Images.Media.DATE_MODIFIED + " DESC");
51 |
52 | final List images = new ArrayList(cur.getCount());
53 |
54 | if (cur != null) {
55 | if (cur.moveToFirst()) {
56 | while (!cur.isAfterLast()) {
57 | images.add(new GridItem(cur.getString(1), cur.getString(0), cur.getString(2), cur.getLong(3)));
58 | cur.moveToNext();
59 | }
60 | }
61 | cur.close();
62 | }
63 |
64 | GridView grid = (GridView) v.findViewById(R.id.grid);
65 | grid.setAdapter(new GalleryAdapter(getActivity(), images));
66 | grid.setOnItemClickListener(new OnItemClickListener() {
67 | @Override
68 | public void onItemClick(AdapterView> parent, View view,
69 | int position, long id) {
70 | ((SelectPictureActivity) getActivity()).imageSelected(images
71 | .get(position).path, images
72 | .get(position).imageTaken, images
73 | .get(position).imageSize);
74 | }
75 | });
76 | return v;
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/Logger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Thomas Hoffmann
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.yjing.imageeditlibrary.picchooser;
17 |
18 | import java.io.File;
19 | import java.io.FileWriter;
20 | import java.io.IOException;
21 | import java.util.Date;
22 |
23 | import android.database.Cursor;
24 | import android.os.Environment;
25 |
26 | public class Logger {
27 |
28 | private static FileWriter fw;
29 | private final static Date date = new Date();
30 | private final static String APP = "GalleryLib";
31 |
32 | public static void log(final Throwable ex) {
33 | log(ex.getMessage());
34 | for (StackTraceElement ste : ex.getStackTrace()) {
35 | log(ste.toString());
36 | }
37 | }
38 |
39 | public static void log(final Cursor c) {
40 | c.moveToFirst();
41 | String title = "";
42 | for (int i = 0; i < c.getColumnCount(); i++)
43 | title += c.getColumnName(i) + " | ";
44 | log(title);
45 | while (!c.isAfterLast()) {
46 | title = "";
47 | for (int i = 0; i < c.getColumnCount(); i++)
48 | title += c.getString(i) + " | ";
49 | log(title);
50 | c.moveToNext();
51 | }
52 | }
53 |
54 | @SuppressWarnings("deprecation")
55 | public static void log(final String msg) {
56 | android.util.Log.d(APP, msg);
57 | try {
58 | if (fw == null) {
59 | fw = new FileWriter(new File(
60 | Environment.getExternalStorageDirectory().toString() + "/" + APP + ".log"),
61 | true);
62 | }
63 | date.setTime(System.currentTimeMillis());
64 | fw.write(date.toLocaleString() + " - " + msg + "\n");
65 | fw.flush();
66 | } catch (IOException e) {
67 | e.printStackTrace();
68 | }
69 | }
70 |
71 | protected void finalize() throws Throwable {
72 | try {
73 | if (fw != null) fw.close();
74 | } finally {
75 | super.finalize();
76 | }
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/SelectPictureActivity.java:
--------------------------------------------------------------------------------
1 |
2 | package com.yjing.imageeditlibrary.picchooser;
3 |
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.support.v4.app.Fragment;
7 | import android.support.v4.app.FragmentTransaction;
8 |
9 | import com.yjing.imageeditlibrary.BaseActivity;
10 |
11 | public class SelectPictureActivity extends BaseActivity {
12 | @Override
13 | protected void onCreate(final Bundle b) {
14 | super.onCreate(b);
15 | checkInitImageLoader();
16 | setResult(RESULT_CANCELED);
17 |
18 | // Create new fragment and transaction
19 | Fragment newFragment = new BucketsFragment();
20 | FragmentTransaction transaction = getSupportFragmentManager()
21 | .beginTransaction();
22 |
23 | // Replace whatever is in the fragment_container view with this
24 | // fragment,
25 | // and add the transaction to the back stack
26 | transaction.replace(android.R.id.content, newFragment);
27 |
28 | // Commit the transaction
29 | transaction.commit();
30 | }
31 |
32 | void showBucket(final int bucketId) {
33 | Bundle b = new Bundle();
34 | b.putInt("bucket", bucketId);
35 | Fragment f = new ImagesFragment();
36 | f.setArguments(b);
37 | getSupportFragmentManager().beginTransaction()
38 | .replace(android.R.id.content, f).addToBackStack(null).commit();
39 | }
40 |
41 | void imageSelected(final String imgPath, final String imgTaken, final long imageSize) {
42 | returnResult(imgPath, imgTaken, imageSize);
43 | }
44 |
45 | private void returnResult(final String imgPath, final String imageTaken, final long imageSize) {
46 | Intent result = new Intent();
47 | result.putExtra("imgPath", imgPath);
48 | result.putExtra("dateTaken", imageTaken);
49 | result.putExtra("imageSize", imageSize);
50 | setResult(RESULT_OK, result);
51 | finish();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/picchooser/SquareImageView.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.picchooser;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ImageView;
6 |
7 | /**
8 | * 正方形的ImageView 强制 宽度 = 高度
9 | */
10 | public class SquareImageView extends ImageView {
11 |
12 | public SquareImageView(final Context context, final AttributeSet attrs) {
13 | super(context, attrs);
14 | }
15 |
16 | @Override
17 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
18 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
19 | setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/utils/DensityUtil.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.utils;
2 |
3 | import android.content.Context;
4 |
5 | public class DensityUtil {
6 |
7 | /**
8 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
9 | */
10 | public static int dip2px(Context context, float dpValue) {
11 | final float scale = context.getResources().getDisplayMetrics().density;
12 | return (int) (dpValue * scale + 0.5f);
13 | }
14 |
15 | /**
16 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
17 | */
18 | public static int px2dip(Context context, float pxValue) {
19 | final float scale = context.getResources().getDisplayMetrics().density;
20 | return (int) (pxValue / scale + 0.5f);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/utils/Matrix3.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.utils;
2 |
3 | /**
4 | * 3x3
5 | */
6 | public class Matrix3 {
7 | private float[] data;
8 |
9 | public Matrix3() {
10 | data = new float[9];
11 | }
12 |
13 | public Matrix3(float[] values) {
14 | this();
15 | setValues(values);
16 | }
17 |
18 | public void setValues(float[] values) {
19 | for (int i = 0, len = values.length; i < len; i++) {
20 | data[i] = values[i];
21 | }// end for i
22 | }
23 |
24 | public float[] getValues() {
25 | float[] retValues = new float[9];
26 | System.arraycopy(data, 0, retValues, 0, 9);
27 | return retValues;
28 | }
29 |
30 | public Matrix3 copy() {
31 | return new Matrix3(getValues());
32 | }
33 |
34 | /**
35 | * 两矩阵相乘
36 | *
37 | * @param m
38 | */
39 | public void multiply(Matrix3 m) {
40 | float[] ma = this.copy().getValues();
41 | float[] mb = m.copy().getValues();
42 |
43 | data[0] = ma[0] * mb[0] + ma[1] * mb[3] + ma[2] * mb[6];
44 | data[1] = ma[0] * mb[1] + ma[1] * mb[4] + ma[2] * mb[7];
45 | data[2] = ma[0] * mb[2] + ma[1] * mb[5] + ma[2] * mb[8];
46 |
47 | data[3] = ma[3] * mb[0] + ma[4] * mb[3] + ma[5] * mb[6];
48 | data[4] = ma[3] * mb[1] + ma[4] * mb[4] + ma[5] * mb[7];
49 | data[5] = ma[3] * mb[2] + ma[4] * mb[5] + ma[5] * mb[8];
50 |
51 | data[6] = ma[6] * mb[0] + ma[7] * mb[3] + ma[8] * mb[6];
52 | data[7] = ma[6] * mb[1] + ma[7] * mb[4] + ma[8] * mb[7];
53 | data[8] = ma[6] * mb[2] + ma[7] * mb[5] + ma[8] * mb[8];
54 | }
55 |
56 | /**
57 | * 求当前矩阵的逆矩阵
58 | *
59 | * @return
60 | */
61 | public Matrix3 inverseMatrix() {
62 | float[] m = this.copy().getValues();
63 | float sx = m[0];
64 | float sy = m[4];
65 | m[0] = 1 / sx;
66 | m[1] = 0;
67 | m[2] = (-1) * (data[2] / sx);
68 | m[3] = 0;
69 | m[4] = 1 / sy;
70 | m[5] = (-1) * (data[5] / sy);
71 | m[6] = 0;
72 | m[7] = 0;
73 | m[8] = 1;
74 | return new Matrix3(m);
75 | }
76 |
77 | public void println() {
78 | System.out.println("data--->" + data[0] + " " + data[1] + " "
79 | + data[2]);
80 | System.out.println(" " + data[3] + " " + data[4] + " "
81 | + data[5]);
82 | System.out.println(" " + data[6] + " " + data[7] + " "
83 | + data[8]);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/java/com/yjing/imageeditlibrary/utils/RectUtil.java:
--------------------------------------------------------------------------------
1 | package com.yjing.imageeditlibrary.utils;
2 |
3 | import android.graphics.Rect;
4 | import android.graphics.RectF;
5 |
6 | import com.yjing.imageeditlibrary.editimage.view.TextStickerView;
7 |
8 | public class RectUtil {
9 | /**
10 | * 缩放指定矩形
11 | *
12 | * @param rect
13 | * @param scale
14 | */
15 | public static void scaleRect(RectF rect, float scale) {
16 | float w = rect.width();
17 | float h = rect.height();
18 |
19 | float newW = scale * w;
20 | float newH = scale * h;
21 |
22 | float dx = (newW - w) / 2;
23 | float dy = (newH - h) / 2;
24 |
25 | rect.left -= dx;
26 | rect.top -= dy;
27 | rect.right += dx;
28 | rect.bottom += dy;
29 | }
30 |
31 | /**
32 | * 矩形绕指定点旋转
33 | *
34 | * @param rect
35 | * @param roatetAngle
36 | */
37 | public static void rotateRect(RectF rect, float center_x, float center_y,
38 | float roatetAngle) {
39 | float x = rect.centerX();
40 | float y = rect.centerY();
41 | float sinA = (float) Math.sin(Math.toRadians(roatetAngle));
42 | float cosA = (float) Math.cos(Math.toRadians(roatetAngle));
43 | float newX = center_x + (x - center_x) * cosA - (y - center_y) * sinA;
44 | float newY = center_y + (y - center_y) * cosA + (x - center_x) * sinA;
45 |
46 | float dx = newX - x;
47 | float dy = newY - y;
48 |
49 | rect.offset(dx, dy);
50 | }
51 |
52 | /**
53 | * 矩形在Y轴方向上的加法操作
54 | *
55 | * @param srcRect
56 | * @param addRect
57 | * @param padding
58 | */
59 | public static void rectAddV(final RectF srcRect, final RectF addRect, int padding) {
60 | if (srcRect == null || addRect == null)
61 | return;
62 |
63 | float left = srcRect.left;
64 | float top = srcRect.top;
65 | float right = srcRect.right;
66 | float bottom = srcRect.bottom;
67 |
68 | if (srcRect.width() <= addRect.width()) {
69 | right = left + addRect.width();
70 | }
71 |
72 | bottom += padding + addRect.height();
73 |
74 | srcRect.set(left, top, right, bottom);
75 | }
76 |
77 | /**
78 | * 矩形在Y轴方向上的加法操作
79 | *
80 | * @param srcRect
81 | * @param addRect
82 | * @param padding
83 | */
84 | public static void rectAddV(final Rect srcRect, final Rect addRect, int padding) {
85 | if (srcRect == null || addRect == null)
86 | return;
87 |
88 | int left = srcRect.left;
89 | int top = srcRect.top;
90 | int right = srcRect.right;
91 | int bottom = srcRect.bottom;
92 |
93 | if (srcRect.width() <= addRect.width()) {
94 | right = left + addRect.width();
95 | }
96 |
97 | bottom += padding + Math.max(addRect.height(), TextStickerView.CHAR_MIN_HEIGHT);
98 |
99 | srcRect.set(left, top, right, bottom);
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/arm64-v8a/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/arm64-v8a/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/armeabi-v7a/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/armeabi-v7a/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/armeabi/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/armeabi/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/mips/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/mips/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/mips64/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/mips64/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/x86/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/x86/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/jniLibs/x86_64/libphotoprocessing.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/jniLibs/x86_64/libphotoprocessing.so
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/anim/in_bottom_to_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/anim/menuhide.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/anim/menushow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/anim/out_bottom_to_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/back_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/back_arrow.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/blue_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/blue_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/blue_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/blue_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/green_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/green_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/green_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/green_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/icon_title_bar_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/icon_title_bar_back.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/red_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/red_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-hdpi/red_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-hdpi/red_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-mdpi/blue_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-mdpi/blue_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-mdpi/blue_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-mdpi/blue_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-mdpi/green_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-mdpi/green_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-mdpi/green_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-mdpi/green_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-mdpi/red_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-mdpi/red_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-mdpi/red_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-mdpi/red_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/back_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/back_arrow.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/blue_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/blue_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/blue_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/blue_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/crop_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/crop_normal.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/crop_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/crop_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_brush_mosaic_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_brush_mosaic_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_brush_mosaic_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_brush_mosaic_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_cancel_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_cancel_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_cancel_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_cancel_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_confirm_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_confirm_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_confirm_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_confirm_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_crop_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_crop_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_crop_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_crop_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_emotion_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_emotion_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_emotion_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_emotion_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_mosaic_tool_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_mosaic_tool_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_mosaic_tool_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_mosaic_tool_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_pen_tool_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_pen_tool_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_pen_tool_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_pen_tool_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_revoke_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_revoke_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_text_tool_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_text_tool_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_text_tool_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_text_tool_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_traditional_mosaic_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_traditional_mosaic_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_traditional_mosaic_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/edit_image_traditional_mosaic_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/eraser_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/eraser_normal.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/eraser_seleced.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/eraser_seleced.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/fliters_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/fliters_normal.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/fliters_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/fliters_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/green_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/green_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/green_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/green_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/hi4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/hi4.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/ic_menu_gallery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/ic_menu_gallery.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/image_edit_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/image_edit_back.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/red_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/red_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/red_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/red_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_delete.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_normal.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/sticker_rotate.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_animal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_animal.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_cos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_cos.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_decoration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_decoration.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_frame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_frame.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_mark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_mark.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_motion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_motion.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_number.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_profession.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_profession.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_spring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_spring.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/stickers_type_text.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/texture_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/texture_normal.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/texture_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/texture_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xhdpi/yd_image_tx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xhdpi/yd_image_tx.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/blue_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/blue_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/blue_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/blue_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_brush_mosaic_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_brush_mosaic_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_brush_mosaic_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_brush_mosaic_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_cancel_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_cancel_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_cancel_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_cancel_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_confirm_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_confirm_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_confirm_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_confirm_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_crop_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_crop_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_crop_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_crop_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_emotion_board_roll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_emotion_board_roll.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_emotion_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_emotion_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_emotion_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_emotion_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_mosaic_tool_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_mosaic_tool_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_mosaic_tool_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_mosaic_tool_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_pen_tool_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_pen_tool_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_pen_tool_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_pen_tool_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_revoke_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_revoke_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_text_tool_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_text_tool_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_text_tool_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_text_tool_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_traditional_mosaic_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_traditional_mosaic_btn.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_traditional_mosaic_btn_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/edit_image_traditional_mosaic_btn_select.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/green_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/green_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/green_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/green_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/red_thumb_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/red_thumb_default.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable-xxhdpi/red_thumb_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YanJingW/SimpleImageEditor/ea608429d5c567dd6f753cddff17c71d28d3efb2/imageeditlibrary/src/main/res/drawable-xxhdpi/red_thumb_pressed.png
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_brush_mosaic_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_cancel_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_confirm_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_crop_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_emotion_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_mosaic_tool_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_pen_tool_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_text_tool_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/edit_image_traditional_mosaic_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/image_edit_icon_crop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/image_edit_icon_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/image_edit_icon_sticker.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/image_edit_icon_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__blue_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__blue_thumb_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__color_button.xml:
--------------------------------------------------------------------------------
1 |
3 | -
4 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__color_button_16.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__green_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__green_thumb_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/materialcolorpicker__red_thumb_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/red_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
9 |
10 |
11 |
12 | -
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/drawable/shape_rect.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/activity_image_edit.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
33 |
34 |
39 |
40 |
45 |
46 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
71 |
72 |
79 |
80 |
87 |
94 |
95 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/bucketitem.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
19 |
20 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/edit_image_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
23 |
24 |
32 |
33 |
41 |
42 |
50 |
51 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_image_add_text.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
15 |
16 |
21 |
33 |
34 |
35 |
36 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_image_crop.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
19 |
20 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
40 |
41 |
51 |
52 |
60 |
61 |
69 |
70 |
78 |
79 |
80 |
81 |
85 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_image_fliter.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
18 |
19 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_image_main_menu.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
14 |
15 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
45 |
46 |
51 |
52 |
53 |
60 |
61 |
66 |
67 |
68 |
75 |
76 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_image_rotate.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
22 |
23 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_image_sticker_type.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
17 |
18 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_edit_paint.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
15 |
20 |
21 |
27 |
28 |
29 |
30 |
36 |
37 |
43 |
44 |
45 |
46 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
67 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/fragment_mosaic.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
14 |
15 |
16 |
23 |
24 |
28 |
29 |
30 |
31 |
38 |
39 |
43 |
44 |
45 |
46 |
54 |
55 |
59 |
60 |
61 |
62 |
69 |
70 |
75 |
76 |
77 |
78 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/gallery.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/imageitem.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/view_color_more_panel.xml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/view_set_stoke_width.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
18 |
19 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/view_sticker_item.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/layout/view_sticker_type_item.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
18 |
26 |
27 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 编辑图片
3 | 没有发现图片
4 | %d 张图片
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 | - 优雅
33 | - 电影
34 | - 回忆
35 | - 优格
36 | - 流年
37 | - 发光
38 |
39 |
40 | 更多
41 | 编辑的图片还未保存,确认退出吗?
42 | 确认
43 | 取消
44 |
45 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #ffffff
3 | #ffffff
4 | #f44336
5 | #4caf50
6 | #2196f3
7 | #b3b3b3
8 | #d9d9d9
9 | #ea4c89
10 | #c32361
11 | #000000
12 | #009688
13 |
14 | #000000
15 | #333333
16 | #333333
17 | #444444
18 |
19 | #6680cbc4
20 | #66009688
21 | @color/bright_foreground_disabled_material_dark
22 |
23 | @color/bright_foreground_disabled_material_light
24 |
25 |
26 |
27 | - #F44336
28 | - #9C27B0
29 | - #3F51B5
30 | - #03A9F4
31 | - #009688
32 | - #8BC34A
33 | - #FFEB3B
34 | - #FF9800
35 | - #795548
36 | - #607D8B
37 |
38 |
39 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 20sp
6 | 7dp
7 | 20dp
8 | 16dp
9 | 16dp
10 | 45dp
11 | 70dp
12 |
13 | 50dp
14 |
15 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ImageEditLibrary
3 | no found the image
4 | %d images
5 | save
6 | apply
7 |
8 | stickers
9 | fliter
10 | crop
11 | rotate
12 | text
13 | edit
14 | mosaic
15 |
16 |
17 | Android Material Color Picker Dialog
18 | Material Color Picker Dialog
19 | Hex Code Format incorrect
20 | Color:
21 | Select
22 | save...
23 | input text ...
24 |
25 | please choose a image for edit
26 | AutoNewline
27 | Save error!
28 |
29 |
30 | - origin
31 | - soft
32 | - black
33 | - classic
34 | - gorgeous
35 | - retro
36 | - grace
37 | - film
38 | - memory
39 | - yogurt
40 | - fleeting
41 | - shine
42 |
43 |
44 | more
45 | The edited image is not saved. Do you want to exit?
46 | confirm
47 | cancel
48 |
49 |
50 | Hello blank fragment
51 |
52 |
--------------------------------------------------------------------------------
/imageeditlibrary/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':demo', ':imageeditlibrary'
2 |
--------------------------------------------------------------------------------