├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── libs │ └── universal-image-loader-1.9.5.jar └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── cydeep │ │ └── imageedit │ │ ├── Constants.java │ │ ├── ImageEditApplication.java │ │ ├── MainActivity.java │ │ ├── activity │ │ └── BaseActivity.java │ │ ├── base │ │ ├── EventMsg.java │ │ ├── ListViewAdapter.java │ │ ├── OnUpdateListUIListener.java │ │ ├── RecyclerViewBaseAdapter.java │ │ ├── RxBus.java │ │ ├── SharedPreferenceHelper.java │ │ ├── TitleViews.java │ │ └── ViewHolder.java │ │ ├── draglistview │ │ ├── OnCustomTouchEventListener.java │ │ ├── OnInterceptTouchEventListener.java │ │ ├── OnMoveLongClickListener.java │ │ ├── coreutil │ │ │ ├── Insertable.java │ │ │ ├── ListViewWrapper.java │ │ │ ├── OnItemMovedListener.java │ │ │ ├── Swappable.java │ │ │ └── TouchEventHandler.java │ │ ├── dragdrop │ │ │ ├── BitmapUtils.java │ │ │ ├── DragAndDropHandler.java │ │ │ ├── DragAndDropListViewWrapper.java │ │ │ ├── DraggableManager.java │ │ │ └── HoverDrawable.java │ │ └── view │ │ │ ├── ArrayAdapter.java │ │ │ ├── DynamicListView.java │ │ │ └── DynamicListViewWrapper.java │ │ ├── imageEdit │ │ ├── ClipBoundsView.java │ │ ├── GPUImageFilterTools.java │ │ ├── ImageClipActivity.java │ │ ├── ImageEditActivity.java │ │ ├── ImageFilterHandler.java │ │ ├── ImageFilterManagerActivity.java │ │ ├── ImageSaturationActivity.java │ │ ├── ImageSaturationSeekBar.java │ │ ├── bean │ │ │ └── PostEditImageInfo.java │ │ ├── filter │ │ │ ├── IF1977Filter.java │ │ │ ├── IFAmaroFilter.java │ │ │ ├── IFBrannanFilter.java │ │ │ ├── IFEarlybirdFilter.java │ │ │ ├── IFHefeFilter.java │ │ │ ├── IFHudsonFilter.java │ │ │ ├── IFImageFilter.java │ │ │ ├── IFInkwellFilter.java │ │ │ ├── IFLomoFilter.java │ │ │ ├── IFLordKelvinFilter.java │ │ │ ├── IFNashvilleFilter.java │ │ │ ├── IFRiseFilter.java │ │ │ ├── IFSierraFilter.java │ │ │ ├── IFSutroFilter.java │ │ │ ├── IFToasterFilter.java │ │ │ ├── IFValenciaFilter.java │ │ │ ├── IFWaldenFilter.java │ │ │ └── IFXprollFilter.java │ │ └── updateUiListener │ │ │ ├── OnImageEditUpdateRecyclerListener.java │ │ │ └── OnImageFilterSelectUpdateRecyclerListener.java │ │ ├── photoview │ │ ├── Compat.java │ │ ├── DefaultOnDoubleTapListener.java │ │ ├── IPhotoView.java │ │ ├── PhotoView.java │ │ ├── PhotoViewAttacher.java │ │ ├── gestures │ │ │ ├── CupcakeGestureDetector.java │ │ │ ├── EclairGestureDetector.java │ │ │ ├── FroyoGestureDetector.java │ │ │ ├── GestureDetector.java │ │ │ ├── OnGestureListener.java │ │ │ └── VersionedGestureDetector.java │ │ ├── log │ │ │ ├── LogManager.java │ │ │ ├── Logger.java │ │ │ └── LoggerDefault.java │ │ └── scrollerproxy │ │ │ ├── GingerScroller.java │ │ │ ├── IcsScroller.java │ │ │ ├── PreGingerScroller.java │ │ │ └── ScrollerProxy.java │ │ ├── selectimage │ │ ├── AlbumInfo.java │ │ ├── OnUpdateImageListener.java │ │ └── SelectImageActivity.java │ │ └── util │ │ ├── BitmapDecodeUtil.java │ │ ├── Constant.java │ │ ├── FileUtils.java │ │ ├── ImageUtil.java │ │ ├── LogUtils.java │ │ └── ViewSizeUtil.java │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable-xhdpi │ ├── asy.png │ ├── icon_bar_dress.png │ ├── icon_bar_dress_click.png │ ├── icon_bar_editor.png │ ├── icon_bar_editor_click.png │ ├── icon_editer_crop.png │ ├── icon_editer_saturation.png │ ├── icon_image_filter.png │ ├── icon_image_filter_select.png │ ├── icon_image_filter_unselect.png │ ├── icon_image_saturation_seek_bar.png │ ├── icon_nav_cut.png │ ├── icon_notice_mould_edit.png │ ├── icon_photo_scale.png │ ├── im_system_album_check_normal.png │ ├── image_filter_48.png │ ├── image_filter_49.png │ ├── image_filter_50.png │ ├── image_filter_51.png │ ├── image_filter_52.png │ ├── image_filter_53.png │ ├── image_filter_54.png │ ├── image_filter_55.png │ ├── image_filter_56.png │ ├── image_filter_57.png │ ├── image_filter_58.png │ ├── image_filter_59.png │ ├── image_filter_60.png │ ├── image_filter_61.png │ ├── image_filter_62.png │ ├── image_filter_63.png │ ├── image_filter_64.png │ ├── image_filter_65.png │ ├── image_filter_amaro_map.png │ ├── image_filter_blackboard.png │ ├── image_filter_brannan_blowout.png │ ├── image_filter_brannan_contrast.png │ ├── image_filter_brannan_luma.png │ ├── image_filter_brannan_process.png │ ├── image_filter_brannan_screen.png │ ├── image_filter_earlybird_blowout.png │ ├── image_filter_earlybird_curves.png │ ├── image_filter_earlybird_map.png │ ├── image_filter_earlybird_overlay_map.png │ ├── image_filter_edge_burn.png │ ├── image_filter_hefe_gradient_map.png │ ├── image_filter_hefe_map.png │ ├── image_filter_hefe_metal.png │ ├── image_filter_hefe_soft_light.png │ ├── image_filter_hudson_background.png │ ├── image_filter_hudson_map.png │ ├── image_filter_inkwell_map.png │ ├── image_filter_kelvin_map.png │ ├── image_filter_lomo_map.png │ ├── image_filter_lookup_amatorka.png │ ├── image_filter_nashville_map.png │ ├── image_filter_nblowout.png │ ├── image_filter_nmap.png │ ├── image_filter_overlay_map.png │ ├── image_filter_rise_map.png │ ├── image_filter_sierra_map.png │ ├── image_filter_sierra_vignette.png │ ├── image_filter_soft_light.png │ ├── image_filter_sutro_curves.png │ ├── image_filter_sutro_edge_burn.png │ ├── image_filter_sutro_metal.png │ ├── image_filter_toaster_color_shift.png │ ├── image_filter_toaster_curves.png │ ├── image_filter_toaster_metal.png │ ├── image_filter_toaster_overlay_map_warm.png │ ├── image_filter_toaster_soft_light.png │ ├── image_filter_valencia_gradient_map.png │ ├── image_filter_valencia_map.png │ ├── image_filter_vignette_map.png │ ├── image_filter_walden_map.png │ ├── image_filter_xpro_map.png │ ├── image_select.png │ ├── left.png │ ├── left_gray.png │ ├── lookup_amatorka.png │ └── pic_normal.png │ ├── drawable │ ├── ic_launcher_background.xml │ ├── icon_bar_dress_selector.xml │ ├── icon_bar_edit_selector.xml │ ├── image_clip.gif │ ├── image_filter.gif │ ├── image_filter_manage_background.xml │ ├── image_saturation.gif │ ├── rectangle_image_filter_setting.xml │ └── shape_root_status_bar_white.xml │ ├── layout │ ├── activity_base.xml │ ├── activity_image_filter_clip.xml │ ├── activity_image_filter_manage.xml │ ├── activity_image_saturation.xml │ ├── activity_main.xml │ ├── activity_post_image_edite.xml │ ├── activity_select_image.xml │ ├── image_saturation_seek.xml │ ├── item_edit_recycler_view.xml │ ├── item_image_filter_manage.xml │ ├── item_image_filter_recycler_view.xml │ ├── item_select_image.xml │ └── layout_toolbar.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── raw │ ├── haarcascade_eye.xml │ ├── haarcascade_frontalface_alt2.xml │ ├── haarcascade_mcs_leftear.xml │ ├── haarcascade_mcs_mouth.xml │ ├── haarcascade_mcs_rightear.xml │ └── tone_cuver_sample.acv │ └── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── config.gradle ├── gradle.properties ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── lib_gpuimage ├── AndroidManifest.xml ├── android-artifacts.gradle ├── build.gradle ├── central-publish.gradle ├── jni │ └── yuv-decoder.c ├── proguard-project.txt ├── project.properties └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── jp │ │ └── co │ │ └── cyberagent │ │ └── android │ │ └── gpuimage │ │ ├── GPUImage.java │ │ ├── GPUImage3x3ConvolutionFilter.java │ │ ├── GPUImage3x3TextureSamplingFilter.java │ │ ├── GPUImageAddBlendFilter.java │ │ ├── GPUImageAlphaBlendFilter.java │ │ ├── GPUImageBoxBlurFilter.java │ │ ├── GPUImageBrightnessFilter.java │ │ ├── GPUImageBulgeDistortionFilter.java │ │ ├── GPUImageCGAColorspaceFilter.java │ │ ├── GPUImageChromaKeyBlendFilter.java │ │ ├── GPUImageColorBalanceFilter.java │ │ ├── GPUImageColorBlendFilter.java │ │ ├── GPUImageColorBurnBlendFilter.java │ │ ├── GPUImageColorDodgeBlendFilter.java │ │ ├── GPUImageColorInvertFilter.java │ │ ├── GPUImageColorMatrixFilter.java │ │ ├── GPUImageContrastFilter.java │ │ ├── GPUImageCrosshatchFilter.java │ │ ├── GPUImageDarkenBlendFilter.java │ │ ├── GPUImageDifferenceBlendFilter.java │ │ ├── GPUImageDilationFilter.java │ │ ├── GPUImageDirectionalSobelEdgeDetectionFilter.java │ │ ├── GPUImageDissolveBlendFilter.java │ │ ├── GPUImageDivideBlendFilter.java │ │ ├── GPUImageEmbossFilter.java │ │ ├── GPUImageExclusionBlendFilter.java │ │ ├── GPUImageExposureFilter.java │ │ ├── GPUImageFalseColorFilter.java │ │ ├── GPUImageFilter.java │ │ ├── GPUImageFilterGroup.java │ │ ├── GPUImageGammaFilter.java │ │ ├── GPUImageGaussianBlurFilter.java │ │ ├── GPUImageGlassSphereFilter.java │ │ ├── GPUImageGrayscaleFilter.java │ │ ├── GPUImageHardLightBlendFilter.java │ │ ├── GPUImageHazeFilter.java │ │ ├── GPUImageHighlightShadowFilter.java │ │ ├── GPUImageHueBlendFilter.java │ │ ├── GPUImageHueFilter.java │ │ ├── GPUImageKuwaharaFilter.java │ │ ├── GPUImageLaplacianFilter.java │ │ ├── GPUImageLevelsFilter.java │ │ ├── GPUImageLightenBlendFilter.java │ │ ├── GPUImageLinearBurnBlendFilter.java │ │ ├── GPUImageLookupFilter.java │ │ ├── GPUImageLuminosityBlendFilter.java │ │ ├── GPUImageMixBlendFilter.java │ │ ├── GPUImageMonochromeFilter.java │ │ ├── GPUImageMultiplyBlendFilter.java │ │ ├── GPUImageNativeLibrary.java │ │ ├── GPUImageNonMaximumSuppressionFilter.java │ │ ├── GPUImageNormalBlendFilter.java │ │ ├── GPUImageOpacityFilter.java │ │ ├── GPUImageOverlayBlendFilter.java │ │ ├── GPUImagePixelationFilter.java │ │ ├── GPUImagePosterizeFilter.java │ │ ├── GPUImageRGBDilationFilter.java │ │ ├── GPUImageRGBFilter.java │ │ ├── GPUImageRenderer.java │ │ ├── GPUImageSaturationBlendFilter.java │ │ ├── GPUImageSaturationFilter.java │ │ ├── GPUImageScreenBlendFilter.java │ │ ├── GPUImageSepiaFilter.java │ │ ├── GPUImageSharpenFilter.java │ │ ├── GPUImageSketchFilter.java │ │ ├── GPUImageSmoothToonFilter.java │ │ ├── GPUImageSobelEdgeDetection.java │ │ ├── GPUImageSobelThresholdFilter.java │ │ ├── GPUImageSoftLightBlendFilter.java │ │ ├── GPUImageSourceOverBlendFilter.java │ │ ├── GPUImageSphereRefractionFilter.java │ │ ├── GPUImageSubtractBlendFilter.java │ │ ├── GPUImageSwirlFilter.java │ │ ├── GPUImageThresholdEdgeDetection.java │ │ ├── GPUImageToneCurveFilter.java │ │ ├── GPUImageToonFilter.java │ │ ├── GPUImageTwoInputFilter.java │ │ ├── GPUImageTwoPassFilter.java │ │ ├── GPUImageTwoPassTextureSamplingFilter.java │ │ ├── GPUImageView.java │ │ ├── GPUImageVignetteFilter.java │ │ ├── GPUImageWeakPixelInclusionFilter.java │ │ ├── GPUImageWhiteBalanceFilter.java │ │ ├── OpenGlUtils.java │ │ ├── PixelBuffer.java │ │ ├── Rotation.java │ │ └── util │ │ └── TextureRotationUtil.java │ └── jniLibs │ ├── arm64-v8a │ └── libgpuimage-library.so │ ├── armeabi-v7a │ └── libgpuimage-library.so │ ├── armeabi │ └── libgpuimage-library.so │ ├── mips │ └── libgpuimage-library.so │ ├── mips64 │ └── libgpuimage-library.so │ ├── x86 │ └── libgpuimage-library.so │ └── x86_64 │ └── libgpuimage-library.so └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | lib_gpuimage/build/ 13 | lib_gpuimage/.idea/ 14 | lib_gpuimage/.settings/org.eclipse.jdt.core.prefs 15 | gradlew.bat 16 | gradlew 17 | gradle/wrapper/gradle-wrapper.jar 18 | lib_gpuimage/.classpath 19 | lib_gpuimage/.project 20 | .idea/codeStyles/Project.xml 21 | .idea/gradle.xml 22 | .idea/misc.xml 23 | .idea/ 24 | lib_gpuimage/local.properties 25 | app/proguard-rules.pro 26 | lib_gpuimage/gen/jp/co/cyberagent/android/gpuimage/BuildConfig.java 27 | app/src/test/ 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ImageEdit 2 | 基于gpuimage和photoview的图片编辑(滤镜,饱和度,裁剪)的demo 3 | 4 | 博客地址:https://blog.csdn.net/baifghy/article/details/84860873 5 | 6 | 裁剪效果图 7 | 8 | ![image](https://github.com/cydeep/ImageEdit/blob/master/app/src/main/res/drawable/image_clip.gif) 9 | 10 | 饱和度效果图 11 | 12 | ![image](https://github.com/cydeep/ImageEdit/blob/master/app/src/main/res/drawable/image_saturation.gif) 13 | 14 | 滤镜效果图 15 | 16 | ![image](https://github.com/cydeep/ImageEdit/blob/master/app/src/main/res/drawable/image_filter.gif) 17 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId rootProject.ext.android.applicationId 7 | minSdkVersion rootProject.ext.android.minSdkVersion 8 | targetSdkVersion rootProject.ext.android.targetSdkVersion 9 | versionCode rootProject.ext.android.versionCode 10 | versionName rootProject.ext.android.versionName 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | compileOptions { 20 | sourceCompatibility = '1.8' 21 | targetCompatibility = '1.8' 22 | } 23 | allprojects { 24 | repositories { 25 | maven { url 'https://jitpack.io' } 26 | } 27 | } 28 | } 29 | 30 | dependencies { 31 | api fileTree(include: ['*.jar'], dir: 'libs') 32 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 33 | testImplementation 'junit:junit:4.12' 34 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 35 | api rootProject.ext.support["support-v4"] 36 | api rootProject.ext.support["appcompat-v7"] 37 | api rootProject.ext.support["recyclerview-v7"] 38 | api rootProject.ext.support["constraint-layout"] 39 | api project(path: ':lib_gpuimage') 40 | implementation files('libs/universal-image-loader-1.9.5.jar') 41 | api 'com.github.tbruyelle:rxpermissions:0.10.2' 42 | api rootProject.ext.dependencies["rxandroid"] 43 | api rootProject.ext.dependencies["rxjava"] 44 | api rootProject.ext.dependencies["rxrelay"] 45 | } 46 | -------------------------------------------------------------------------------- /app/libs/universal-image-loader-1.9.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/libs/universal-image-loader-1.9.5.jar -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 30 | 34 | 35 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2013 The SINA WEIBO Open Source Project 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.cydeep.imageedit; 18 | 19 | /** 20 | * 该类定义了授权时所需要的参数。 21 | */ 22 | public interface Constants { 23 | int REQUEST_CODE_1001 = 1001; 24 | int REQUEST_CODE_1002 = 1002; 25 | int REQUEST_CODE_1003 = 1003; 26 | int REQUEST_CODE_1004 = 1004; 27 | int REQUEST_CODE_1005 = 1005; 28 | int REQUEST_CODE_1026 = 1026; 29 | int REQUEST_CODE_1027 = 1027; 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/ImageEditApplication.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit; 2 | 3 | 4 | import android.app.Application; 5 | import android.os.Environment; 6 | import android.os.Handler; 7 | 8 | import com.cydeep.imageedit.util.FileUtils; 9 | import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache; 10 | import com.nostra13.universalimageloader.cache.memory.impl.FIFOLimitedMemoryCache; 11 | import com.nostra13.universalimageloader.core.ImageLoader; 12 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; 13 | 14 | import java.io.File; 15 | 16 | 17 | public class ImageEditApplication extends Application { 18 | 19 | public Handler handler = new Handler() { 20 | @Override 21 | public void handleMessage(android.os.Message msg) { 22 | super.handleMessage(msg); 23 | 24 | } 25 | }; 26 | 27 | private static ImageEditApplication sInstance; 28 | @Override 29 | public void onCreate() { 30 | super.onCreate(); 31 | sInstance = this; 32 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) 33 | .diskCache(new UnlimitedDiskCache(new File(Environment.getExternalStorageDirectory(), FileUtils.APP_DIR + "/" + FileUtils.File_IMG_DIR))) // 自定义缓存路径,自定义图片路径,不能现在disk存储大小 34 | .diskCacheSize(50 * 1024 * 1024) 35 | // .threadPoolSize(2) 36 | .memoryCache(new FIFOLimitedMemoryCache(20 * 1024 * 1024)) 37 | .memoryCacheSize(20 * 1024 * 1024) 38 | .build(); 39 | ImageLoader.getInstance().init(config); 40 | 41 | } 42 | public static ImageEditApplication getInstance() { 43 | return sInstance; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/EventMsg.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | public class EventMsg { 4 | public static final int CODE_RESULT_SELECT_IMAGE = 1001; 5 | public static final int CODE_RESULT_FILTE_IMAGE = 1002; 6 | 7 | public String msg; 8 | public int code; 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/ListViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.BaseAdapter; 7 | 8 | /** 9 | * Created by ChenYu on 5/8/15. 10 | */ 11 | public class ListViewAdapter extends BaseAdapter { 12 | 13 | 14 | public void setOnUpdateUIListener(OnUpdateListUIListener onUpdateUIListener) { 15 | this.onUpdateUIListener = onUpdateUIListener; 16 | } 17 | 18 | public void setContext(Context context) { 19 | this.context = context; 20 | } 21 | 22 | public OnUpdateListUIListener getOnUpdateUIListener() { 23 | return onUpdateUIListener; 24 | } 25 | 26 | protected OnUpdateListUIListener onUpdateUIListener; 27 | protected Context context; 28 | 29 | @Override 30 | public View getView(int position, View convertView, ViewGroup parent) { 31 | ViewHolder viewHolder; 32 | if (convertView == null) { 33 | // convertView = View.inflate(context,layoutResourceId,null); 34 | convertView = onUpdateUIListener.initLayout(context,position); 35 | viewHolder = new ViewHolder(convertView,context); 36 | convertView.setTag(viewHolder); 37 | } else { 38 | viewHolder = (ViewHolder)convertView.getTag(); 39 | } 40 | if (onUpdateUIListener != null) { 41 | viewHolder.position = position; 42 | onUpdateUIListener.onUpdateUI(context, viewHolder, position); 43 | } 44 | return convertView; 45 | } 46 | 47 | 48 | @Override 49 | public int getCount() { 50 | return onUpdateUIListener != null ?onUpdateUIListener.getCount() : 0; 51 | } 52 | 53 | @Override 54 | public Object getItem(int position) { 55 | return null; 56 | } 57 | 58 | @Override 59 | public long getItemId(int position) { 60 | return 0; 61 | } 62 | 63 | 64 | public ListViewAdapter(){ 65 | super(); 66 | } 67 | 68 | public ListViewAdapter(Context context, OnUpdateListUIListener onSetUIListener) { 69 | this.context = context; 70 | this.onUpdateUIListener = onSetUIListener; 71 | } 72 | 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/OnUpdateListUIListener.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | 4 | import android.content.Context; 5 | import android.view.View; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by chenyu on 16/2/18. 11 | */ 12 | public abstract class OnUpdateListUIListener { 13 | protected List mList; 14 | 15 | protected int mCount; 16 | 17 | public abstract void onUpdateUI(Context context, ViewHolder holder, int position); 18 | 19 | public abstract int getCount(); 20 | 21 | public abstract void setData(List list); 22 | 23 | public abstract void setCount(int count); 24 | 25 | public abstract View initLayout(Context context, int position); 26 | 27 | public List getData(){ 28 | return mList; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/RecyclerViewBaseAdapter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | /** 9 | * Created by ChenYu on 5/8/15. 10 | */ 11 | public class RecyclerViewBaseAdapter extends RecyclerView.Adapter { 12 | 13 | 14 | private final Context context; 15 | 16 | public OnUpdateListUIListener getOnSetUIListener() { 17 | return onSetUIListener; 18 | } 19 | 20 | public void setOnSetUIListener(OnUpdateListUIListener onSetUIListener) { 21 | this.onSetUIListener = onSetUIListener; 22 | } 23 | 24 | private OnUpdateListUIListener onSetUIListener; 25 | 26 | 27 | @Override 28 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 29 | View view = onSetUIListener.initLayout(context,viewType); 30 | ViewHolder viewHolder = new ViewHolder(view,context); 31 | return viewHolder; 32 | } 33 | 34 | @Override 35 | public int getItemViewType(int position) { 36 | return position; 37 | } 38 | 39 | @Override 40 | public void onBindViewHolder(ViewHolder holder, int position) { 41 | if (onSetUIListener != null){ 42 | holder.position = position; 43 | onSetUIListener.onUpdateUI(context,holder, position); 44 | } 45 | } 46 | 47 | @Override 48 | public int getItemCount() { 49 | return onSetUIListener.getCount(); 50 | } 51 | 52 | 53 | public RecyclerViewBaseAdapter(Context context, OnUpdateListUIListener onSetUIListener) { 54 | this.context = context; 55 | this.onSetUIListener = onSetUIListener; 56 | } 57 | 58 | 59 | public boolean isBottomView(int position) { 60 | return false; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/RxBus.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | import com.jakewharton.rxrelay2.PublishRelay; 4 | import com.jakewharton.rxrelay2.Relay; 5 | 6 | import io.reactivex.Observable; 7 | 8 | public class RxBus { 9 | private static volatile RxBus instance; 10 | private final Relay mBus; 11 | 12 | public RxBus() { 13 | this.mBus = PublishRelay.create().toSerialized(); 14 | } 15 | 16 | public static RxBus getInstance() { 17 | if (instance == null) { 18 | synchronized (RxBus.class) { 19 | if (instance == null) { 20 | instance = Holder.BUS; 21 | } 22 | } 23 | } 24 | return instance; 25 | } 26 | public void post(Object obj) { 27 | mBus.accept(obj); 28 | } 29 | 30 | public Observable toObservable(Class tClass) { 31 | return mBus.ofType(tClass); 32 | } 33 | 34 | public Observable toObservable() { 35 | return mBus; 36 | } 37 | 38 | public boolean hasObservers() { 39 | return mBus.hasObservers(); 40 | } 41 | 42 | private static class Holder { 43 | private static final RxBus BUS = new RxBus(); 44 | } 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/SharedPreferenceHelper.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | import com.cydeep.imageedit.ImageEditApplication; 7 | 8 | public class SharedPreferenceHelper { 9 | 10 | private static final String SP_FILE_NAME = "blemobi"; 11 | private static SharedPreferenceHelper sharedPrefHelper = null; 12 | private static SharedPreferences sharedPreferences; 13 | 14 | 15 | public static synchronized SharedPreferenceHelper getInstance() { 16 | if (null == sharedPrefHelper) { 17 | sharedPrefHelper = new SharedPreferenceHelper(); 18 | } 19 | return sharedPrefHelper; 20 | } 21 | 22 | private SharedPreferenceHelper() { 23 | sharedPreferences = ImageEditApplication.getInstance().getSharedPreferences(SP_FILE_NAME, Context.MODE_PRIVATE); 24 | } 25 | 26 | public void putImageFilters(String uuid, String imageFilters) { 27 | sharedPreferences.edit().putString(uuid + "imageFilters", imageFilters).commit(); 28 | } 29 | 30 | public String getImageFilters(String uuid) { 31 | return sharedPreferences.getString(uuid + "imageFilters", ""); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/base/TitleViews.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.base; 2 | 3 | import android.support.v7.widget.Toolbar; 4 | import android.widget.ImageView; 5 | import android.widget.LinearLayout; 6 | import android.widget.RelativeLayout; 7 | import android.widget.TextView; 8 | 9 | public class TitleViews { 10 | /** 11 | * 自定义title容器,不包含toolbar 12 | */ 13 | public Toolbar custom_title; 14 | /** 15 | * title下面的分割线 16 | */ 17 | public ImageView title_divider; 18 | /** 19 | * 自定义title左边容器 20 | */ 21 | public LinearLayout left_container; 22 | /** 23 | * 自定义title左边文字左边图片 24 | */ 25 | public ImageView left_container_left_image; 26 | /** 27 | * 自定义title左边文字 28 | */ 29 | public TextView left_container_title_text; 30 | /** 31 | * 自定义title左边文字右边图片 32 | */ 33 | public ImageView left_container_right_image; 34 | /** 35 | * 自定义title右边容器 36 | */ 37 | public LinearLayout right_container; 38 | /** 39 | * 自定义title右边文字左边图片 40 | */ 41 | public ImageView right_container_left_image; 42 | /** 43 | * 自定义title右边容器文字 44 | */ 45 | public TextView right_container_title_text; 46 | /** 47 | * 自定义title右边文字右边图片 48 | */ 49 | public ImageView right_container_right_image; 50 | /** 51 | * 自定义title中间容器 52 | */ 53 | public LinearLayout center_container; 54 | /** 55 | * 自定义title中间容器文字左边图片 56 | */ 57 | public ImageView center_container_left_image; 58 | /** 59 | * 自定义title中间容器文字 60 | */ 61 | public TextView center_container_title_text; 62 | /** 63 | * 自定义title中间文字右边图片 64 | */ 65 | public ImageView center_container_right_image; 66 | 67 | public RelativeLayout base_container; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/OnCustomTouchEventListener.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.draglistview; 2 | 3 | import android.view.MotionEvent; 4 | 5 | /** 6 | * Created by chenyu on 16/6/7. 7 | */ 8 | public interface OnCustomTouchEventListener { 9 | boolean onTouchEvent(MotionEvent ev); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/OnInterceptTouchEventListener.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.draglistview; 2 | 3 | import android.view.MotionEvent; 4 | 5 | /** 6 | * Created by chenyu on 16/6/7. 7 | */ 8 | public interface OnInterceptTouchEventListener { 9 | boolean onInterceptTouchEvent(MotionEvent ev); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/OnMoveLongClickListener.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.draglistview; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by chenyu on 16/6/13. 7 | */ 8 | public interface OnMoveLongClickListener { 9 | boolean onMoveLongClick(View view, int position); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/coreutil/Insertable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Niek Haarman 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.cydeep.imageedit.draglistview.coreutil; 18 | 19 | import android.support.annotation.NonNull; 20 | 21 | /** 22 | * An interface for inserting items at a certain index. 23 | */ 24 | public interface Insertable { 25 | 26 | /** 27 | * Will be called to insert given {@code item} at given {@code index} in the list. 28 | * 29 | * @param index the index the new item should be inserted at 30 | * @param item the item to insert 31 | */ 32 | void add(int index, @NonNull T item); 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/coreutil/ListViewWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Niek Haarman 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.cydeep.imageedit.draglistview.coreutil; 18 | 19 | import android.support.annotation.NonNull; 20 | import android.support.annotation.Nullable; 21 | import android.view.View; 22 | import android.view.ViewGroup; 23 | import android.widget.ListAdapter; 24 | 25 | public interface ListViewWrapper { 26 | 27 | @NonNull 28 | ViewGroup getListView(); 29 | 30 | @Nullable 31 | View getChildAt(int index); 32 | 33 | int getFirstVisiblePosition(); 34 | 35 | int getLastVisiblePosition(); 36 | 37 | int getCount(); 38 | 39 | int getChildCount(); 40 | 41 | int getHeaderViewsCount(); 42 | 43 | int getPositionForView(@NonNull View view); 44 | 45 | @Nullable 46 | ListAdapter getAdapter(); 47 | 48 | void smoothScrollBy(int distance, int duration); 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/coreutil/OnItemMovedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Niek Haarman 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.cydeep.imageedit.draglistview.coreutil; 18 | 19 | public interface OnItemMovedListener { 20 | 21 | /** 22 | * Called when an item that was dragged has been dropped. 23 | * 24 | * @param originalPosition the original position of the item that was dragged. 25 | * @param newPosition the new position of the item that was dragged. 26 | */ 27 | void onItemMoved(int originalPosition, int newPosition); 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/coreutil/Swappable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Niek Haarman 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.cydeep.imageedit.draglistview.coreutil; 18 | 19 | /** 20 | * Interface, usually implemented by a {@link com.nhaarman.listviewanimations.BaseAdapterDecorator}, 21 | * that indicates that it can swap the visual position of two list items. 22 | */ 23 | public interface Swappable { 24 | 25 | /** 26 | * Swaps the item on the first adapter position with the item on the second adapter position. 27 | * Be sure to call {@link android.widget.BaseAdapter#notifyDataSetChanged()} if appropriate when implementing this method. 28 | * 29 | * @param positionOne First adapter position. 30 | * @param positionTwo Second adapter position. 31 | */ 32 | void swapItems(int positionOne, int positionTwo); 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/coreutil/TouchEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.draglistview.coreutil; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.view.MotionEvent; 5 | 6 | public interface TouchEventHandler { 7 | 8 | boolean onTouchEvent(@NonNull MotionEvent event); 9 | 10 | boolean isInteracting(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/dragdrop/BitmapUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Niek Haarman 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.cydeep.imageedit.draglistview.dragdrop; 18 | 19 | import android.graphics.Bitmap; 20 | import android.graphics.Canvas; 21 | import android.support.annotation.NonNull; 22 | import android.view.View; 23 | 24 | class BitmapUtils { 25 | 26 | private BitmapUtils() { 27 | } 28 | 29 | /** 30 | * Returns a bitmap showing a screenshot of the view passed in. 31 | */ 32 | @NonNull 33 | static Bitmap getBitmapFromView(@NonNull final View v) { 34 | Bitmap bitmap = Bitmap.createBitmap(v.getMeasuredWidth(), v.getMeasuredHeight(), Bitmap.Config.ARGB_8888); 35 | Canvas canvas = new Canvas(bitmap); 36 | v.draw(canvas); 37 | return bitmap; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/dragdrop/DragAndDropListViewWrapper.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.draglistview.dragdrop; 2 | 3 | import android.widget.AbsListView; 4 | 5 | import com.cydeep.imageedit.draglistview.coreutil.ListViewWrapper; 6 | 7 | 8 | public interface DragAndDropListViewWrapper extends ListViewWrapper { 9 | 10 | void setOnScrollListener(AbsListView.OnScrollListener onScrollListener); 11 | 12 | int pointToPosition(int x, int y); 13 | 14 | int computeVerticalScrollOffset(); 15 | 16 | int computeVerticalScrollExtent(); 17 | 18 | int computeVerticalScrollRange(); 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/dragdrop/DraggableManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Niek Haarman 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.cydeep.imageedit.draglistview.dragdrop; 18 | 19 | import android.support.annotation.NonNull; 20 | import android.view.View; 21 | 22 | /** 23 | * An interface to be used for determining whether the user should be able to drag a {@code View}. 24 | */ 25 | public interface DraggableManager { 26 | 27 | /** 28 | * Returns whether the {@code View} at given {@code position} can be dragged. 29 | * 30 | * @param view the item {@code View}, as returned by {@link android.widget.ListAdapter#getView(int, View, android.view.ViewGroup)} for given {@code position}. 31 | * @param position the position of the item 32 | * @param x the x coordinate of the touch within given {@code View}. 33 | * @param y the y coordinate of the touch within given {@code View}. 34 | * 35 | * @return {@code true} if the {@code View} should be dragged, {@code false} otherwise. 36 | */ 37 | boolean isDraggable(@NonNull final View view, final int position, final float x, final float y); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/draglistview/view/DynamicListViewWrapper.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.draglistview.view; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | import android.widget.AbsListView; 7 | import android.widget.ListAdapter; 8 | 9 | import com.cydeep.imageedit.draglistview.dragdrop.DragAndDropListViewWrapper; 10 | 11 | 12 | public class DynamicListViewWrapper implements DragAndDropListViewWrapper { 13 | 14 | @NonNull 15 | private final DynamicListView mDynamicListView; 16 | 17 | public DynamicListViewWrapper(@NonNull final DynamicListView dynamicListView) { 18 | mDynamicListView = dynamicListView; 19 | } 20 | 21 | @NonNull 22 | @Override 23 | public DynamicListView getListView() { 24 | return mDynamicListView; 25 | } 26 | 27 | @Nullable 28 | @Override 29 | public View getChildAt(final int index) { 30 | return mDynamicListView.getChildAt(index); 31 | } 32 | 33 | @Override 34 | public int getFirstVisiblePosition() { 35 | return mDynamicListView.getFirstVisiblePosition(); 36 | } 37 | 38 | @Override 39 | public int getLastVisiblePosition() { 40 | return mDynamicListView.getLastVisiblePosition(); 41 | } 42 | 43 | @Override 44 | public int getCount() { 45 | return mDynamicListView.getCount(); 46 | } 47 | 48 | @Override 49 | public int getChildCount() { 50 | return mDynamicListView.getChildCount(); 51 | } 52 | 53 | @Override 54 | public int getHeaderViewsCount() { 55 | return mDynamicListView.getHeaderViewsCount(); 56 | } 57 | 58 | @Override 59 | public int getPositionForView(@NonNull final View view) { 60 | return mDynamicListView.getPositionForView(view); 61 | } 62 | 63 | @Nullable 64 | @Override 65 | public ListAdapter getAdapter() { 66 | return mDynamicListView.getAdapter(); 67 | } 68 | 69 | @Override 70 | public void smoothScrollBy(final int distance, final int duration) { 71 | mDynamicListView.smoothScrollBy(distance, duration); 72 | } 73 | 74 | @Override 75 | public void setOnScrollListener(final AbsListView.OnScrollListener onScrollListener) { 76 | mDynamicListView.setOnScrollListener(onScrollListener); 77 | } 78 | 79 | @Override 80 | public int pointToPosition(final int x, final int y) { 81 | return mDynamicListView.pointToPosition(x, y); 82 | } 83 | 84 | @Override 85 | public int computeVerticalScrollOffset() { 86 | return mDynamicListView.computeVerticalScrollOffset(); 87 | } 88 | 89 | @Override 90 | public int computeVerticalScrollExtent() { 91 | return mDynamicListView.computeVerticalScrollExtent(); 92 | } 93 | 94 | @Override 95 | public int computeVerticalScrollRange() { 96 | return mDynamicListView.computeVerticalScrollRange(); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/ClipBoundsView.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Paint; 6 | import android.util.AttributeSet; 7 | import android.view.View; 8 | 9 | import com.cydeep.imageedit.util.ViewSizeUtil; 10 | 11 | 12 | /** 13 | * Created by chenyu on 17/2/13. 14 | */ 15 | 16 | public class ClipBoundsView extends View { 17 | private int dp_1; 18 | private int dp_124; 19 | private int dp_250; 20 | private int dp_360; 21 | private int dp_119; 22 | private int dp_240; 23 | private Paint mPaint; 24 | 25 | public ClipBoundsView(Context context) { 26 | this(context,null); 27 | } 28 | 29 | public ClipBoundsView(Context context, AttributeSet attrs) { 30 | this(context, attrs,0); 31 | } 32 | 33 | public ClipBoundsView(Context context, AttributeSet attrs, int defStyleAttr) { 34 | super(context, attrs, defStyleAttr); 35 | init(); 36 | } 37 | 38 | @Override 39 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 40 | setMeasuredDimension(ViewSizeUtil.getCustomDimen(360f),ViewSizeUtil.getCustomDimen(360f)); 41 | } 42 | 43 | private void init() { 44 | dp_1 = ViewSizeUtil.getCustomDimen(1f); 45 | mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); 46 | mPaint.setFilterBitmap(true); 47 | mPaint.setAntiAlias(true); 48 | mPaint.setColor(0xffffffff); 49 | float textSize = dp_1 / ViewSizeUtil.getDensity(); 50 | dp_124 = ViewSizeUtil.getCustomDimen(124f); 51 | dp_240 = ViewSizeUtil.getCustomDimen(240f); 52 | dp_250 = ViewSizeUtil.getCustomDimen(250f); 53 | dp_360 = ViewSizeUtil.getCustomDimen(360f); 54 | dp_119 = ViewSizeUtil.getCustomDimen(119f); 55 | mPaint.setTextSize(textSize); 56 | } 57 | 58 | @Override 59 | protected void onDraw(Canvas canvas) { 60 | super.onDraw(canvas); 61 | canvas.save(); 62 | canvas.drawRect(0,0,getMeasuredWidth(),dp_1,mPaint); 63 | canvas.drawRect(0,dp_119,getMeasuredWidth(),dp_119 + dp_1,mPaint); 64 | canvas.drawRect(0,dp_240 - dp_1,getMeasuredWidth(),dp_240,mPaint); 65 | canvas.drawRect(0,dp_360 - dp_1,getMeasuredWidth(),dp_360,mPaint); 66 | canvas.drawRect(dp_119,dp_1,dp_119 + dp_1,dp_360 - 2 * dp_1,mPaint); 67 | canvas.drawRect(dp_240 - dp_1,dp_1,dp_240,dp_360 - 2 * dp_1,mPaint); 68 | canvas.restore(); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/ImageFilterHandler.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit; 2 | 3 | import android.graphics.Bitmap; 4 | import android.widget.ImageView; 5 | 6 | import com.cydeep.imageedit.ImageEditApplication; 7 | import com.cydeep.imageedit.activity.BaseActivity; 8 | import com.nostra13.universalimageloader.cache.memory.MemoryCache; 9 | import com.nostra13.universalimageloader.core.ImageLoader; 10 | 11 | import java.util.concurrent.ExecutorService; 12 | 13 | import jp.co.cyberagent.android.gpuimage.GPUImage; 14 | import jp.co.cyberagent.android.gpuimage.GPUImageFilter; 15 | 16 | /** 17 | * Created by chenyu on 17/2/8. 18 | */ 19 | 20 | public class ImageFilterHandler { 21 | 22 | public static void setFilterBitmap(ExecutorService executorService, GPUImageFilter filter, final String key, Bitmap bitmap, final ImageView imageView) { 23 | GPUImage.getBitmapForFilter(executorService, bitmap,filter, new GPUImage.ResponseListener() { 24 | @Override 25 | public void response(final Bitmap item) { 26 | MemoryCache mMCache = ImageLoader.getInstance().getMemoryCache(); 27 | mMCache.put(key,item); 28 | String tag = (String) imageView.getTag(); 29 | if (tag.equals(key)) { 30 | ImageEditApplication.getInstance().handler.post(new Runnable() { 31 | @Override 32 | public void run() { 33 | imageView.setImageBitmap(item); 34 | } 35 | }); 36 | } 37 | } 38 | }); 39 | } 40 | 41 | public static void setFilterBitmap(ExecutorService executorService, final BaseActivity baseActivity, GPUImageFilter filter, Bitmap bitmap, final ImageView imageView) { 42 | baseActivity.showWaitDialog(); 43 | GPUImage.getBitmapForFilter(executorService, bitmap, filter, new GPUImage.ResponseListener() { 44 | @Override 45 | public void response(final Bitmap item) { 46 | ImageEditApplication.getInstance().handler.post(new Runnable() { 47 | @Override 48 | public void run() { 49 | baseActivity.hideWaitDialog(); 50 | imageView.setImageBitmap(item); 51 | } 52 | }); 53 | } 54 | }); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/bean/PostEditImageInfo.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.bean; 2 | 3 | /** 4 | * Created by chenyu on 17/2/5. 5 | */ 6 | 7 | public class PostEditImageInfo { 8 | public String desc; 9 | public int resource; 10 | 11 | public PostEditImageInfo(String desc, int resource) { 12 | this.desc = desc; 13 | this.resource = resource; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IF1977Filter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IF1977Filter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2;\n" + 18 | " \n" + 19 | " void main()\n" + 20 | " {\n" + 21 | " \n" + 22 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 23 | " \n" + 24 | " texel = vec3(\n" + 25 | " texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,\n" + 26 | " texture2D(inputImageTexture2, vec2(texel.g, .5)).g,\n" + 27 | " texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);\n" + 28 | " \n" + 29 | " gl_FragColor = vec4(texel, 1.0);\n" + 30 | " }\n"; 31 | 32 | public IF1977Filter(Context paramContext) { 33 | super(paramContext, SHADER); 34 | setRes(); 35 | } 36 | 37 | private void setRes() { 38 | addInputTexture(R.drawable.image_filter_nmap); 39 | addInputTexture(R.drawable.image_filter_nblowout); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFAmaroFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFAmaroFilter extends IFImageFilter { 12 | private static final String SHADER = "\n precision lowp float;\n\n " + 13 | "varying highp vec2 textureCoordinate;\n\n " + 14 | "uniform sampler2D inputImageTexture;\n " + 15 | "uniform sampler2D inputImageTexture2;\n " + 16 | "uniform sampler2D inputImageTexture3;\n " + 17 | "uniform sampler2D inputImageTexture4;\n\n " + 18 | "void main()\n " + 19 | "{\n\n " + 20 | "vec4 texel = texture2D(inputImageTexture, textureCoordinate);\n " + 21 | "vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;\n\n " + 22 | "texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;\n " + 23 | "texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;\n " + 24 | "texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;\n\n " + 25 | "vec4 mapped;\n mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;\n " + 26 | "mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;\n " + 27 | "mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;\n " + 28 | "mapped.a = 1.0;\n\n " + 29 | "gl_FragColor = mapped;\n }"; 30 | 31 | public IFAmaroFilter(Context context) { 32 | super(context, SHADER); 33 | setRes(); 34 | } 35 | 36 | private void setRes() { 37 | addInputTexture(R.drawable.image_filter_blackboard); 38 | addInputTexture(R.drawable.image_filter_overlay_map); 39 | addInputTexture(R.drawable.image_filter_amaro_map); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFHudsonFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFHudsonFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2; //blowout;\n" + 18 | " uniform sampler2D inputImageTexture3; //overlay;\n" + 19 | " uniform sampler2D inputImageTexture4; //map\n" + 20 | " \n" + 21 | " void main()\n" + 22 | " {\n" + 23 | " \n" + 24 | " vec4 texel = texture2D(inputImageTexture, textureCoordinate);\n" + 25 | " \n" + 26 | " vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;\n" + 27 | " \n" + 28 | " texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;\n" + 29 | " texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;\n" + 30 | " texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;\n" + 31 | " \n" + 32 | " vec4 mapped;\n" + 33 | " mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;\n" + 34 | " mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;\n" + 35 | " mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;\n" + 36 | " mapped.a = 1.0;\n" + 37 | " gl_FragColor = mapped;\n" + 38 | " }\n"; 39 | 40 | public IFHudsonFilter(Context paramContext) { 41 | super(paramContext, SHADER); 42 | setRes(); 43 | } 44 | 45 | private void setRes() { 46 | addInputTexture(R.drawable.image_filter_hudson_background); 47 | addInputTexture(R.drawable.image_filter_overlay_map); 48 | addInputTexture(R.drawable.image_filter_hudson_map); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFInkwellFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFInkwellFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2;\n" + 18 | " \n" + 19 | " void main()\n" + 20 | " {\n" + 21 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 22 | " texel = vec3(dot(vec3(0.3, 0.6, 0.1), texel));\n" + 23 | " texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r);\n" + 24 | " gl_FragColor = vec4(texel, 1.0);\n" + 25 | " }\n"; 26 | 27 | public IFInkwellFilter(Context paramContext) { 28 | super(paramContext, SHADER); 29 | setRes(); 30 | } 31 | 32 | private void setRes() { 33 | addInputTexture(R.drawable.image_filter_inkwell_map); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFLomoFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFLomoFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2;\n" + 18 | " uniform sampler2D inputImageTexture3;\n" + 19 | " \n" + 20 | " void main()\n" + 21 | " {\n" + 22 | " \n" + 23 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 24 | " \n" + 25 | " vec2 red = vec2(texel.r, 0.16666);\n" + 26 | " vec2 green = vec2(texel.g, 0.5);\n" + 27 | " vec2 blue = vec2(texel.b, 0.83333);\n" + 28 | " \n" + 29 | " texel.rgb = vec3(\n" + 30 | " texture2D(inputImageTexture2, red).r,\n" + 31 | " texture2D(inputImageTexture2, green).g,\n" + 32 | " texture2D(inputImageTexture2, blue).b);\n" + 33 | " \n" + 34 | " vec2 tc = (2.0 * textureCoordinate) - 1.0;\n" + 35 | " float d = dot(tc, tc);\n" + 36 | " vec2 lookup = vec2(d, texel.r);\n" + 37 | " texel.r = texture2D(inputImageTexture3, lookup).r;\n" + 38 | " lookup.y = texel.g;\n" + 39 | " texel.g = texture2D(inputImageTexture3, lookup).g;\n" + 40 | " lookup.y = texel.b;\n" + 41 | " texel.b\t= texture2D(inputImageTexture3, lookup).b;\n" + 42 | " \n" + 43 | " gl_FragColor = vec4(texel,1.0);\n" + 44 | " }\n"; 45 | 46 | public IFLomoFilter(Context paramContext) { 47 | super(paramContext, SHADER); 48 | setRes(); 49 | } 50 | 51 | private void setRes() { 52 | addInputTexture(R.drawable.image_filter_lomo_map); 53 | addInputTexture(R.drawable.image_filter_vignette_map); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFLordKelvinFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFLordKelvinFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2;\n" + 18 | " \n" + 19 | " void main()\n" + 20 | " {\n" + 21 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 22 | " \n" + 23 | " vec2 lookup;\n" + 24 | " lookup.y = .5;\n" + 25 | " \n" + 26 | " lookup.x = texel.r;\n" + 27 | " texel.r = texture2D(inputImageTexture2, lookup).r;\n" + 28 | " \n" + 29 | " lookup.x = texel.g;\n" + 30 | " texel.g = texture2D(inputImageTexture2, lookup).g;\n" + 31 | " \n" + 32 | " lookup.x = texel.b;\n" + 33 | " texel.b = texture2D(inputImageTexture2, lookup).b;\n" + 34 | " \n" + 35 | " gl_FragColor = vec4(texel, 1.0);\n" + 36 | " }\n"; 37 | 38 | public IFLordKelvinFilter(Context paramContext) { 39 | super(paramContext, SHADER); 40 | setRes(); 41 | } 42 | 43 | private void setRes() { 44 | addInputTexture(R.drawable.image_filter_kelvin_map); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFNashvilleFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFNashvilleFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2;\n" + 18 | " \n" + 19 | " void main()\n" + 20 | " {\n" + 21 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 22 | " texel = vec3(\n" + 23 | " texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,\n" + 24 | " texture2D(inputImageTexture2, vec2(texel.g, .5)).g,\n" + 25 | " texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);\n" + 26 | " gl_FragColor = vec4(texel, 1.0);\n" + 27 | " }\n"; 28 | 29 | public IFNashvilleFilter(Context paramContext) { 30 | super(paramContext, SHADER); 31 | setRes(); 32 | } 33 | 34 | private void setRes() { 35 | addInputTexture(R.drawable.image_filter_nashville_map); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFRiseFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFRiseFilter extends IFImageFilter { 12 | private static final String SHADER = "\n precision lowp float;\n\n " + 13 | "varying highp vec2 textureCoordinate;\n\n " + 14 | "uniform sampler2D inputImageTexture;\n " + 15 | "uniform sampler2D inputImageTexture2;\n " + 16 | "uniform sampler2D inputImageTexture3;\n " + 17 | "uniform sampler2D inputImageTexture4;\n\n " + 18 | "void main()\n " + 19 | "{\n\n " + 20 | "vec4 texel = texture2D(inputImageTexture, textureCoordinate);\n " + 21 | "vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;\n\n " + 22 | "texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;\n " + 23 | "texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;\n " + 24 | "texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;\n\n " + 25 | "vec4 mapped;\n mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;\n " + 26 | "mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;\n " + 27 | "mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;\n " + 28 | "mapped.a = 1.0;\n\n " + 29 | "gl_FragColor = mapped;\n }"; 30 | 31 | public IFRiseFilter(Context paramContext) { 32 | super(paramContext, SHADER); 33 | setRes(); 34 | } 35 | 36 | private void setRes() { 37 | addInputTexture(R.drawable.image_filter_blackboard); 38 | addInputTexture(R.drawable.image_filter_overlay_map); 39 | addInputTexture(R.drawable.image_filter_rise_map); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFSierraFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFSierraFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2; //blowout;\n" + 18 | " uniform sampler2D inputImageTexture3; //overlay;\n" + 19 | " uniform sampler2D inputImageTexture4; //map\n" + 20 | " \n" + 21 | " void main()\n" + 22 | " {\n" + 23 | " \n" + 24 | " vec4 texel = texture2D(inputImageTexture, textureCoordinate);\n" + 25 | " vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;\n" + 26 | " \n" + 27 | " texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;\n" + 28 | " texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;\n" + 29 | " texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;\n" + 30 | " \n" + 31 | " vec4 mapped;\n" + 32 | " mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;\n" + 33 | " mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;\n" + 34 | " mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;\n" + 35 | " mapped.a = 1.0;\n" + 36 | " \n" + 37 | " gl_FragColor = mapped;\n" + 38 | " }\n"; 39 | 40 | public IFSierraFilter(Context paramContext) { 41 | super(paramContext, SHADER); 42 | setRes(); 43 | } 44 | 45 | private void setRes() { 46 | addInputTexture(R.drawable.image_filter_sierra_vignette); 47 | addInputTexture(R.drawable.image_filter_overlay_map); 48 | addInputTexture(R.drawable.image_filter_sierra_map); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFValenciaFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFValenciaFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2; //map\n" + 18 | " uniform sampler2D inputImageTexture3; //gradMap\n" + 19 | " \n" + 20 | " mat3 saturateMatrix = mat3(\n" + 21 | " 1.1402,\n" + 22 | " -0.0598,\n" + 23 | " -0.061,\n" + 24 | " -0.1174,\n" + 25 | " 1.0826,\n" + 26 | " -0.1186,\n" + 27 | " -0.0228,\n" + 28 | " -0.0228,\n" + 29 | " 1.1772);\n" + 30 | " \n" + 31 | " vec3 lumaCoeffs = vec3(.3, .59, .11);\n" + 32 | " \n" + 33 | " void main()\n" + 34 | " {\n" + 35 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 36 | " \n" + 37 | " texel = vec3(\n" + 38 | " texture2D(inputImageTexture2, vec2(texel.r, .1666666)).r,\n" + 39 | " texture2D(inputImageTexture2, vec2(texel.g, .5)).g,\n" + 40 | " texture2D(inputImageTexture2, vec2(texel.b, .8333333)).b\n" + 41 | " );\n" + 42 | " \n" + 43 | " texel = saturateMatrix * texel;\n" + 44 | " float luma = dot(lumaCoeffs, texel);\n" + 45 | " texel = vec3(\n" + 46 | " texture2D(inputImageTexture3, vec2(luma, texel.r)).r,\n" + 47 | " texture2D(inputImageTexture3, vec2(luma, texel.g)).g,\n" + 48 | " texture2D(inputImageTexture3, vec2(luma, texel.b)).b);\n" + 49 | " \n" + 50 | " gl_FragColor = vec4(texel, 1.0);\n" + 51 | " }\n"; 52 | 53 | public IFValenciaFilter(Context paramContext) { 54 | super(paramContext, SHADER); 55 | setRes(); 56 | } 57 | 58 | private void setRes() { 59 | addInputTexture(R.drawable.image_filter_valencia_map); 60 | addInputTexture(R.drawable.image_filter_valencia_gradient_map); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFWaldenFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFWaldenFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2; //map\n" + 18 | " uniform sampler2D inputImageTexture3; //vigMap\n" + 19 | " \n" + 20 | " void main()\n" + 21 | " {\n" + 22 | " \n" + 23 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 24 | " \n" + 25 | " texel = vec3(\n" + 26 | " texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,\n" + 27 | " texture2D(inputImageTexture2, vec2(texel.g, .5)).g,\n" + 28 | " texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);\n" + 29 | " \n" + 30 | " vec2 tc = (2.0 * textureCoordinate) - 1.0;\n" + 31 | " float d = dot(tc, tc);\n" + 32 | " vec2 lookup = vec2(d, texel.r);\n" + 33 | " texel.r = texture2D(inputImageTexture3, lookup).r;\n" + 34 | " lookup.y = texel.g;\n" + 35 | " texel.g = texture2D(inputImageTexture3, lookup).g;\n" + 36 | " lookup.y = texel.b;\n" + 37 | " texel.b\t= texture2D(inputImageTexture3, lookup).b;\n" + 38 | " \n" + 39 | " gl_FragColor = vec4(texel, 1.0);\n" + 40 | " }\n"; 41 | 42 | public IFWaldenFilter(Context paramContext) { 43 | super(paramContext, SHADER); 44 | setRes(); 45 | } 46 | 47 | private void setRes() { 48 | addInputTexture(R.drawable.image_filter_walden_map); 49 | addInputTexture(R.drawable.image_filter_vignette_map); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/filter/IFXprollFilter.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.filter; 2 | 3 | import android.content.Context; 4 | 5 | import com.cydeep.imageedit.R; 6 | 7 | 8 | /** 9 | * Created by sam on 14-8-9. 10 | */ 11 | public class IFXprollFilter extends IFImageFilter { 12 | private static final String SHADER = "precision lowp float;\n" + 13 | " \n" + 14 | " varying highp vec2 textureCoordinate;\n" + 15 | " \n" + 16 | " uniform sampler2D inputImageTexture;\n" + 17 | " uniform sampler2D inputImageTexture2; //map\n" + 18 | " uniform sampler2D inputImageTexture3; //vigMap\n" + 19 | " \n" + 20 | " void main()\n" + 21 | " {\n" + 22 | " \n" + 23 | " vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;\n" + 24 | " \n" + 25 | " vec2 tc = (2.0 * textureCoordinate) - 1.0;\n" + 26 | " float d = dot(tc, tc);\n" + 27 | " vec2 lookup = vec2(d, texel.r);\n" + 28 | " texel.r = texture2D(inputImageTexture3, lookup).r;\n" + 29 | " lookup.y = texel.g;\n" + 30 | " texel.g = texture2D(inputImageTexture3, lookup).g;\n" + 31 | " lookup.y = texel.b;\n" + 32 | " texel.b\t= texture2D(inputImageTexture3, lookup).b;\n" + 33 | " \n" + 34 | " vec2 red = vec2(texel.r, 0.16666);\n" + 35 | " vec2 green = vec2(texel.g, 0.5);\n" + 36 | " vec2 blue = vec2(texel.b, .83333);\n" + 37 | " texel.r = texture2D(inputImageTexture2, red).r;\n" + 38 | " texel.g = texture2D(inputImageTexture2, green).g;\n" + 39 | " texel.b = texture2D(inputImageTexture2, blue).b;\n" + 40 | " \n" + 41 | " gl_FragColor = vec4(texel, 1.0);\n" + 42 | " \n" + 43 | " }\n"; 44 | 45 | public IFXprollFilter(Context paramContext) { 46 | super(paramContext, SHADER); 47 | setRes(); 48 | } 49 | 50 | private void setRes() { 51 | addInputTexture(R.drawable.image_filter_xpro_map); 52 | addInputTexture(R.drawable.image_filter_vignette_map); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/imageEdit/updateUiListener/OnImageEditUpdateRecyclerListener.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.imageEdit.updateUiListener; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.widget.LinearLayout; 6 | 7 | 8 | import com.cydeep.imageedit.R; 9 | import com.cydeep.imageedit.base.OnUpdateListUIListener; 10 | import com.cydeep.imageedit.base.ViewHolder; 11 | import com.cydeep.imageedit.imageEdit.bean.PostEditImageInfo; 12 | import com.cydeep.imageedit.util.ViewSizeUtil; 13 | 14 | import java.util.List; 15 | 16 | 17 | /** 18 | * Created by chenyu on 17/2/5. 19 | */ 20 | 21 | public class OnImageEditUpdateRecyclerListener extends OnUpdateListUIListener { 22 | private View.OnClickListener onImageEditClickListener; 23 | 24 | @Override 25 | public void onUpdateUI(Context context, ViewHolder holder, final int position) { 26 | final PostEditImageInfo postEditImageInfo = mList.get(position); 27 | LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) holder.getView(R.id.item_edit_container).getLayoutParams(); 28 | layoutParams.setMargins(ViewSizeUtil.getCustomDimen(15f),0,0,0); 29 | holder 30 | .setBackgroundRes(R.id.item_edit_image,postEditImageInfo.resource) 31 | .setText(R.id.item_edit_text,postEditImageInfo.desc); 32 | if (position == getCount() - 1) { 33 | holder.getView(R.id.item_edit_container).setPadding(0, 0, ViewSizeUtil.getCustomDimen(15), 0); 34 | } else { 35 | holder.getView(R.id.item_edit_container).setPadding(0, 0, 0, 0); 36 | } 37 | holder.setOnClickListener(R.id.item_edit_container,new View.OnClickListener() { 38 | @Override 39 | public void onClick(View v) { 40 | v.setTag(postEditImageInfo.desc); 41 | if (onImageEditClickListener != null) { 42 | onImageEditClickListener.onClick(v); 43 | } 44 | } 45 | }); 46 | } 47 | 48 | @Override 49 | public int getCount() { 50 | return mList.size(); 51 | } 52 | 53 | @Override 54 | public void setData(List list) { 55 | mList = list; 56 | } 57 | 58 | @Override 59 | public void setCount(int count) { 60 | 61 | } 62 | 63 | @Override 64 | public View initLayout(Context context, int position) { 65 | return View.inflate(context, R.layout.item_edit_recycler_view,null); 66 | } 67 | 68 | public void setOnImageEditClickListener(View.OnClickListener onImageEditClickListener) { 69 | this.onImageEditClickListener = onImageEditClickListener; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/Compat.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview; 17 | 18 | import android.annotation.TargetApi; 19 | import android.os.Build.VERSION; 20 | import android.os.Build.VERSION_CODES; 21 | import android.view.MotionEvent; 22 | import android.view.View; 23 | 24 | public class Compat { 25 | 26 | private static final int SIXTY_FPS_INTERVAL = 1000 / 60; 27 | 28 | public static void postOnAnimation(View view, Runnable runnable) { 29 | if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { 30 | postOnAnimationJellyBean(view, runnable); 31 | } else { 32 | view.postDelayed(runnable, SIXTY_FPS_INTERVAL); 33 | } 34 | } 35 | 36 | @TargetApi(16) 37 | private static void postOnAnimationJellyBean(View view, Runnable runnable) { 38 | view.postOnAnimation(runnable); 39 | } 40 | 41 | public static int getPointerIndex(int action) { 42 | if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) 43 | return getPointerIndexHoneyComb(action); 44 | else 45 | return getPointerIndexEclair(action); 46 | } 47 | 48 | @SuppressWarnings("deprecation") 49 | @TargetApi(VERSION_CODES.ECLAIR) 50 | private static int getPointerIndexEclair(int action) { 51 | return (action & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; 52 | } 53 | 54 | @TargetApi(VERSION_CODES.HONEYCOMB) 55 | private static int getPointerIndexHoneyComb(int action) { 56 | return (action & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/gestures/FroyoGestureDetector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.gestures; 17 | 18 | import android.annotation.TargetApi; 19 | import android.content.Context; 20 | import android.view.MotionEvent; 21 | import android.view.ScaleGestureDetector; 22 | 23 | @TargetApi(8) 24 | public class FroyoGestureDetector extends EclairGestureDetector { 25 | 26 | protected final ScaleGestureDetector mDetector; 27 | 28 | public FroyoGestureDetector(Context context) { 29 | super(context); 30 | ScaleGestureDetector.OnScaleGestureListener mScaleListener = new ScaleGestureDetector.OnScaleGestureListener() { 31 | 32 | @Override 33 | public boolean onScale(ScaleGestureDetector detector) { 34 | float scaleFactor = detector.getScaleFactor(); 35 | 36 | if (Float.isNaN(scaleFactor) || Float.isInfinite(scaleFactor)) 37 | return false; 38 | 39 | mListener.onScale(scaleFactor, 40 | detector.getFocusX(), detector.getFocusY()); 41 | return true; 42 | } 43 | 44 | @Override 45 | public boolean onScaleBegin(ScaleGestureDetector detector) { 46 | return true; 47 | } 48 | 49 | @Override 50 | public void onScaleEnd(ScaleGestureDetector detector) { 51 | // NO-OP 52 | } 53 | }; 54 | mDetector = new ScaleGestureDetector(context, mScaleListener); 55 | } 56 | 57 | @Override 58 | public boolean isScaling() { 59 | return mDetector.isInProgress(); 60 | } 61 | 62 | @Override 63 | public boolean onTouchEvent(MotionEvent ev) { 64 | mDetector.onTouchEvent(ev); 65 | return super.onTouchEvent(ev); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/gestures/GestureDetector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.gestures; 17 | 18 | import android.view.MotionEvent; 19 | 20 | public interface GestureDetector { 21 | 22 | public boolean onTouchEvent(MotionEvent ev); 23 | 24 | public boolean isScaling(); 25 | 26 | public void setOnGestureListener(OnGestureListener listener); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/gestures/OnGestureListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.gestures; 17 | 18 | public interface OnGestureListener { 19 | 20 | public void onDrag(float dx, float dy); 21 | 22 | public void onFling(float startX, float startY, float velocityX, 23 | float velocityY); 24 | 25 | public void onScale(float scaleFactor, float focusX, float focusY); 26 | 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/gestures/VersionedGestureDetector.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.photoview.gestures; 2 | 3 | /******************************************************************************* 4 | * Copyright 2011, 2012 Chris Banes. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | *******************************************************************************/ 18 | 19 | import android.content.Context; 20 | import android.os.Build; 21 | 22 | public final class VersionedGestureDetector { 23 | 24 | public static GestureDetector newInstance(Context context, 25 | OnGestureListener listener) { 26 | final int sdkVersion = Build.VERSION.SDK_INT; 27 | GestureDetector detector; 28 | 29 | if (sdkVersion < Build.VERSION_CODES.ECLAIR) { 30 | detector = new CupcakeGestureDetector(context); 31 | } else if (sdkVersion < Build.VERSION_CODES.FROYO) { 32 | detector = new EclairGestureDetector(context); 33 | } else { 34 | detector = new FroyoGestureDetector(context); 35 | } 36 | 37 | detector.setOnGestureListener(listener); 38 | 39 | return detector; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/log/LogManager.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.log; 17 | 18 | import android.util.Log; 19 | 20 | /** 21 | * class that holds the {@link Logger} for this library, defaults to {@link LoggerDefault} to send logs to android {@link Log} 22 | */ 23 | public final class LogManager { 24 | 25 | private static Logger logger = new LoggerDefault(); 26 | 27 | public static void setLogger(Logger newLogger) { 28 | logger = newLogger; 29 | } 30 | 31 | public static Logger getLogger() { 32 | return logger; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/log/LoggerDefault.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.log; 17 | 18 | import android.util.Log; 19 | 20 | /** 21 | * Helper class to redirect {@link LogManager#logger} to {@link Log} 22 | */ 23 | public class LoggerDefault implements Logger { 24 | 25 | @Override 26 | public int v(String tag, String msg) { 27 | return Log.v(tag, msg); 28 | } 29 | 30 | @Override 31 | public int v(String tag, String msg, Throwable tr) { 32 | return Log.v(tag, msg, tr); 33 | } 34 | 35 | @Override 36 | public int d(String tag, String msg) { 37 | return Log.d(tag, msg); 38 | } 39 | 40 | @Override 41 | public int d(String tag, String msg, Throwable tr) { 42 | return Log.d(tag, msg, tr); 43 | } 44 | 45 | @Override 46 | public int i(String tag, String msg) { 47 | return Log.i(tag, msg); 48 | } 49 | 50 | @Override 51 | public int i(String tag, String msg, Throwable tr) { 52 | return Log.i(tag, msg, tr); 53 | } 54 | 55 | @Override 56 | public int w(String tag, String msg) { 57 | return Log.w(tag, msg); 58 | } 59 | 60 | @Override 61 | public int w(String tag, String msg, Throwable tr) { 62 | return Log.w(tag, msg, tr); 63 | } 64 | 65 | @Override 66 | public int e(String tag, String msg) { 67 | return Log.e(tag, msg); 68 | } 69 | 70 | @Override 71 | public int e(String tag, String msg, Throwable tr) { 72 | return Log.e(tag, msg, tr); 73 | } 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/scrollerproxy/GingerScroller.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.scrollerproxy; 17 | 18 | import android.annotation.TargetApi; 19 | import android.content.Context; 20 | import android.widget.OverScroller; 21 | 22 | @TargetApi(9) 23 | public class GingerScroller extends ScrollerProxy { 24 | 25 | protected final OverScroller mScroller; 26 | private boolean mFirstScroll = false; 27 | 28 | public GingerScroller(Context context) { 29 | mScroller = new OverScroller(context); 30 | } 31 | 32 | @Override 33 | public boolean computeScrollOffset() { 34 | // Workaround for first scroll returning 0 for the direction of the edge it hits. 35 | // Simply recompute values. 36 | if (mFirstScroll) { 37 | mScroller.computeScrollOffset(); 38 | mFirstScroll = false; 39 | } 40 | return mScroller.computeScrollOffset(); 41 | } 42 | 43 | @Override 44 | public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY, 45 | int overX, int overY) { 46 | mScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY, overX, overY); 47 | } 48 | 49 | @Override 50 | public void forceFinished(boolean finished) { 51 | mScroller.forceFinished(finished); 52 | } 53 | 54 | @Override 55 | public boolean isFinished() { 56 | return mScroller.isFinished(); 57 | } 58 | 59 | @Override 60 | public int getCurrX() { 61 | return mScroller.getCurrX(); 62 | } 63 | 64 | @Override 65 | public int getCurrY() { 66 | return mScroller.getCurrY(); 67 | } 68 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/scrollerproxy/IcsScroller.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.scrollerproxy; 17 | 18 | import android.annotation.TargetApi; 19 | import android.content.Context; 20 | 21 | @TargetApi(14) 22 | public class IcsScroller extends GingerScroller { 23 | 24 | public IcsScroller(Context context) { 25 | super(context); 26 | } 27 | 28 | @Override 29 | public boolean computeScrollOffset() { 30 | return mScroller.computeScrollOffset(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/scrollerproxy/PreGingerScroller.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.scrollerproxy; 17 | 18 | import android.content.Context; 19 | import android.widget.Scroller; 20 | 21 | public class PreGingerScroller extends ScrollerProxy { 22 | 23 | private final Scroller mScroller; 24 | 25 | public PreGingerScroller(Context context) { 26 | mScroller = new Scroller(context); 27 | } 28 | 29 | @Override 30 | public boolean computeScrollOffset() { 31 | return mScroller.computeScrollOffset(); 32 | } 33 | 34 | @Override 35 | public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY, 36 | int overX, int overY) { 37 | mScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY); 38 | } 39 | 40 | @Override 41 | public void forceFinished(boolean finished) { 42 | mScroller.forceFinished(finished); 43 | } 44 | 45 | public boolean isFinished() { 46 | return mScroller.isFinished(); 47 | } 48 | 49 | @Override 50 | public int getCurrX() { 51 | return mScroller.getCurrX(); 52 | } 53 | 54 | @Override 55 | public int getCurrY() { 56 | return mScroller.getCurrY(); 57 | } 58 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/photoview/scrollerproxy/ScrollerProxy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2011, 2012 Chris Banes. 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.cydeep.imageedit.photoview.scrollerproxy; 17 | 18 | import android.content.Context; 19 | import android.os.Build.VERSION; 20 | import android.os.Build.VERSION_CODES; 21 | 22 | public abstract class ScrollerProxy { 23 | 24 | public static ScrollerProxy getScroller(Context context) { 25 | if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) { 26 | return new PreGingerScroller(context); 27 | } else if (VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH) { 28 | return new GingerScroller(context); 29 | } else { 30 | return new IcsScroller(context); 31 | } 32 | } 33 | 34 | public abstract boolean computeScrollOffset(); 35 | 36 | public abstract void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, 37 | int maxY, int overX, int overY); 38 | 39 | public abstract void forceFinished(boolean finished); 40 | 41 | public abstract boolean isFinished(); 42 | 43 | public abstract int getCurrX(); 44 | 45 | public abstract int getCurrY(); 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/selectimage/AlbumInfo.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.selectimage; 2 | 3 | import java.io.Serializable; 4 | 5 | 6 | public class AlbumInfo implements Serializable { 7 | public String folderId; 8 | public String folderName; 9 | public long fileId; 10 | public String imageName; 11 | public String path; 12 | public String title; 13 | public int count; 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/cydeep/imageedit/util/Constant.java: -------------------------------------------------------------------------------- 1 | package com.cydeep.imageedit.util; 2 | 3 | /** 4 | * Created by zhaokaiqiang on 15/11/18. 5 | */ 6 | public interface Constant { 7 | 8 | String DEFAULT_MESSAGE = "execute"; 9 | String LINE_SEPARATOR = System.getProperty("line.separator"); 10 | String NULL_TIPS = "Log with null object"; 11 | int JSON_INDENT = 4; 12 | 13 | int V = 0x1; 14 | int D = 0x2; 15 | int I = 0x3; 16 | int W = 0x4; 17 | int E = 0x5; 18 | int A = 0x6; 19 | int XML = 0x8; 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/asy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/asy.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_bar_dress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_bar_dress.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_bar_dress_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_bar_dress_click.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_bar_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_bar_editor.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_bar_editor_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_bar_editor_click.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_editer_crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_editer_crop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_editer_saturation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_editer_saturation.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_image_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_image_filter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_image_filter_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_image_filter_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_image_filter_unselect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_image_filter_unselect.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_image_saturation_seek_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_image_saturation_seek_bar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_nav_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_nav_cut.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_notice_mould_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_notice_mould_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_photo_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/icon_photo_scale.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/im_system_album_check_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/im_system_album_check_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_48.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_49.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_51.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_52.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_53.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_54.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_55.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_56.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_57.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_58.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_59.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_60.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_61.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_62.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_62.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_63.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_65.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_amaro_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_amaro_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_blackboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_blackboard.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_brannan_blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_brannan_blowout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_brannan_contrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_brannan_contrast.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_brannan_luma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_brannan_luma.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_brannan_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_brannan_process.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_brannan_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_brannan_screen.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_earlybird_blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_earlybird_blowout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_earlybird_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_earlybird_curves.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_earlybird_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_earlybird_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_earlybird_overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_earlybird_overlay_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_edge_burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_edge_burn.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_hefe_gradient_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_hefe_gradient_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_hefe_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_hefe_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_hefe_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_hefe_metal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_hefe_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_hefe_soft_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_hudson_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_hudson_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_hudson_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_hudson_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_inkwell_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_inkwell_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_kelvin_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_kelvin_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_lomo_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_lomo_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_lookup_amatorka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_lookup_amatorka.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_nashville_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_nashville_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_nblowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_nblowout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_nmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_nmap.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_overlay_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_rise_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_rise_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_sierra_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_sierra_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_sierra_vignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_sierra_vignette.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_soft_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_sutro_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_sutro_curves.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_sutro_edge_burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_sutro_edge_burn.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_sutro_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_sutro_metal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_toaster_color_shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_toaster_color_shift.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_toaster_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_toaster_curves.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_toaster_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_toaster_metal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_toaster_overlay_map_warm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_toaster_overlay_map_warm.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_toaster_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_toaster_soft_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_valencia_gradient_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_valencia_gradient_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_valencia_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_valencia_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_vignette_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_walden_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_walden_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_filter_xpro_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_filter_xpro_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/image_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/image_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/left.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/left_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/left_gray.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/lookup_amatorka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/lookup_amatorka.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable-xhdpi/pic_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_bar_dress_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_bar_edit_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/image_clip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable/image_clip.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable/image_filter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable/image_filter.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable/image_filter_manage_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/image_saturation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cydeep/ImageEdit/d110dbdc1f6d7c4c71153020c597c0933cd099dd/app/src/main/res/drawable/image_saturation.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable/rectangle_image_filter_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_root_status_bar_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_base.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_image_filter_manage.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_image_saturation.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 17 | 18 | 19 | 20 | 24 | 25 | 30 | 31 | 32 | 33 | 38 | 39 | 48 | 49 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 |