├── .gitignore ├── .idea └── vcs.xml ├── 2016.11.10_17.57.50.gif ├── 2016.11.10_18.00.25.gif ├── 2016.11.10_18.03.14.gif ├── 2017.04.01_04.53.15.gif ├── 2017.05.04_02.56.52.gif ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── byox │ │ └── drawviewproject │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── byox │ │ │ └── drawviewproject │ │ │ ├── CameraActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── SplashScreenActivity.java │ │ │ ├── adapters │ │ │ └── PhotoAdapter.java │ │ │ ├── behaviors │ │ │ └── CustomBottomSheetBehavior.java │ │ │ ├── dialogs │ │ │ ├── DrawAttribsDialog.java │ │ │ ├── RequestTextDialog.java │ │ │ ├── SaveBitmapDialog.java │ │ │ ├── SelectChoiceDialog.java │ │ │ └── SelectImageDialog.java │ │ │ ├── listeners │ │ │ └── OnClickListener.java │ │ │ └── utils │ │ │ ├── AnimateUtils.java │ │ │ ├── FileUtils.java │ │ │ └── LayoutUtils.java │ └── res │ │ ├── animator-v21 │ │ └── appbar_always_elevated.xml │ │ ├── drawable-hdpi │ │ ├── ic_action_arrow_back.png │ │ ├── ic_action_brush.png │ │ ├── ic_action_content_redo.png │ │ ├── ic_action_content_redo_disabled.png │ │ ├── ic_action_content_undo.png │ │ ├── ic_action_content_undo_disabled.png │ │ ├── ic_action_edit.png │ │ ├── ic_action_format_paint.png │ │ ├── ic_action_image.png │ │ ├── ic_action_more_vert.png │ │ ├── ic_action_palette.png │ │ ├── ic_action_photo_camera.png │ │ ├── ic_action_save.png │ │ ├── ic_content_add.png │ │ ├── ic_content_clear.png │ │ ├── ic_content_save.png │ │ ├── ic_editor_mode_edit.png │ │ ├── ic_image.png │ │ ├── ic_image_brush.png │ │ ├── ic_image_color_lens.png │ │ └── ic_mood_bad.png │ │ ├── drawable-mdpi │ │ ├── ic_action_arrow_back.png │ │ ├── ic_action_brush.png │ │ ├── ic_action_content_redo.png │ │ ├── ic_action_content_redo_disabled.png │ │ ├── ic_action_content_undo.png │ │ ├── ic_action_content_undo_disabled.png │ │ ├── ic_action_edit.png │ │ ├── ic_action_format_paint.png │ │ ├── ic_action_image.png │ │ ├── ic_action_more_vert.png │ │ ├── ic_action_palette.png │ │ ├── ic_action_photo_camera.png │ │ ├── ic_action_save.png │ │ ├── ic_content_add.png │ │ ├── ic_content_clear.png │ │ ├── ic_content_save.png │ │ ├── ic_editor_mode_edit.png │ │ ├── ic_image.png │ │ ├── ic_image_brush.png │ │ ├── ic_image_color_lens.png │ │ └── ic_mood_bad.png │ │ ├── drawable-xhdpi │ │ ├── ic_action_arrow_back.png │ │ ├── ic_action_brush.png │ │ ├── ic_action_content_redo.png │ │ ├── ic_action_content_redo_disabled.png │ │ ├── ic_action_content_undo.png │ │ ├── ic_action_content_undo_disabled.png │ │ ├── ic_action_edit.png │ │ ├── ic_action_format_paint.png │ │ ├── ic_action_image.png │ │ ├── ic_action_more_vert.png │ │ ├── ic_action_palette.png │ │ ├── ic_action_photo_camera.png │ │ ├── ic_action_save.png │ │ ├── ic_content_add.png │ │ ├── ic_content_clear.png │ │ ├── ic_content_save.png │ │ ├── ic_editor_mode_edit.png │ │ ├── ic_image.png │ │ ├── ic_image_brush.png │ │ ├── ic_image_color_lens.png │ │ └── ic_mood_bad.png │ │ ├── drawable-xxhdpi │ │ ├── ic_action_arrow_back.png │ │ ├── ic_action_brush.png │ │ ├── ic_action_content_redo.png │ │ ├── ic_action_content_redo_disabled.png │ │ ├── ic_action_content_undo.png │ │ ├── ic_action_content_undo_disabled.png │ │ ├── ic_action_edit.png │ │ ├── ic_action_format_paint.png │ │ ├── ic_action_image.png │ │ ├── ic_action_more_vert.png │ │ ├── ic_action_palette.png │ │ ├── ic_action_photo_camera.png │ │ ├── ic_action_save.png │ │ ├── ic_content_add.png │ │ ├── ic_content_clear.png │ │ ├── ic_content_save.png │ │ ├── ic_editor_mode_edit.png │ │ ├── ic_image.png │ │ ├── ic_image_brush.png │ │ ├── ic_image_color_lens.png │ │ └── ic_mood_bad.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_action_arrow_back.png │ │ ├── ic_action_brush.png │ │ ├── ic_action_content_redo.png │ │ ├── ic_action_content_redo_disabled.png │ │ ├── ic_action_content_undo.png │ │ ├── ic_action_content_undo_disabled.png │ │ ├── ic_action_edit.png │ │ ├── ic_action_format_paint.png │ │ ├── ic_action_image.png │ │ ├── ic_action_more_vert.png │ │ ├── ic_action_palette.png │ │ ├── ic_action_photo_camera.png │ │ ├── ic_action_save.png │ │ ├── ic_content_add.png │ │ ├── ic_content_clear.png │ │ ├── ic_content_save.png │ │ ├── ic_editor_mode_edit.png │ │ ├── ic_image.png │ │ ├── ic_image_brush.png │ │ ├── ic_image_color_lens.png │ │ └── ic_mood_bad.png │ │ ├── drawable │ │ ├── drawable_transparent_dialog_pattern.xml │ │ ├── logo.png │ │ └── transparent_dialog_pattern.png │ │ ├── layout │ │ ├── activity_camera.xml │ │ ├── activity_main.xml │ │ ├── activity_splash_screen.xml │ │ ├── content_camera.xml │ │ ├── content_main.xml │ │ ├── layout_draw_attribs.xml │ │ ├── layout_photo.xml │ │ ├── layout_request_text.xml │ │ ├── layout_save_bitmap.xml │ │ └── layout_select_image.xml │ │ ├── menu │ │ ├── menu_camera.xml │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-sw600dp │ │ └── layouts.xml │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── layouts.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── byox │ └── drawviewproject │ └── ExampleUnitTest.java ├── build.gradle ├── destacada.png ├── device-2016-11-19-113458.png ├── drawview ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── byox │ │ └── drawview │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── byox │ │ │ └── drawview │ │ │ ├── dictionaries │ │ │ └── DrawMove.java │ │ │ ├── enums │ │ │ ├── BackgroundScale.java │ │ │ ├── BackgroundType.java │ │ │ ├── DrawingCapture.java │ │ │ ├── DrawingMode.java │ │ │ ├── DrawingOrientation.java │ │ │ └── DrawingTool.java │ │ │ ├── utils │ │ │ ├── BitmapUtils.java │ │ │ ├── MatrixUtils.java │ │ │ ├── SerializablePaint.java │ │ │ ├── SerializablePath.java │ │ │ └── ViewUtils.java │ │ │ └── views │ │ │ ├── CameraView.java │ │ │ ├── DrawCameraView.java │ │ │ ├── DrawView.java │ │ │ └── ZoomRegionView.java │ └── res │ │ ├── drawable │ │ ├── drawable_transparent_pattern.xml │ │ └── transparent_pattern.png │ │ └── values │ │ ├── attrs.xml │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── byox │ └── drawview │ └── ExampleUnitTest.java ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── privacy_policy.md └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | */.idea 12 | */local.properties 13 | ### Android template 14 | # Built application files 15 | *.apk 16 | *.ap_ 17 | 18 | # Files for the ART/Dalvik VM 19 | *.dex 20 | 21 | # Java class files 22 | *.class 23 | 24 | # Generated files 25 | bin/ 26 | gen/ 27 | out/ 28 | 29 | # Gradle files 30 | .gradle/ 31 | build/ 32 | 33 | # Local configuration file (sdk path, etc) 34 | local.properties 35 | 36 | # Proguard folder generated by Eclipse 37 | proguard/ 38 | 39 | # Log Files 40 | *.log 41 | 42 | # Android Studio Navigation editor temp files 43 | .navigation/ 44 | 45 | # Android Studio captures folder 46 | captures/ 47 | 48 | # Intellij 49 | .idea/workspace.xml 50 | 51 | # Keystore files 52 | *.jks 53 | 54 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /2016.11.10_17.57.50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/2016.11.10_17.57.50.gif -------------------------------------------------------------------------------- /2016.11.10_18.00.25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/2016.11.10_18.00.25.gif -------------------------------------------------------------------------------- /2016.11.10_18.03.14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/2016.11.10_18.03.14.gif -------------------------------------------------------------------------------- /2017.04.01_04.53.15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/2017.04.01_04.53.15.gif -------------------------------------------------------------------------------- /2017.05.04_02.56.52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/2017.05.04_02.56.52.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DrawView 2 | 3 | ![drawview](https://github.com/ByoxCode/DrawView/blob/master/destacada.png) 4 | 5 | ![DrawView](https://img.shields.io/badge/drawview-1.3.1-blue.svg) ![DrawViewSnapshot](https://img.shields.io/badge/snapshot-1.0.2-purple.svg) ![Platform](https://img.shields.io/badge/platform-Android-green.svg) ![Language](https://img.shields.io/badge/language-Java-red.svg) 6 | 7 | Android view that allows the user to create drawings. Draw anything you like in your Android device from simple view. 8 | 9 | Customize draw settings like draw color, draw width or draw tools. 10 | 11 | Undo or redo actions it is possible with DrawView. 12 | 13 | ![undo redo gif](https://github.com/ByoxCode/DrawView/blob/master/2016.11.10_17.57.50.gif) 14 | ![text tool gif](https://github.com/ByoxCode/DrawView/blob/master/2016.11.10_18.00.25.gif) 15 | ![save bitmap gif](https://github.com/ByoxCode/DrawView/blob/master/2016.11.10_18.03.14.gif) 16 | ![zoom gif](https://github.com/ByoxCode/DrawView/blob/master/2017.04.01_04.53.15.gif) 17 | ![camera gif](https://github.com/ByoxCode/DrawView/blob/master/2017.05.04_02.56.52.gif) 18 | 19 | View example [APK](https://play.google.com/store/apps/details?id=com.byox.drawviewproject) 20 | 21 | Usage 22 | -------- 23 | 24 | With Gradle: 25 | ```groovy 26 | implementation 'com.byox.drawview:drawview:X.X.X' 27 | ``` 28 | or Maven: 29 | ```xml 30 | 31 | com.byox.drawview 32 | drawview 33 | X.X.X 34 | pom 35 | 36 | ``` 37 | 38 | Where **X.X.X** is the current version of DrawView 39 | 40 | Snapshot 41 | -------- 42 | 43 | Import from: 44 | ```groovy 45 | maven { url "https://raw.githubusercontent.com/ByoxCode/DrawView/snapshot/aar/snapshots/" } 46 | ``` 47 | 48 | With Gradle: 49 | ```groovy 50 | implementation 'com.byox.drawview:drawview:X.X.X-SNAPSHOT' 51 | ``` 52 | or Maven: 53 | ```xml 54 | 55 | com.byox.drawview 56 | drawview 57 | X.X.X-SNAPSHOT 58 | pom 59 | 60 | ``` 61 | 62 | Where **X.X.X** is the current version of DrawView Snapshot 63 | 64 | How to use 65 | -------- 66 | Add DrawView to your layout 67 | 68 | ```xml 69 | 89 | ``` 90 | 91 | Attributes 92 | -------- 93 | Please visit [Wiki](https://github.com/ByoxCode/DrawView/wiki) 94 | 95 | Donate 96 | -------- 97 | If this library is useful for you, and you like it, and if want to contribute for develop more libraries, you can buy me a beer. [![PayPal](https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_37x23.jpg)](https://paypal.me/IngMedinaCruz) 98 | 99 | Apps that uses DrawView 100 | -------- 101 | 102 | Please feel free to contact me if you like to appear in this section. 103 | 104 | License 105 | -------- 106 | 107 | Licensed under the Apache License, Version 2.0 (the "License"); 108 | you may not use this file except in compliance with the License. 109 | You may obtain a copy of the License at 110 | 111 | http://www.apache.org/licenses/LICENSE-2.0 112 | 113 | Unless required by applicable law or agreed to in writing, software 114 | distributed under the License is distributed on an "AS IS" BASIS, 115 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 116 | See the License for the specific language governing permissions and 117 | limitations under the License. 118 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion '25.0.2' 6 | defaultConfig { 7 | applicationId "com.byox.drawviewproject" 8 | minSdkVersion 14 9 | targetSdkVersion 25 10 | versionCode 11 11 | versionName "2.6" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | 28 | compile project(path: ':drawview') 29 | 30 | compile 'com.android.support:appcompat-v7:25.3.1' 31 | compile 'com.android.support:design:25.3.1' 32 | compile 'com.android.support:support-v4:25.3.1' 33 | compile 'com.android.support:cardview-v7:25.3.1' 34 | compile 'com.google.firebase:firebase-ads:10.0.0' 35 | compile 'com.squareup.picasso:picasso:2.5.3-SNAPSHOT' 36 | compile 'com.ch4vi.flowlayoutmanager:flowlayoutmanager:1.0.2' 37 | testCompile 'junit:junit:4.12' 38 | } 39 | 40 | 41 | 42 | 43 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\ADT\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/byox/drawviewproject/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.byox.drawviewproject", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/SplashScreenActivity.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject; 2 | 3 | import android.animation.Animator; 4 | import android.content.Intent; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.view.Window; 8 | import android.view.WindowManager; 9 | import android.view.animation.OvershootInterpolator; 10 | import android.widget.ImageView; 11 | 12 | import java.util.Timer; 13 | import java.util.TimerTask; 14 | 15 | public class SplashScreenActivity extends AppCompatActivity { 16 | 17 | // VIEWS 18 | private ImageView mImageViewLogo; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | requestWindowFeature(Window.FEATURE_NO_TITLE); 23 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 24 | WindowManager.LayoutParams.FLAG_FULLSCREEN); 25 | super.onCreate(savedInstanceState); 26 | 27 | setContentView(R.layout.activity_splash_screen); 28 | 29 | mImageViewLogo = (ImageView) findViewById(R.id.iv_logo); 30 | mImageViewLogo.setScaleX(0); 31 | mImageViewLogo.setScaleY(0); 32 | 33 | initSplashScreen(); 34 | } 35 | 36 | // METHODS 37 | private void initSplashScreen() { 38 | mImageViewLogo.animate().scaleX(1).scaleY(1) 39 | .setDuration(500).setInterpolator(new OvershootInterpolator()) 40 | .setStartDelay(200).setListener(new Animator.AnimatorListener() { 41 | @Override 42 | public void onAnimationStart(Animator animator) { 43 | } 44 | 45 | @Override 46 | public void onAnimationEnd(Animator animator) { 47 | TimerTask timerTask = new TimerTask() { 48 | @Override 49 | public void run() { 50 | Intent i = new Intent(SplashScreenActivity.this, MainActivity.class); 51 | startActivity(i); 52 | finish(); 53 | } 54 | }; 55 | 56 | new Timer().schedule(timerTask, 1000); 57 | } 58 | 59 | @Override 60 | public void onAnimationCancel(Animator animator) { 61 | } 62 | 63 | @Override 64 | public void onAnimationRepeat(Animator animator) { 65 | } 66 | }).start(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/adapters/PhotoAdapter.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.adapters; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.CardView; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | 11 | import com.byox.drawviewproject.R; 12 | import com.byox.drawviewproject.listeners.OnClickListener; 13 | import com.squareup.picasso.MemoryPolicy; 14 | import com.squareup.picasso.Picasso; 15 | 16 | import java.io.File; 17 | import java.util.List; 18 | 19 | /** 20 | * Created by Ing. Oscar G. Medina Cruz on 05/09/2016. 21 | */ 22 | public class PhotoAdapter extends RecyclerView.Adapter { 23 | 24 | // INTERFACE 25 | private OnClickListener mOnClickListener; 26 | 27 | // VARS 28 | private List mFileList; 29 | private Context mContext; 30 | private int mItemOriginalHeight = -1; 31 | // boolean isVertical; 32 | 33 | public PhotoAdapter(List fileList, OnClickListener onClickListener) { 34 | mFileList = fileList; 35 | mOnClickListener = onClickListener; 36 | // this.isVertical = isVertical; 37 | } 38 | 39 | public static class ViewHolder extends RecyclerView.ViewHolder { 40 | CardView cardView; 41 | ImageView imageView; 42 | 43 | public ViewHolder(View v) { 44 | super(v); 45 | cardView = (CardView) v.findViewById(R.id.cv_photo_item); 46 | imageView = (ImageView) v.findViewById(R.id.iv_photo_item); 47 | } 48 | } 49 | 50 | @Override 51 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 52 | mContext = parent.getContext(); 53 | return new ViewHolder(LayoutInflater.from(parent.getContext()) 54 | .inflate(R.layout.layout_photo, parent, false)); 55 | } 56 | 57 | @Override 58 | public void onBindViewHolder(ViewHolder holder, final int position) { 59 | Picasso.with(mContext).load(mFileList.get(position)).memoryPolicy(MemoryPolicy.NO_CACHE) 60 | .placeholder(R.color.colorBlackSemitrans).fit().centerCrop().into(holder.imageView); 61 | 62 | if (mOnClickListener != null) { 63 | holder.cardView.setOnClickListener(new View.OnClickListener() { 64 | @Override 65 | public void onClick(View view) { 66 | mOnClickListener.onItemClickListener(view, mFileList.get(position), position); 67 | } 68 | }); 69 | } 70 | } 71 | 72 | @Override 73 | public int getItemCount() { 74 | return mFileList.size(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/behaviors/CustomBottomSheetBehavior.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.behaviors; 2 | 3 | import android.content.Context; 4 | import android.support.design.widget.BottomSheetBehavior; 5 | import android.support.design.widget.CoordinatorLayout; 6 | import android.util.AttributeSet; 7 | import android.view.MotionEvent; 8 | import android.view.View; 9 | 10 | /** 11 | * Created by Ing. Oscar G. Medina Cruz on 22/02/2017. 12 | */ 13 | 14 | public class CustomBottomSheetBehavior extends BottomSheetBehavior { 15 | private boolean mLocked = false; 16 | 17 | public CustomBottomSheetBehavior() {} 18 | 19 | public CustomBottomSheetBehavior(Context context, AttributeSet attrs) { 20 | super(context, attrs); 21 | } 22 | 23 | public void setLocked(boolean locked) { 24 | mLocked = locked; 25 | } 26 | 27 | public boolean isLocked(){ 28 | return mLocked; 29 | } 30 | 31 | @Override 32 | public boolean onInterceptTouchEvent(CoordinatorLayout parent, V child, MotionEvent event) { 33 | boolean handled = false; 34 | 35 | if (!mLocked) { 36 | handled = super.onInterceptTouchEvent(parent, child, event); 37 | } 38 | 39 | return handled; 40 | } 41 | 42 | @Override 43 | public boolean onTouchEvent(CoordinatorLayout parent, V child, MotionEvent event) { 44 | boolean handled = false; 45 | 46 | if (!mLocked) { 47 | handled = super.onTouchEvent(parent, child, event); 48 | } 49 | 50 | return handled; 51 | } 52 | 53 | @Override 54 | public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, V child, View directTargetChild, View target, int nestedScrollAxes) { 55 | boolean handled = false; 56 | 57 | if (!mLocked) { 58 | handled = super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes); 59 | } 60 | 61 | return handled; 62 | } 63 | 64 | @Override 65 | public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, V child, View target, int dx, int dy, int[] consumed) { 66 | if (!mLocked) { 67 | super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed); 68 | } 69 | } 70 | 71 | @Override 72 | public void onStopNestedScroll(CoordinatorLayout coordinatorLayout, V child, View target) { 73 | if (!mLocked) { 74 | super.onStopNestedScroll(coordinatorLayout, child, target); 75 | } 76 | } 77 | 78 | @Override 79 | public boolean onNestedPreFling(CoordinatorLayout coordinatorLayout, V child, View target, float velocityX, float velocityY) { 80 | boolean handled = false; 81 | 82 | if (!mLocked) { 83 | handled = super.onNestedPreFling(coordinatorLayout, child, target, velocityX, velocityY); 84 | } 85 | 86 | return handled; 87 | 88 | } 89 | // private boolean mAllowUserDragging = true; 90 | // /** 91 | // * Default constructor for instantiating BottomSheetBehaviors. 92 | // */ 93 | // public CustomBottomSheetBehavior() { 94 | // super(); 95 | // } 96 | // 97 | // /** 98 | // * Default constructor for inflating BottomSheetBehaviors from layout. 99 | // * 100 | // * @param context The {@link Context}. 101 | // * @param attrs The {@link AttributeSet}. 102 | // */ 103 | // public CustomBottomSheetBehavior(Context context, AttributeSet attrs) { 104 | // super(context, attrs); 105 | // } 106 | // 107 | // public void setAllowUserDragging(boolean allowUserDragging) { 108 | // mAllowUserDragging = allowUserDragging; 109 | // } 110 | // 111 | // @Override 112 | // public boolean onInterceptTouchEvent(CoordinatorLayout parent, V child, MotionEvent event) { 113 | // if (!mAllowUserDragging) { 114 | // return false; 115 | // } 116 | // return super.onInterceptTouchEvent(parent, child, event); 117 | // } 118 | } 119 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/dialogs/RequestTextDialog.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.dialogs; 2 | 3 | import android.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.content.DialogInterface; 6 | import android.graphics.Bitmap; 7 | import android.os.Bundle; 8 | import android.os.Environment; 9 | import android.support.annotation.NonNull; 10 | import android.support.design.widget.TextInputEditText; 11 | import android.support.v4.app.DialogFragment; 12 | import android.text.Editable; 13 | import android.text.TextWatcher; 14 | import android.view.LayoutInflater; 15 | import android.view.View; 16 | import android.widget.ImageView; 17 | 18 | import com.byox.drawviewproject.R; 19 | 20 | import java.io.File; 21 | import java.io.FileNotFoundException; 22 | import java.io.FileOutputStream; 23 | import java.io.IOException; 24 | 25 | /** 26 | * Created by Ing. Oscar G. Medina Cruz on 09/11/2016. 27 | */ 28 | 29 | public class RequestTextDialog extends DialogFragment { 30 | 31 | private static final String REQ_TEXT = "REQ_TEXT"; 32 | 33 | private OnRequestTextListener onRequestTextListener; 34 | 35 | // VARS 36 | private Bitmap mPreviewBitmap; 37 | 38 | public RequestTextDialog() { 39 | } 40 | 41 | public static RequestTextDialog newInstance(String currentText) { 42 | RequestTextDialog requestTextDialog = new RequestTextDialog(); 43 | Bundle bundle = new Bundle(); 44 | bundle.putString(REQ_TEXT, currentText); 45 | requestTextDialog.setArguments(bundle); 46 | return requestTextDialog; 47 | } 48 | 49 | @NonNull 50 | @Override 51 | public Dialog onCreateDialog(Bundle savedInstanceState) { 52 | 53 | View view = LayoutInflater.from(getContext()) 54 | .inflate(R.layout.layout_request_text, null); 55 | final TextInputEditText textInputEditText = (TextInputEditText) view.findViewById(R.id.et_req_text); 56 | 57 | if(!getArguments().getString(REQ_TEXT).equals("")) 58 | textInputEditText.setText(getArguments().getShort(REQ_TEXT)); 59 | 60 | AlertDialog.Builder builder = new AlertDialog.Builder(getContext()) 61 | .setView(view) 62 | .setPositiveButton("Confirm", new DialogInterface.OnClickListener() { 63 | @Override 64 | public void onClick(DialogInterface dialogInterface, int i) { 65 | if (onRequestTextListener != null) 66 | onRequestTextListener.onRequestTextConfirmed(textInputEditText.getText().toString()); 67 | dismiss(); 68 | } 69 | }) 70 | .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { 71 | @Override 72 | public void onClick(DialogInterface dialogInterface, int i) { 73 | if (onRequestTextListener != null) 74 | onRequestTextListener.onRequestTextCancelled(); 75 | dismiss(); 76 | } 77 | }); 78 | 79 | return builder.create(); 80 | } 81 | 82 | // METHODS 83 | 84 | // LISTENER 85 | public void setOnRequestTextListener(OnRequestTextListener onRequestTextListener) { 86 | this.onRequestTextListener = onRequestTextListener; 87 | } 88 | 89 | public interface OnRequestTextListener { 90 | void onRequestTextConfirmed(String requestedText); 91 | 92 | void onRequestTextCancelled(); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/dialogs/SaveBitmapDialog.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.dialogs; 2 | 3 | import android.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.content.DialogInterface; 6 | import android.graphics.Bitmap; 7 | import android.os.Bundle; 8 | import android.os.Environment; 9 | import android.support.annotation.NonNull; 10 | import android.support.design.widget.TextInputEditText; 11 | import android.support.v4.app.DialogFragment; 12 | import android.text.Editable; 13 | import android.text.TextWatcher; 14 | import android.view.LayoutInflater; 15 | import android.view.View; 16 | import android.widget.ImageView; 17 | 18 | import com.byox.drawviewproject.R; 19 | 20 | import java.io.File; 21 | import java.io.FileNotFoundException; 22 | import java.io.FileOutputStream; 23 | import java.io.IOException; 24 | 25 | /** 26 | * Created by Ing. Oscar G. Medina Cruz on 09/11/2016. 27 | */ 28 | 29 | public class SaveBitmapDialog extends DialogFragment { 30 | 31 | private OnSaveBitmapListener onSaveBitmapListener; 32 | 33 | // VARS 34 | private Bitmap mPreviewBitmap; 35 | private String mPreviewFormat; 36 | 37 | public SaveBitmapDialog(){} 38 | 39 | public static SaveBitmapDialog newInstance(){ 40 | return new SaveBitmapDialog(); 41 | } 42 | 43 | @NonNull 44 | @Override 45 | public Dialog onCreateDialog(Bundle savedInstanceState) { 46 | View view = LayoutInflater.from(getContext()) 47 | .inflate(R.layout.layout_save_bitmap, null); 48 | ImageView imageView = (ImageView) view.findViewById(R.id.iv_capture_preview); 49 | final TextInputEditText textInputEditText = (TextInputEditText) view.findViewById(R.id.et_file_name); 50 | 51 | final File filePath = Environment.getExternalStorageDirectory(); 52 | final String[] fileName = {"DrawViewCapture." + mPreviewFormat.toLowerCase()}; 53 | 54 | if (mPreviewBitmap != null) 55 | imageView.setImageBitmap(mPreviewBitmap); 56 | else 57 | imageView.setImageResource(R.color.colorAccent); 58 | textInputEditText.setText(fileName[0]); 59 | 60 | textInputEditText.addTextChangedListener(new TextWatcher() { 61 | @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} 62 | @Override public void afterTextChanged(Editable editable) { } 63 | @Override 64 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { 65 | fileName[0] = charSequence.toString(); 66 | } 67 | }); 68 | 69 | AlertDialog.Builder builder = new AlertDialog.Builder(getContext()) 70 | .setView(view) 71 | .setPositiveButton("Save", new DialogInterface.OnClickListener() { 72 | @Override 73 | public void onClick(DialogInterface dialogInterface, int i) { 74 | try { 75 | if (!fileName[0].contains(".")) 76 | fileName[0] = fileName[0] + "." + mPreviewFormat.toLowerCase(); 77 | textInputEditText.setText(fileName[0]); 78 | 79 | File image = new File(filePath + File.separator + fileName[0]); 80 | image.createNewFile(); 81 | 82 | FileOutputStream fileOutputStream = new FileOutputStream(image); 83 | mPreviewBitmap.compress( 84 | mPreviewFormat.toLowerCase().equals("jpg") ? 85 | Bitmap.CompressFormat.JPEG : 86 | Bitmap.CompressFormat.PNG, 100, fileOutputStream); 87 | 88 | if (onSaveBitmapListener != null) 89 | onSaveBitmapListener.onSaveBitmapCompleted(); 90 | } catch (IOException e) { 91 | e.printStackTrace(); 92 | } 93 | dismiss(); 94 | } 95 | }) 96 | .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { 97 | @Override 98 | public void onClick(DialogInterface dialogInterface, int i) { 99 | if (onSaveBitmapListener != null) 100 | onSaveBitmapListener.onSaveBitmapCanceled(); 101 | dismiss(); 102 | } 103 | }); 104 | 105 | return builder.create(); 106 | } 107 | 108 | // METHODS 109 | public void setPreviewBitmap(Bitmap bitmap){ 110 | this.mPreviewBitmap = bitmap; 111 | } 112 | 113 | public void setPreviewFormat(String previewFormat){ 114 | this.mPreviewFormat = previewFormat; 115 | } 116 | 117 | // LISTENER 118 | public void setOnSaveBitmapListener(OnSaveBitmapListener onSaveBitmapListener){ 119 | this.onSaveBitmapListener = onSaveBitmapListener; 120 | } 121 | 122 | public interface OnSaveBitmapListener{ 123 | void onSaveBitmapCompleted(); 124 | void onSaveBitmapCanceled(); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/dialogs/SelectChoiceDialog.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.dialogs; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.os.Bundle; 6 | import android.support.annotation.NonNull; 7 | import android.support.v4.app.DialogFragment; 8 | import android.support.v7.app.AlertDialog; 9 | 10 | /** 11 | * Created by Ing. Oscar G. Medina Cruz on 07/11/2016. 12 | */ 13 | 14 | public class SelectChoiceDialog extends DialogFragment { 15 | 16 | private OnChoiceDialogListener onChoiceDialogListener; 17 | 18 | private static final String CHOICES_TITLE ="CHOICES_TITLE"; 19 | private static final String CHOICES_ARRAY ="CHOICES_ARRAY"; 20 | 21 | public SelectChoiceDialog() {} 22 | 23 | public static SelectChoiceDialog newInstance(String title, String... choices){ 24 | if (choices.length == 0) 25 | throw new RuntimeException("Be sure to add at least one choise to the dialog!"); 26 | 27 | SelectChoiceDialog selectChoiceDialog = new SelectChoiceDialog(); 28 | Bundle bundle = new Bundle(); 29 | bundle.putString(CHOICES_TITLE, title); 30 | bundle.putStringArray(CHOICES_ARRAY, choices); 31 | selectChoiceDialog.setArguments(bundle); 32 | return selectChoiceDialog; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public Dialog onCreateDialog(Bundle savedInstanceState) { 38 | 39 | AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); 40 | builder.setTitle(getArguments().getString(CHOICES_TITLE)) 41 | .setItems(getArguments().getStringArray(CHOICES_ARRAY), new DialogInterface.OnClickListener() { 42 | @Override 43 | public void onClick(DialogInterface dialogInterface, int i) { 44 | if (onChoiceDialogListener != null) 45 | onChoiceDialogListener.onChoiceSelected(i); 46 | dismiss(); 47 | 48 | } 49 | }); 50 | return builder.create(); 51 | } 52 | 53 | // INTERFACE 54 | public void setOnChoiceDialogListener(OnChoiceDialogListener onChoiceDialogListener){ 55 | this.onChoiceDialogListener = onChoiceDialogListener; 56 | } 57 | 58 | public interface OnChoiceDialogListener{ 59 | void onChoiceSelected(int position); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/dialogs/SelectImageDialog.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.dialogs; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.graphics.Bitmap; 6 | import android.graphics.BitmapFactory; 7 | import android.os.AsyncTask; 8 | import android.os.Bundle; 9 | import android.os.Environment; 10 | import android.support.annotation.NonNull; 11 | import android.support.design.widget.BottomSheetBehavior; 12 | import android.support.design.widget.BottomSheetDialogFragment; 13 | import android.support.design.widget.CoordinatorLayout; 14 | import android.support.v4.app.DialogFragment; 15 | import android.support.v4.content.ContextCompat; 16 | import android.support.v4.os.AsyncTaskCompat; 17 | import android.support.v4.widget.SwipeRefreshLayout; 18 | import android.support.v7.app.AlertDialog; 19 | import android.support.v7.widget.GridLayoutManager; 20 | import android.support.v7.widget.RecyclerView; 21 | import android.view.Gravity; 22 | import android.view.LayoutInflater; 23 | import android.view.View; 24 | import android.view.Window; 25 | import android.widget.ImageView; 26 | import android.widget.LinearLayout; 27 | import android.widget.TextView; 28 | 29 | import com.byox.drawviewproject.R; 30 | import com.byox.drawviewproject.adapters.PhotoAdapter; 31 | import com.byox.drawviewproject.behaviors.CustomBottomSheetBehavior; 32 | import com.byox.drawviewproject.listeners.OnClickListener; 33 | import com.byox.drawviewproject.utils.FileUtils; 34 | import com.byox.drawviewproject.utils.LayoutUtils; 35 | 36 | import java.io.ByteArrayOutputStream; 37 | import java.io.File; 38 | import java.util.List; 39 | 40 | /** 41 | * Created by Ing. Oscar G. Medina Cruz on 21/12/2016. 42 | */ 43 | 44 | public class SelectImageDialog extends BottomSheetDialogFragment { 45 | 46 | public static final String SELEC_IMAGE_DIALOG = "SELECT_IMAGE_DIALOG"; 47 | 48 | // LISTENER 49 | private OnImageSelectListener onImageSelectListener; 50 | 51 | // VIEWS 52 | private SwipeRefreshLayout mSwipeRefreshLayout; 53 | private RecyclerView mRecyclerView; 54 | private LinearLayout mNoImages; 55 | 56 | // VARS 57 | private CustomBottomSheetBehavior mCustomBottomSheetBehavior; 58 | private int mRecyclerViewScrollAmount = 0; 59 | 60 | public SelectImageDialog() { 61 | } 62 | 63 | public static SelectImageDialog newInstance() { 64 | return new SelectImageDialog(); 65 | } 66 | 67 | @Override 68 | public void setupDialog(Dialog dialog, int style) { 69 | View view = LayoutInflater.from(getContext()).inflate(R.layout.layout_select_image, null); 70 | 71 | mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.srl_select_image); 72 | mRecyclerView = (RecyclerView) view.findViewById(R.id.rv_select_image); 73 | mNoImages = (LinearLayout) view.findViewById(R.id.ll_no_images); 74 | 75 | mSwipeRefreshLayout.setColorSchemeColors(ContextCompat.getColor(getContext(), R.color.colorPrimary)); 76 | mRecyclerView.setHasFixedSize(true); 77 | mRecyclerView.setLayoutManager(LayoutUtils.GetFlowLayoutManager(getContext())); 78 | 79 | mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { 80 | @Override 81 | public void onRefresh() { 82 | AsyncTaskCompat.executeParallel(new LoadImagesFromStorage()); 83 | } 84 | }); 85 | 86 | AsyncTaskCompat.executeParallel(new LoadImagesFromStorage()); 87 | 88 | setListeners(); 89 | 90 | dialog.setContentView(view); 91 | 92 | mCustomBottomSheetBehavior = new CustomBottomSheetBehavior(); 93 | mCustomBottomSheetBehavior.setLocked(false); 94 | mCustomBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); 95 | mCustomBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { 96 | @Override 97 | public void onStateChanged(@NonNull View bottomSheet, int newState) { 98 | if (newState == BottomSheetBehavior.STATE_COLLAPSED) 99 | dismiss(); 100 | } 101 | 102 | @Override 103 | public void onSlide(@NonNull View bottomSheet, float slideOffset) { 104 | 105 | } 106 | }); 107 | 108 | CoordinatorLayout.LayoutParams layoutParams = 109 | (CoordinatorLayout.LayoutParams) ((View) view.getParent()).getLayoutParams(); 110 | layoutParams.setBehavior(mCustomBottomSheetBehavior); 111 | } 112 | 113 | private void setListeners(){ 114 | mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { 115 | @Override 116 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 117 | super.onScrolled(recyclerView, dx, dy); 118 | 119 | mRecyclerViewScrollAmount += dy; 120 | 121 | if (mRecyclerViewScrollAmount > 0) 122 | mCustomBottomSheetBehavior.setLocked(true); 123 | else { 124 | mCustomBottomSheetBehavior.setLocked(false); 125 | mRecyclerViewScrollAmount = 0; 126 | } 127 | } 128 | }); 129 | } 130 | 131 | private class LoadImagesFromStorage extends AsyncTask{ 132 | private List imageList; 133 | 134 | @Override 135 | protected void onPreExecute() { 136 | super.onPreExecute(); 137 | 138 | mNoImages.setVisibility(View.INVISIBLE); 139 | 140 | mSwipeRefreshLayout.post(new Runnable() { 141 | @Override 142 | public void run() { 143 | mSwipeRefreshLayout.setRefreshing(true); 144 | } 145 | }); 146 | } 147 | 148 | @Override 149 | protected Void doInBackground(Void... voids) { 150 | imageList = FileUtils.GetSortedFilesByDate( 151 | FileUtils.GetImageList(Environment.getExternalStorageDirectory())); 152 | return null; 153 | } 154 | 155 | @Override 156 | protected void onPostExecute(Void v) { 157 | super.onPostExecute(v); 158 | 159 | if (!isCancelled()){ 160 | PhotoAdapter photoAdapter = 161 | new PhotoAdapter(imageList, 162 | new OnClickListener() { 163 | @Override 164 | public void onItemClickListener(View view, Object contentObject, int position) { 165 | ByteArrayOutputStream byteArrayOutputStream = 166 | new ByteArrayOutputStream(); 167 | BitmapFactory.decodeFile(((File) contentObject).getPath()) 168 | .compress(Bitmap.CompressFormat.JPEG, 60, byteArrayOutputStream); 169 | if (onImageSelectListener != null) { 170 | onImageSelectListener.onSelectImage((File) contentObject); 171 | onImageSelectListener.onSelectImage(byteArrayOutputStream.toByteArray()); 172 | } 173 | dismiss(); 174 | } 175 | }); 176 | mRecyclerView.setAdapter(photoAdapter); 177 | 178 | mSwipeRefreshLayout.post(new Runnable() { 179 | @Override 180 | public void run() { 181 | mSwipeRefreshLayout.setRefreshing(false); 182 | mSwipeRefreshLayout.setEnabled(false); 183 | } 184 | }); 185 | 186 | if (imageList.size() == 0) 187 | mNoImages.setVisibility(View.VISIBLE); 188 | } 189 | } 190 | } 191 | 192 | // INTERFACES 193 | public void setOnImageSelectListener(OnImageSelectListener onImageSelectListener){ 194 | this.onImageSelectListener = onImageSelectListener; 195 | } 196 | 197 | public interface OnImageSelectListener{ 198 | void onSelectImage(File imageFile); 199 | void onSelectImage(byte[] imageBytes); 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/listeners/OnClickListener.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.listeners; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by Ing. Oscar G. Medina Cruz on 04/08/2016. 7 | */ 8 | public interface OnClickListener { 9 | void onItemClickListener(View view, Object contentObject, int position); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/utils/AnimateUtils.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.utils; 2 | 3 | import android.view.View; 4 | import android.view.animation.AlphaAnimation; 5 | import android.view.animation.Animation; 6 | import android.view.animation.Interpolator; 7 | import android.view.animation.ScaleAnimation; 8 | 9 | /** 10 | * Created by Ing. Oscar G. Medina Cruz on 18/06/2016. 11 | */ 12 | public class AnimateUtils { 13 | 14 | public static void ScaleInAnimation(final View view, int startOffset, int duration, 15 | Interpolator interpolator, final boolean isInvisible) { 16 | ScaleAnimation scaleInAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 17 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 18 | scaleInAnimation.setInterpolator(interpolator); 19 | scaleInAnimation.setDuration(duration); 20 | scaleInAnimation.setStartOffset(startOffset); 21 | scaleInAnimation.setAnimationListener(new Animation.AnimationListener() { 22 | @Override 23 | public void onAnimationStart(Animation animation) { 24 | if (isInvisible) { 25 | view.setVisibility(View.VISIBLE); 26 | } 27 | } 28 | 29 | @Override 30 | public void onAnimationEnd(Animation animation) { 31 | } 32 | 33 | @Override 34 | public void onAnimationRepeat(Animation animation) { 35 | } 36 | }); 37 | view.startAnimation(scaleInAnimation); 38 | } 39 | 40 | public static void ScaleInAnimation(final View view, int startOffset, int duration, 41 | Interpolator interpolator, Animation.AnimationListener animationListener) { 42 | ScaleAnimation scaleInAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 43 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 44 | scaleInAnimation.setInterpolator(interpolator); 45 | scaleInAnimation.setDuration(duration); 46 | scaleInAnimation.setStartOffset(startOffset); 47 | if (animationListener != null) 48 | scaleInAnimation.setAnimationListener(animationListener); 49 | view.startAnimation(scaleInAnimation); 50 | } 51 | 52 | public static void ScaleOutAnimation(final View view, int startOffset, int duration, 53 | Interpolator interpolator, final boolean invisibleAtEnd) { 54 | ScaleAnimation scaleInAnimation = new ScaleAnimation(1f, 0f, 1f, 0f, Animation.RELATIVE_TO_SELF, 55 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 56 | scaleInAnimation.setInterpolator(interpolator); 57 | scaleInAnimation.setDuration(duration); 58 | scaleInAnimation.setStartOffset(startOffset); 59 | scaleInAnimation.setAnimationListener(new Animation.AnimationListener() { 60 | @Override 61 | public void onAnimationStart(Animation animation) { 62 | } 63 | 64 | @Override 65 | public void onAnimationEnd(Animation animation) { 66 | if (invisibleAtEnd) { 67 | view.setVisibility(View.INVISIBLE); 68 | } 69 | } 70 | 71 | @Override 72 | public void onAnimationRepeat(Animation animation) { 73 | } 74 | }); 75 | view.startAnimation(scaleInAnimation); 76 | } 77 | 78 | public static void ScaleOutAnimation(final View view, int startOffset, int duration, 79 | Interpolator interpolator, Animation.AnimationListener animationListener) { 80 | ScaleAnimation scaleInAnimation = new ScaleAnimation(1f, 0f, 1f, 0f, Animation.RELATIVE_TO_SELF, 81 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 82 | scaleInAnimation.setInterpolator(interpolator); 83 | scaleInAnimation.setDuration(duration); 84 | scaleInAnimation.setStartOffset(startOffset); 85 | if (animationListener != null) 86 | scaleInAnimation.setAnimationListener(animationListener); 87 | view.startAnimation(scaleInAnimation); 88 | } 89 | 90 | public static void FlipOutHorizontalAnimation(final View view, int startOffset, int duration, 91 | Interpolator interpolator, final boolean invisibleAtEnd) { 92 | ScaleAnimation flipOutAnimation = new ScaleAnimation(1f, 0f, 1f, 1f, Animation.RELATIVE_TO_SELF, 93 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 94 | flipOutAnimation.setInterpolator(interpolator); 95 | flipOutAnimation.setDuration(duration); 96 | flipOutAnimation.setStartOffset(startOffset); 97 | flipOutAnimation.setAnimationListener(new Animation.AnimationListener() { 98 | @Override 99 | public void onAnimationStart(Animation animation) { 100 | } 101 | 102 | @Override 103 | public void onAnimationEnd(Animation animation) { 104 | if (invisibleAtEnd) { 105 | view.setVisibility(View.INVISIBLE); 106 | } 107 | } 108 | 109 | @Override 110 | public void onAnimationRepeat(Animation animation) { 111 | } 112 | }); 113 | view.startAnimation(flipOutAnimation); 114 | } 115 | 116 | public static void FlipOutHorizontalAnimation(final View view, int startOffset, int duration, 117 | Interpolator interpolator, Animation.AnimationListener animationListener){ 118 | ScaleAnimation flipOutAnimation = new ScaleAnimation(1f, 0f, 1f, 1f, Animation.RELATIVE_TO_SELF, 119 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 120 | flipOutAnimation.setInterpolator(interpolator); 121 | flipOutAnimation.setDuration(duration); 122 | flipOutAnimation.setStartOffset(startOffset); 123 | if (animationListener != null) 124 | flipOutAnimation.setAnimationListener(animationListener); 125 | view.startAnimation(flipOutAnimation); 126 | } 127 | 128 | public static void FlipInHorizontalAnimation(final View view, int startOffset, int duration, 129 | Interpolator interpolator, final boolean visibleAtEnd) { 130 | ScaleAnimation flipInAnimation = new ScaleAnimation(0f, 1f, 1f, 1f, Animation.RELATIVE_TO_SELF, 131 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 132 | flipInAnimation.setInterpolator(interpolator); 133 | flipInAnimation.setDuration(duration); 134 | flipInAnimation.setStartOffset(startOffset); 135 | flipInAnimation.setAnimationListener(new Animation.AnimationListener() { 136 | @Override 137 | public void onAnimationStart(Animation animation) { 138 | } 139 | 140 | @Override 141 | public void onAnimationEnd(Animation animation) { 142 | if (visibleAtEnd) { 143 | view.setVisibility(View.VISIBLE); 144 | } 145 | } 146 | 147 | @Override 148 | public void onAnimationRepeat(Animation animation) { 149 | } 150 | }); 151 | view.startAnimation(flipInAnimation); 152 | } 153 | 154 | public static void FlipInHorizontalAnimation(final View view, int startOffset, int duration, 155 | Interpolator interpolator, Animation.AnimationListener animationListener){ 156 | ScaleAnimation flipInAnimation = new ScaleAnimation(0f, 1f, 1f, 1f, Animation.RELATIVE_TO_SELF, 157 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 158 | flipInAnimation.setInterpolator(interpolator); 159 | flipInAnimation.setDuration(duration); 160 | flipInAnimation.setStartOffset(startOffset); 161 | if (animationListener != null) 162 | flipInAnimation.setAnimationListener(animationListener); 163 | view.startAnimation(flipInAnimation); 164 | } 165 | 166 | public static void FlipOutVerticalAnimation(final View view, int startOffset, int duration, 167 | Interpolator interpolator, final boolean invisibleAtEnd) { 168 | ScaleAnimation flipOutAnimation = new ScaleAnimation(1f, 1f, 1f, 0f, Animation.RELATIVE_TO_SELF, 169 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 170 | flipOutAnimation.setInterpolator(interpolator); 171 | flipOutAnimation.setDuration(duration); 172 | flipOutAnimation.setStartOffset(startOffset); 173 | flipOutAnimation.setAnimationListener(new Animation.AnimationListener() { 174 | @Override 175 | public void onAnimationStart(Animation animation) { 176 | } 177 | 178 | @Override 179 | public void onAnimationEnd(Animation animation) { 180 | if (invisibleAtEnd) { 181 | view.setVisibility(View.INVISIBLE); 182 | } 183 | } 184 | 185 | @Override 186 | public void onAnimationRepeat(Animation animation) { 187 | } 188 | }); 189 | view.startAnimation(flipOutAnimation); 190 | } 191 | 192 | public static void FlipOutVerticalAnimation(final View view, int startOffset, int duration, 193 | Interpolator interpolator, Animation.AnimationListener animationListener){ 194 | ScaleAnimation flipOutAnimation = new ScaleAnimation(1f, 1f, 1f, 0f, Animation.RELATIVE_TO_SELF, 195 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 196 | flipOutAnimation.setInterpolator(interpolator); 197 | flipOutAnimation.setDuration(duration); 198 | flipOutAnimation.setStartOffset(startOffset); 199 | if (animationListener != null) 200 | flipOutAnimation.setAnimationListener(animationListener); 201 | view.startAnimation(flipOutAnimation); 202 | } 203 | 204 | public static void FlipInVerticalAnimation(final View view, int startOffset, int duration, 205 | Interpolator interpolator, final boolean visibleAtEnd) { 206 | ScaleAnimation flipOutAnimation = new ScaleAnimation(1f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 207 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 208 | flipOutAnimation.setInterpolator(interpolator); 209 | flipOutAnimation.setDuration(duration); 210 | flipOutAnimation.setStartOffset(startOffset); 211 | flipOutAnimation.setAnimationListener(new Animation.AnimationListener() { 212 | @Override 213 | public void onAnimationStart(Animation animation) { 214 | } 215 | 216 | @Override 217 | public void onAnimationEnd(Animation animation) { 218 | if (visibleAtEnd) { 219 | view.setVisibility(View.VISIBLE); 220 | } 221 | } 222 | 223 | @Override 224 | public void onAnimationRepeat(Animation animation) { 225 | } 226 | }); 227 | view.startAnimation(flipOutAnimation); 228 | } 229 | 230 | public static void FlipInVerticalAnimation(final View view, int startOffset, int duration, 231 | Interpolator interpolator, Animation.AnimationListener animationListener){ 232 | ScaleAnimation flipOutAnimation = new ScaleAnimation(1f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 233 | 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 234 | flipOutAnimation.setInterpolator(interpolator); 235 | flipOutAnimation.setDuration(duration); 236 | flipOutAnimation.setStartOffset(startOffset); 237 | if (animationListener != null) 238 | flipOutAnimation.setAnimationListener(animationListener); 239 | view.startAnimation(flipOutAnimation); 240 | } 241 | 242 | public static void FadeInAnimation(final View view, int startOffset, int duration, 243 | Interpolator interpolator, final boolean visibleAtEnd) { 244 | AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f); 245 | alphaAnimation.setInterpolator(interpolator); 246 | alphaAnimation.setDuration(duration); 247 | alphaAnimation.setStartOffset(startOffset); 248 | alphaAnimation.setAnimationListener(new Animation.AnimationListener() { 249 | @Override 250 | public void onAnimationStart(Animation animation) { 251 | } 252 | 253 | @Override 254 | public void onAnimationEnd(Animation animation) { 255 | if (visibleAtEnd) { 256 | view.setVisibility(View.VISIBLE); 257 | } 258 | } 259 | 260 | @Override 261 | public void onAnimationRepeat(Animation animation) { 262 | } 263 | }); 264 | view.startAnimation(alphaAnimation); 265 | } 266 | 267 | public static void FadeInAnimation(final View view, int startOffset, int duration, 268 | Interpolator interpolator, Animation.AnimationListener animationListener){ 269 | AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f); 270 | alphaAnimation.setInterpolator(interpolator); 271 | alphaAnimation.setDuration(duration); 272 | alphaAnimation.setStartOffset(startOffset); 273 | if (animationListener != null) 274 | alphaAnimation.setAnimationListener(animationListener); 275 | view.startAnimation(alphaAnimation); 276 | } 277 | 278 | public static void FadeOutAnimation(final View view, int startOffset, int duration, 279 | Interpolator interpolator, final boolean invisibleAtEnd) { 280 | AlphaAnimation alphaAnimation = new AlphaAnimation(1f, 0f); 281 | alphaAnimation.setInterpolator(interpolator); 282 | alphaAnimation.setDuration(duration); 283 | alphaAnimation.setStartOffset(startOffset); 284 | alphaAnimation.setAnimationListener(new Animation.AnimationListener() { 285 | @Override 286 | public void onAnimationStart(Animation animation) { 287 | } 288 | 289 | @Override 290 | public void onAnimationEnd(Animation animation) { 291 | if (invisibleAtEnd) { 292 | view.setVisibility(View.INVISIBLE); 293 | } 294 | } 295 | 296 | @Override 297 | public void onAnimationRepeat(Animation animation) { 298 | } 299 | }); 300 | view.startAnimation(alphaAnimation); 301 | } 302 | 303 | public static void FadeOutAnimation(final View view, int startOffset, int duration, 304 | Interpolator interpolator, Animation.AnimationListener animationListener){ 305 | AlphaAnimation alphaAnimation = new AlphaAnimation(1f, 0f); 306 | alphaAnimation.setInterpolator(interpolator); 307 | alphaAnimation.setDuration(duration); 308 | alphaAnimation.setStartOffset(startOffset); 309 | if (animationListener != null) 310 | alphaAnimation.setAnimationListener(animationListener); 311 | view.startAnimation(alphaAnimation); 312 | } 313 | } 314 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.utils; 2 | 3 | import android.content.Context; 4 | import android.content.res.AssetManager; 5 | import android.graphics.Bitmap; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.ByteArrayOutputStream; 9 | import java.io.File; 10 | import java.io.FileInputStream; 11 | import java.io.FileOutputStream; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.io.InputStreamReader; 15 | import java.net.URL; 16 | import java.util.ArrayList; 17 | import java.util.Arrays; 18 | import java.util.Comparator; 19 | import java.util.List; 20 | 21 | /** 22 | * Created by Ing. Oscar G. Medina Cruz on 20/07/2016. 23 | */ 24 | public class FileUtils { 25 | 26 | // DIRECTORIES 27 | public static String FILE_DIRECTORY = "/FILES"; 28 | 29 | // FILES 30 | public static String PET_APPOINTMENTS_JSON = "/pet_appointments.json"; 31 | 32 | public static String ReadAssetFileAsString(AssetManager assetManager, String fileToRead) throws IOException { 33 | StringBuilder stringBuilder = new StringBuilder(); 34 | InputStream inputStream = assetManager.open(fileToRead); 35 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); 36 | String line; 37 | 38 | while ((line = bufferedReader.readLine()) != null) 39 | stringBuilder.append(line); 40 | 41 | bufferedReader.close(); 42 | 43 | return stringBuilder.toString(); 44 | } 45 | 46 | public static String ReadFileAsString(String fileToRead) throws IOException { 47 | File file = new File(fileToRead); 48 | 49 | StringBuilder stringBuilder = new StringBuilder(); 50 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); 51 | String line; 52 | 53 | while ((line = bufferedReader.readLine()) != null) 54 | stringBuilder.append(line); 55 | 56 | bufferedReader.close(); 57 | 58 | return stringBuilder.toString(); 59 | } 60 | 61 | public static boolean CheckFileExists(String fileName) { 62 | File file = new File(fileName); 63 | return file.exists(); 64 | } 65 | 66 | public static void WriteFile(Context context, String folderName, String fileName, 67 | String fileContent) throws IOException { 68 | File fileDirectory = new File(context.getFilesDir().getAbsolutePath() + folderName); 69 | if (!fileDirectory.exists()) 70 | fileDirectory.mkdirs(); 71 | 72 | File file = new File(context.getFilesDir().getAbsolutePath() + folderName + fileName); 73 | FileOutputStream fileOutputStream = new FileOutputStream(file); 74 | fileOutputStream.write(fileContent.getBytes()); 75 | fileOutputStream.close(); 76 | } 77 | 78 | public static List GetImageList(File parentDir) { 79 | List inFiles = new ArrayList<>(); 80 | File[] files = parentDir.listFiles(); 81 | 82 | try { 83 | for (File file : files) { 84 | if (file.isDirectory() && 85 | !file.getName().toLowerCase().endsWith("android") && 86 | !file.getName().toLowerCase().endsWith("thumbnails") && 87 | !file.getName().toLowerCase().startsWith(".")) { 88 | if (file.listFiles().length > 0) 89 | inFiles.addAll(GetImageList(file)); 90 | } else { 91 | if (file.getName().toLowerCase().endsWith("jpg") || 92 | file.getName().toLowerCase().endsWith("png")) 93 | inFiles.add(file); 94 | } 95 | } 96 | } catch (Exception e) { 97 | e.printStackTrace(); 98 | } 99 | return inFiles; 100 | } 101 | 102 | public static List GetSortedFilesByDate(List fileList) { 103 | File[] files = new File[fileList.size()]; 104 | for (int i = 0; i < files.length; i++) 105 | files[i] = (File) fileList.get(i); 106 | Arrays.sort(files, new Comparator() { 107 | public int compare(Object o1, Object o2) { 108 | if (((File) o1).lastModified() > ((File) o2).lastModified()) { 109 | return -1; 110 | } else if (((File) o1).lastModified() < ((File) o2).lastModified()) { 111 | return +1; 112 | } else { 113 | return 0; 114 | } 115 | } 116 | 117 | }); 118 | fileList = Arrays.asList(files); 119 | files = null; 120 | return fileList; 121 | } 122 | 123 | public static byte[] GetFileAsByteArray(File file) { 124 | FileInputStream fileInputStream = null; 125 | byte[] bFile = new byte[(int) file.length()]; 126 | try { 127 | fileInputStream = new FileInputStream(file); 128 | fileInputStream.read(bFile); 129 | fileInputStream.close(); 130 | return bFile; 131 | } catch (Exception e) { 132 | e.printStackTrace(); 133 | } 134 | return null; 135 | } 136 | 137 | public static byte[] GetByteArrayFromURL(String url) throws IOException { 138 | URL imageUrl = new URL(url); 139 | InputStream inputStream = imageUrl.openStream(); 140 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 141 | byte[] buffer = new byte[1024]; 142 | int read = 0; 143 | while ((read = inputStream.read(buffer, 0, buffer.length)) != -1) { 144 | baos.write(buffer, 0, read); 145 | } 146 | baos.flush(); 147 | return baos.toByteArray(); 148 | } 149 | 150 | public static File SaveBitmapInTemporaryFile(Bitmap bitmap, Bitmap.CompressFormat compressFormat, int quality) throws IOException { 151 | File file = File.createTempFile("temp", ".jpg"); 152 | FileOutputStream fileOutputStream = new FileOutputStream(file); 153 | bitmap.compress(compressFormat, quality, fileOutputStream); 154 | return file; 155 | } 156 | 157 | public static File SaveBitmapInTemporaryFile(Bitmap bitmap, String fileName, Bitmap.CompressFormat compressFormat, int quality) throws IOException { 158 | File file = File.createTempFile(fileName, ".jpg"); 159 | FileOutputStream fileOutputStream = new FileOutputStream(file); 160 | bitmap.compress(compressFormat, quality, fileOutputStream); 161 | return file; 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /app/src/main/java/com/byox/drawviewproject/utils/LayoutUtils.java: -------------------------------------------------------------------------------- 1 | package com.byox.drawviewproject.utils; 2 | 3 | import android.content.Context; 4 | import android.content.res.Configuration; 5 | import android.support.v7.widget.RecyclerView; 6 | 7 | import com.byox.drawviewproject.R; 8 | import com.ch4vi.flowlayoutmanager.FlowLayoutManager; 9 | 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | import kotlin.Pair; 13 | 14 | /** 15 | * Created by IngMedina on 28/03/2017. 16 | */ 17 | 18 | public class LayoutUtils { 19 | private static final int PHONE_PORTRAIT_COLUMNS_LAYOUT_COLUMNS = 3; 20 | private static final int PHONE_LANDSCAPE_COLUMNS_LAYOUT_COLUMNS = 5; 21 | 22 | private static final Object[] PORTRAIT_FLOW_LAYOUT_PATTERN = 23 | new Object[]{new Pair<>(3, 2), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 24 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(2, 2), 25 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(3, 3), new Pair<>(1, 1), 26 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 2), new Pair<>(1, 1), 27 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(2, 1), 28 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 2), 29 | new Pair<>(2, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 30 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 31 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 32 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 33 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1)}; 34 | private static final Object[] LANDSCAPE_FLOW_LAYOUT_PATTERN = 35 | new Object[]{new Pair<>(3, 3), new Pair<>(2, 2), new Pair<>(1, 1), new Pair<>(1, 1), 36 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 37 | new Pair<>(1, 1), new Pair<>(2, 1), new Pair<>(1, 1), new Pair<>(1, 1), 38 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 39 | new Pair<>(2, 2), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 40 | new Pair<>(1, 1), new Pair<>(3, 3), new Pair<>(1, 1), new Pair<>(1, 2), 41 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 42 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(2, 2), 43 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 44 | new Pair<>(2, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 45 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1), 46 | new Pair<>(1, 1), new Pair<>(1, 1), new Pair<>(1, 1)}; 47 | private static int mFlowLayoutPositionMultiplier = 0; 48 | 49 | 50 | public static RecyclerView.LayoutManager GetFlowLayoutManager(Context context) { 51 | mFlowLayoutPositionMultiplier = 0; 52 | RecyclerView.LayoutManager layoutManager = null; 53 | if (!context.getResources().getBoolean(R.bool.isTablet)) { 54 | switch (context.getResources().getConfiguration().orientation) { 55 | case Configuration.ORIENTATION_PORTRAIT: 56 | layoutManager = new FlowLayoutManager(PHONE_PORTRAIT_COLUMNS_LAYOUT_COLUMNS, 57 | RecyclerView.VERTICAL, new FlowLayoutManager.Interface() { 58 | @NotNull 59 | @Override 60 | public Pair getProportionalSizeForChild(int i) { 61 | if (i == 0) 62 | mFlowLayoutPositionMultiplier = 0; 63 | 64 | Pair pair; 65 | 66 | if (i - (PORTRAIT_FLOW_LAYOUT_PATTERN.length * mFlowLayoutPositionMultiplier) == 67 | PORTRAIT_FLOW_LAYOUT_PATTERN.length) 68 | mFlowLayoutPositionMultiplier++; 69 | 70 | pair = (Pair) 71 | PORTRAIT_FLOW_LAYOUT_PATTERN[i - (PORTRAIT_FLOW_LAYOUT_PATTERN.length * mFlowLayoutPositionMultiplier)]; 72 | 73 | return pair; 74 | } 75 | }); 76 | break; 77 | case Configuration.ORIENTATION_LANDSCAPE: 78 | layoutManager = new FlowLayoutManager(PHONE_LANDSCAPE_COLUMNS_LAYOUT_COLUMNS, 79 | RecyclerView.VERTICAL, new FlowLayoutManager.Interface() { 80 | @NotNull 81 | @Override 82 | public Pair getProportionalSizeForChild(int i) { 83 | if (i == 0) 84 | mFlowLayoutPositionMultiplier = 0; 85 | 86 | Pair pair; 87 | 88 | if (i - (LANDSCAPE_FLOW_LAYOUT_PATTERN.length * mFlowLayoutPositionMultiplier) == 89 | LANDSCAPE_FLOW_LAYOUT_PATTERN.length) 90 | mFlowLayoutPositionMultiplier++; 91 | 92 | pair = (Pair) 93 | LANDSCAPE_FLOW_LAYOUT_PATTERN[i - (LANDSCAPE_FLOW_LAYOUT_PATTERN.length * mFlowLayoutPositionMultiplier)]; 94 | 95 | return pair; 96 | } 97 | }); 98 | break; 99 | } 100 | } 101 | 102 | return layoutManager; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/res/animator-v21/appbar_always_elevated.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_content_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_content_redo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_content_redo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_content_redo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_content_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_content_undo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_content_undo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_content_undo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_format_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_format_paint.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_more_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_more_vert.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_palette.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_photo_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_photo_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_action_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_content_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_content_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_content_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_content_clear.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_content_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_content_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_editor_mode_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_editor_mode_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_image_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_image_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_image_color_lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_image_color_lens.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_mood_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-hdpi/ic_mood_bad.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_content_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_content_redo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_content_redo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_content_redo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_content_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_content_undo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_content_undo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_content_undo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_format_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_format_paint.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_more_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_more_vert.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_palette.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_photo_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_photo_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_action_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_content_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_content_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_content_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_content_clear.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_content_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_content_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_editor_mode_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_editor_mode_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_image_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_image_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_image_color_lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_image_color_lens.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_mood_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-mdpi/ic_mood_bad.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_content_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_content_redo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_content_redo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_content_redo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_content_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_content_undo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_content_undo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_content_undo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_format_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_format_paint.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_more_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_more_vert.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_palette.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_photo_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_photo_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_action_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_content_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_content_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_content_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_content_clear.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_content_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_content_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_editor_mode_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_editor_mode_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_image_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_image_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_image_color_lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_image_color_lens.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_mood_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xhdpi/ic_mood_bad.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_content_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_content_redo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_content_redo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_content_redo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_content_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_content_undo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_content_undo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_content_undo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_format_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_format_paint.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_more_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_more_vert.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_palette.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_photo_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_photo_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_action_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_content_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_content_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_content_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_content_clear.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_content_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_content_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_editor_mode_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_editor_mode_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_image_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_image_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_image_color_lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_image_color_lens.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mood_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxhdpi/ic_mood_bad.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_content_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_content_redo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_content_redo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_content_redo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_content_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_content_undo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_content_undo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_content_undo_disabled.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_format_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_format_paint.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_more_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_more_vert.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_palette.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_photo_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_photo_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_action_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_content_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_content_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_content_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_content_clear.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_content_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_content_save.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_editor_mode_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_editor_mode_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_image_brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_image_brush.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_image_color_lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_image_color_lens.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_mood_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable-xxxhdpi/ic_mood_bad.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_transparent_dialog_pattern.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/transparent_dialog_pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/drawable/transparent_dialog_pattern.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 257 | 258 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 40 | 41 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 33 | 34 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_draw_attribs.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 23 | 24 | 32 | 33 | 40 | 41 | 50 | 51 | 52 | 57 | 58 | 66 | 67 | 74 | 75 | 84 | 85 | 86 | 91 | 92 | 100 | 101 | 108 | 109 | 118 | 119 | 120 | 128 | 129 | 137 | 138 | 146 | 147 | 155 | 156 | 164 | 165 | 173 | 174 | 179 | 180 | 188 | 189 | 197 | 198 | 199 | 206 | 207 | 212 | 213 | 221 | 222 | 230 | 231 | 239 | 240 | 241 | 248 | 249 | 254 | 255 | 263 | 264 | 272 | 273 | 281 | 282 | 283 | 290 | 291 | 296 | 297 | 306 | 307 | 316 | 317 | 326 | 327 | 336 | 337 | 338 | 339 | 340 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_photo.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_request_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_save_bitmap.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 21 | 22 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_select_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 18 | 19 | 26 | 27 | 32 | 33 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 16 | 21 | 22 | 26 | 30 | 34 | 38 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 16 | 17 | 22 | 23 | 28 | 33 | 34 | 35 | 36 | 37 | 42 | 43 | 47 | 51 | 55 | 59 | 63 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ByoxCode/DrawView/db51f11de75aa836c3a910d86e56d509bbc25778/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-sw600dp/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #00695C 4 | #004D40 5 | #0091EA 6 | 7 | #FFF 8 | 9 | #AFFF 10 | #A000 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DrawView Library 3 | 4 | Stroke width: %1$d 5 | Opacity: %1$d 6 | Font size: %1$d 7 | 8 | Undo 9 | Redo 10 | Functions 11 | Draw attributes 12 | Background image 13 | Draw tool 14 | Draw mode 15 | Save draw 16 | Camera option 17 | DrawView option 18 | 19 | 20 | ca-app-pub-6238951090454835/7400289908 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 17 | 18 |