├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── preloaded_fonts.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── themes.xml │ │ │ │ └── font_certs.xml │ │ │ ├── values-land │ │ │ │ └── dimens.xml │ │ │ ├── values-w1240dp │ │ │ │ └── dimens.xml │ │ │ ├── values-w600dp │ │ │ │ └── dimens.xml │ │ │ ├── font │ │ │ │ ├── aladin.ttf │ │ │ │ ├── alata.ttf │ │ │ │ └── baloo_da.ttf │ │ │ ├── drawable │ │ │ │ ├── btn_bg.png │ │ │ │ ├── board_bg.png │ │ │ │ ├── hand_400x.png │ │ │ │ ├── drawing_app_bg.jpg │ │ │ │ ├── drawing_app_home_image.png │ │ │ │ ├── rounded_white_bg.xml │ │ │ │ ├── rounded_grey_400_bg.xml │ │ │ │ ├── redo_selector.xml │ │ │ │ ├── undo_selector.xml │ │ │ │ ├── rounded_stroke_white_bg.xml │ │ │ │ ├── circle_selector_bg.xml │ │ │ │ ├── btn_default_white_bg.xml │ │ │ │ ├── btn_selected_white_bg.xml │ │ │ │ ├── circle_stroke_bg.xml │ │ │ │ ├── white_with_stroke_bg.xml │ │ │ │ ├── btn_hovered_white_bg.xml │ │ │ │ ├── circle_selected_bg.xml │ │ │ │ ├── drawing_selector.xml │ │ │ │ ├── btn_selector.xml │ │ │ │ ├── ic_radio_unchecked.xml │ │ │ │ ├── ic_paint.xml │ │ │ │ ├── arrow_down.xml │ │ │ │ ├── ic_outline_paint.xml │ │ │ │ ├── empty_board.xml │ │ │ │ ├── ic_radio_checked.xml │ │ │ │ ├── ic_brush.xml │ │ │ │ ├── ic_edit.xml │ │ │ │ ├── ic_delete.xml │ │ │ │ ├── ic_undo.xml │ │ │ │ ├── ic_redo.xml │ │ │ │ ├── ic_undo_disabled.xml │ │ │ │ ├── ic_redo_disabled.xml │ │ │ │ ├── ic_close.xml │ │ │ │ ├── ic_search.xml │ │ │ │ ├── ic_outline_brush.xml │ │ │ │ ├── gallery.xml │ │ │ │ ├── eraser.xml │ │ │ │ ├── number1.xml │ │ │ │ ├── paint.xml │ │ │ │ ├── number4.xml │ │ │ │ ├── brush.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── letterd.xml │ │ │ │ ├── b_bold_inside.xml │ │ │ │ ├── lettera.xml │ │ │ │ ├── letterc.xml │ │ │ │ ├── number2.xml │ │ │ │ ├── letterb.xml │ │ │ │ ├── number3.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── button_bg.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── anim │ │ │ │ ├── slide_in_left.xml │ │ │ │ ├── slide_in_right.xml │ │ │ │ ├── slide_out_left.xml │ │ │ │ └── slide_out_right.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── content_main.xml │ │ │ │ ├── drawing_item.xml │ │ │ │ ├── fragment_choose_drawing.xml │ │ │ │ ├── fragment_home.xml │ │ │ │ ├── fragment_saved_drawings.xml │ │ │ │ └── fragment_drawing.xml │ │ │ ├── xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── navigation │ │ │ │ └── nav_graph.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── mohamedbenrejeb │ │ │ │ └── drawapplication │ │ │ │ ├── utils │ │ │ │ ├── Utils.kt │ │ │ │ └── Constants.kt │ │ │ │ ├── models │ │ │ │ ├── GoToType.kt │ │ │ │ ├── Tool.kt │ │ │ │ ├── DrawingType.kt │ │ │ │ ├── TutorialPoint.kt │ │ │ │ ├── Drawing.kt │ │ │ │ └── SavedDrawing.kt │ │ │ │ ├── adapters │ │ │ │ ├── DrawingAdapter.kt │ │ │ │ └── SavedDrawingAdapter.kt │ │ │ │ ├── ui │ │ │ │ ├── HomeFragment.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── ChooseDrawingFragment.kt │ │ │ │ ├── SavedDrawingsFragment.kt │ │ │ │ └── DrawingFragment.kt │ │ │ │ └── data │ │ │ │ └── DrawingData.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── mohamedbenrejeb │ │ │ └── drawapplication │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── mohamedbenrejeb │ │ └── drawapplication │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── .idea ├── .name ├── .gitignore ├── compiler.xml ├── vcs.xml ├── deploymentTargetDropDown.xml ├── gradle.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── README.md ├── .gitignore ├── settings.gradle ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Draw Application -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 48dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-w1240dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 200dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-w600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 48dp 3 | -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/utils/Utils.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.utils 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/font/aladin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/font/aladin.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/alata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/font/alata.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/baloo_da.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/font/baloo_da.ttf -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/drawable/btn_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/board_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/drawable/board_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/hand_400x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/drawable/hand_400x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Drawing Android App 2 | Native android drawing app using Kotlin and XML 3 | - Canvas 4 | - Save files 5 | - Load files 6 | - Animations 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawing_app_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/drawable/drawing_app_bg.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawing_app_home_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/drawable/drawing_app_home_image.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamedRejeb/drawing-android-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/models/GoToType.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.models 2 | 3 | enum class GoToType { 4 | AnimationTo, JumpTo 5 | } -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/models/Tool.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.models 2 | 3 | enum class Tool { 4 | Brush, Pail, Eraser, Colors 5 | } -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/models/DrawingType.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.models 2 | 3 | enum class DrawingType { 4 | Letter, Number, Animal 5 | } -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/models/TutorialPoint.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.models 2 | 3 | data class TutorialPoint( 4 | val xPercent: Float, 5 | val yPercent: Float, 6 | val goToType: GoToType 7 | ) -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_white_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_grey_400_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/utils/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.utils 2 | 3 | import android.os.Environment 4 | 5 | val drawingsDir = "${Environment.getExternalStorageDirectory()}/${Environment.DIRECTORY_DCIM}/Drawings" -------------------------------------------------------------------------------- /app/src/main/res/values/preloaded_fonts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @font/aladin 5 | @font/baloo_da 6 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jul 19 14:59:37 CET 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/redo_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/undo_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_stroke_white_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_selector_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/models/Drawing.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.models 2 | 3 | data class Drawing( 4 | val id: Int, 5 | val text: String, 6 | val imageResource: Int, 7 | val type: DrawingType, 8 | val tutorialPoints: List = emptyList() 9 | ) 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_default_white_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_selected_white_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_stroke_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/white_with_stroke_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_hovered_white_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_selected_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawing_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/models/SavedDrawing.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.models 2 | 3 | import java.io.File 4 | import java.util.* 5 | 6 | data class SavedDrawing( 7 | val id: String = UUID.randomUUID().toString(), 8 | val file: File, 9 | val isSelected: Boolean = false, 10 | val isSelectionActive: Boolean = false 11 | ) 12 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "Draw Application" 16 | include ':app' 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_radio_unchecked.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_paint.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/mohamedbenrejeb/drawapplication/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/arrow_down.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_paint.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/empty_board.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_radio_checked.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_brush.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_edit.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_undo.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_redo.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_undo_disabled.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_redo_disabled.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_brush.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Draw Application 3 | Settings 4 | 5 | First Fragment 6 | Second Fragment 7 | Next 8 | Previous 9 | 10 | Hello first fragment 11 | Hello second fragment. Arg: %1$s 12 | 13 | Hello blank fragment 14 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mohamedbenrejeb/drawapplication/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.mohamedbenrejeb.drawapplication", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/eraser.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | 9 | #FFf5f5f5 10 | #FFe1e7ec 11 | #FFd7dadd 12 | #FF888888 13 | 14 | #FFe6e5d1 15 | #FF7777BB 16 | 17 | #FF96440c 18 | #FF562500 19 | 20 | #FF000000 21 | #FFFFFFFF 22 | #FFAA0000 23 | #FF00AA00 24 | #FF0000AA 25 | #FFFFAA00 26 | 27 | #FFDC143C 28 | 29 | #00000000 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/number1.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/paint.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/drawing_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 20 | 21 | 33 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 20 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/number4.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/mohamedbenrejeb/drawapplication/adapters/DrawingAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.mohamedbenrejeb.drawapplication.adapters 2 | 3 | import android.util.Log 4 | import android.view.LayoutInflater 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.mohamedbenrejeb.drawapplication.databinding.DrawingItemBinding 8 | import com.mohamedbenrejeb.drawapplication.models.Drawing 9 | 10 | class DrawingAdapter( 11 | private val drawingList: List, 12 | private val navigateToDrawing: (drawing: Drawing) -> Unit 13 | ): RecyclerView.Adapter() { 14 | 15 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DrawingVH { 16 | val layoutInflater = LayoutInflater.from(parent.context) 17 | val binding = DrawingItemBinding.inflate(layoutInflater, parent, false) 18 | return DrawingVH(binding) 19 | } 20 | 21 | override fun onBindViewHolder(holder: DrawingVH, position: Int) { 22 | val drawing = drawingList[position] 23 | holder.bind(drawing) 24 | } 25 | 26 | override fun getItemCount(): Int { 27 | return drawingList.size 28 | } 29 | 30 | inner class DrawingVH( 31 | private val binding: DrawingItemBinding 32 | ): RecyclerView.ViewHolder(binding.root) { 33 | fun bind(drawing: Drawing) { 34 | binding.cardView.setOnClickListener { 35 | navigateToDrawing(drawing) 36 | } 37 | binding.drawingIv.setImageResource(drawing.imageResource) 38 | } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/brush.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 31 | 32 |