├── .gitignore
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── jakubaniola
│ │ └── paintablevectorviewapp
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── jakubaniola
│ │ │ └── paintablevectorviewapp
│ │ │ ├── InitializedInCodeActivity.kt
│ │ │ ├── InitializedInXmlActivity.kt
│ │ │ └── MainActivity.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── ic_car.xml
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_initialized_in_code.xml
│ │ ├── activity_initialized_in_xml.xml
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── jakubaniola
│ └── paintablevectorviewapp
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── paintablevectorview
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── jakubaniola
│ │ └── paintablevectorview
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── jakubaniola
│ │ │ └── paintablevectorview
│ │ │ ├── LayeredVectorShape.kt
│ │ │ ├── PaintType.kt
│ │ │ └── PaintableVectorView.kt
│ └── res
│ │ └── values
│ │ ├── attrs.xml
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── jakubaniola
│ └── paintablevectorview
│ └── ExampleUnitTest.kt
└── settings.gradle
/.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 | gradlew.bat
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PaintableVectorView
2 | [](https://jitpack.io/#bardss/PaintableVectorView)
3 |
4 | PaintableVectorView enables to change color of paths/groups in Vector Drawable (SVG)
5 |
6 | ## Demo
7 |
8 | 
9 |
10 |
11 | ## Dependency
12 |
13 | Add the following lines in your root build.gradle at the end of repositories:
14 | ```
15 | allprojects {
16 | repositories {
17 | ...
18 | maven { url 'https://jitpack.io' }
19 | }
20 | }
21 | ```
22 |
23 | Add the dependency
24 | ```
25 | dependencies {
26 | implementation 'com.github.bardss:PaintableVectorView:1.0.4'
27 | }
28 | ```
29 |
30 | ## Usage
31 |
32 | Create PaintableVectorView and add to the layout:
33 | ```kotlin
34 | val paintableView = PaintableVectorView(
35 | context = this,
36 | drawableId = R.drawable.ic_car,
37 | paintType = PaintType.PAINT_PATH,
38 | paintColor = resources.getColor(R.color.blue)
39 | )
40 | layout.addView(paintableView)
41 | ```
42 |
43 | Or add in xml and set attributes:
44 | ```xml
45 |
53 | ```
54 |
55 | Set other paint type:
56 | ```kotlin
57 | paintableView.paintType = PaintType.PAINT_GROUP
58 | ```
59 |
60 | ```xml
61 | app:paintType="GROUP"
62 | ```
63 | ```xml
64 | app:paintType="PATH"
65 | ```
66 |
67 | Set other paint color:
68 | ```kotlin
69 | paintableView.paintColor = resources.getColor(R.color.blue)
70 | ```
71 |
72 | ```xml
73 | app:paintColor="@color/blue"
74 | ```
75 |
76 |
77 | Reset layers color in PaintableVectorView:
78 | ```kotlin
79 | paintableView.resetColors()
80 | ```
81 |
82 | ## License
83 |
84 | ```
85 | Copyright 2019 Jakub Aniola
86 |
87 | Licensed under the Apache License, Version 2.0 (the "License");
88 | you may not use this file except in compliance with the License.
89 | You may obtain a copy of the License at
90 |
91 | http://www.apache.org/licenses/LICENSE-2.0
92 |
93 | Unless required by applicable law or agreed to in writing, software
94 | distributed under the License is distributed on an "AS IS" BASIS,
95 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96 | See the License for the specific language governing permissions and
97 | limitations under the License.
98 | ```
99 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 32
7 | defaultConfig {
8 | applicationId "com.jakubaniola.vectorpainterexample"
9 | minSdkVersion 21
10 | targetSdkVersion 32
11 | versionCode 1
12 | versionName "1.0.1"
13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
26 | implementation 'androidx.appcompat:appcompat:1.5.0'
27 | implementation 'androidx.core:core-ktx:1.8.0'
28 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
29 | testImplementation 'junit:junit:4.13.2'
30 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
31 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
32 | implementation project(':paintablevectorview')
33 | }
34 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/jakubaniola/paintablevectorviewapp/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorviewapp
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.jakubaniola.vectorpainterexample", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/jakubaniola/paintablevectorviewapp/InitializedInCodeActivity.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorviewapp
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 | import com.jakubaniola.paintablevectorview.PaintType
6 | import com.jakubaniola.paintablevectorview.PaintableVectorView
7 | import kotlinx.android.synthetic.main.activity_initialized_in_code.*
8 | import kotlinx.android.synthetic.main.activity_main.*
9 |
10 | class InitializedInCodeActivity : AppCompatActivity() {
11 |
12 | private lateinit var paintableView: PaintableVectorView
13 |
14 | override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | setContentView(R.layout.activity_initialized_in_code)
17 | }
18 |
19 | override fun onStart() {
20 | super.onStart()
21 | paintableView = PaintableVectorView(
22 | this,
23 | R.drawable.ic_car,
24 | PaintType.PAINT_GROUP,
25 | resources.getColor(R.color.blue)
26 | )
27 | setupPaintableView()
28 | setupResetButton()
29 | setupPaintTypeButtons()
30 | setupPaintColorButtons()
31 | }
32 |
33 | private fun setupResetButton() {
34 | resetColorsButton.setOnClickListener {
35 | paintableView.resetColors()
36 | }
37 | }
38 |
39 | private fun setupPaintTypeButtons() {
40 | drawPathButton.setOnClickListener {
41 | paintableView.paintType = PaintType.PAINT_PATH
42 | }
43 | drawGroupButton.setOnClickListener {
44 | paintableView.paintType = PaintType.PAINT_GROUP
45 | }
46 | }
47 |
48 | private fun setupPaintColorButtons() {
49 | paintBlueButton.setOnClickListener {
50 | paintableView.paintColor = resources.getColor(R.color.blue)
51 | }
52 | paintRedButton.setOnClickListener {
53 | paintableView.paintColor = resources.getColor(R.color.red)
54 | }
55 | paintGreenButton.setOnClickListener {
56 | paintableView.paintColor = resources.getColor(R.color.green)
57 | }
58 | paintYellowButton.setOnClickListener {
59 | paintableView.paintColor = resources.getColor(R.color.yellow)
60 | }
61 | }
62 |
63 | private fun setupPaintableView() {
64 | paintableBoxLayout.addView(paintableView)
65 | }
66 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/jakubaniola/paintablevectorviewapp/InitializedInXmlActivity.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorviewapp
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 | import com.jakubaniola.paintablevectorview.PaintType
6 | import com.jakubaniola.paintablevectorview.PaintableVectorView
7 | import kotlinx.android.synthetic.main.activity_initialized_in_xml.*
8 | import kotlinx.android.synthetic.main.activity_main.*
9 |
10 | class InitializedInXmlActivity : AppCompatActivity() {
11 |
12 | override fun onCreate(savedInstanceState: Bundle?) {
13 | super.onCreate(savedInstanceState)
14 | setContentView(R.layout.activity_initialized_in_xml)
15 | }
16 |
17 | override fun onStart() {
18 | super.onStart()
19 | setupResetButton()
20 | setupPaintTypeButtons()
21 | setupPaintColorButtons()
22 | }
23 |
24 | private fun setupResetButton() {
25 | resetColorsButton.setOnClickListener {
26 | paintableView.resetColors()
27 | }
28 | }
29 |
30 | private fun setupPaintTypeButtons() {
31 | drawPathButton.setOnClickListener {
32 | paintableView.paintType = PaintType.PAINT_PATH
33 | }
34 | drawGroupButton.setOnClickListener {
35 | paintableView.paintType = PaintType.PAINT_GROUP
36 | }
37 | }
38 |
39 | private fun setupPaintColorButtons() {
40 | paintBlueButton.setOnClickListener {
41 | paintableView.paintColor = resources.getColor(R.color.blue)
42 | }
43 | paintRedButton.setOnClickListener {
44 | paintableView.paintColor = resources.getColor(R.color.red)
45 | }
46 | paintGreenButton.setOnClickListener {
47 | paintableView.paintColor = resources.getColor(R.color.green)
48 | }
49 | paintYellowButton.setOnClickListener {
50 | paintableView.paintColor = resources.getColor(R.color.yellow)
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/jakubaniola/paintablevectorviewapp/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorviewapp
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import kotlinx.android.synthetic.main.activity_main.*
7 |
8 | class MainActivity : AppCompatActivity() {
9 |
10 | override fun onCreate(savedInstanceState: Bundle?) {
11 | super.onCreate(savedInstanceState)
12 | setContentView(R.layout.activity_main)
13 | }
14 |
15 | override fun onStart() {
16 | super.onStart()
17 | codeButton.setOnClickListener {
18 | startActivity(
19 | Intent(this, InitializedInCodeActivity::class.java)
20 | )
21 | }
22 | xmlButton.setOnClickListener {
23 | startActivity(
24 | Intent(this, InitializedInXmlActivity::class.java)
25 | )
26 | }
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_car.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
19 |
22 |
23 |
26 |
29 |
32 |
35 |
38 |
41 |
44 |
47 |
48 |
51 |
54 |
55 |
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_initialized_in_code.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
29 |
30 |
40 |
41 |
49 |
50 |
58 |
59 |
69 |
70 |
79 |
80 |
89 |
90 |
99 |
100 |
109 |
110 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_initialized_in_xml.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
32 |
33 |
43 |
44 |
52 |
53 |
61 |
62 |
72 |
73 |
82 |
83 |
92 |
93 |
102 |
103 |
112 |
113 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
29 |
30 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 | #3399ff
7 | #990000
8 | #33cc33
9 | #ffcc00
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | VectorPainterExample
3 | Click on the image!
4 | PATH
5 | GROUP
6 | blue
7 | red
8 | green
9 | yellow
10 | Choose paint type:
11 | RESET COLORS
12 | Choose init type
13 | CODE
14 | XML
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/jakubaniola/paintablevectorviewapp/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorviewapp
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 | }
18 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.7.10'
5 | repositories {
6 | google()
7 | mavenCentral()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.2.2'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | maven { url 'https://jitpack.io' }
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | android.useAndroidX=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Dec 28 22:42:04 CET 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/paintablevectorview/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/paintablevectorview/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | apply plugin: 'maven-publish'
5 |
6 | android {
7 | compileSdkVersion 32
8 |
9 | defaultConfig {
10 | minSdkVersion 21
11 | targetSdkVersion 32
12 |
13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14 | consumerProguardFiles 'consumer-rules.pro'
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 |
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
29 | implementation 'androidx.appcompat:appcompat:1.5.0'
30 | implementation 'androidx.core:core-ktx:1.8.0'
31 | testImplementation 'junit:junit:4.13.2'
32 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
33 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
34 | }
35 |
36 | project.afterEvaluate {
37 | publishing {
38 | publications {
39 | release(MavenPublication) {
40 | from components.release
41 | }
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/paintablevectorview/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bardss/PaintableVectorView/5a3dff6a69eb03e4c2f2e11ffc5a59c11a618a67/paintablevectorview/consumer-rules.pro
--------------------------------------------------------------------------------
/paintablevectorview/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/paintablevectorview/src/androidTest/java/com/jakubaniola/paintablevectorview/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorview
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.jakubaniola.vectorpainter.test", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/paintablevectorview/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/paintablevectorview/src/main/java/com/jakubaniola/paintablevectorview/LayeredVectorShape.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorview
2 |
3 | import android.content.Context
4 | import android.content.res.TypedArray
5 | import android.graphics.*
6 | import android.graphics.drawable.shapes.Shape
7 | import android.util.AttributeSet
8 | import android.util.Log
9 | import android.util.Xml
10 | import androidx.core.graphics.PathParser
11 | import org.xmlpull.v1.XmlPullParser
12 | import org.xmlpull.v1.XmlPullParserException
13 | import java.io.IOException
14 | import java.util.*
15 |
16 | private const val TAG_VECTOR = "vector"
17 | private const val TAG_PATH = "path"
18 | private const val TAG_GROUP = "group"
19 |
20 | private const val attrName = android.R.attr.name
21 | private const val attrColor = android.R.attr.fillColor
22 | private const val attrPathData = android.R.attr.pathData
23 | private const val attrWidth = android.R.attr.viewportWidth
24 | private const val attrHeight = android.R.attr.viewportHeight
25 |
26 | private const val defaultViewportValue = 0f
27 | private const val defaultColorValue = -0x21523f22
28 |
29 | class LayeredVectorShape(
30 | context: Context,
31 | id: Int
32 | ) : Shape() {
33 | private val viewportRect = RectF()
34 | private val layers = ArrayList()
35 |
36 | init {
37 | parseVectorDrawableXml(context, id)
38 | }
39 |
40 | private fun parseVectorDrawableXml(context: Context, id: Int) {
41 | val parser = context.resources.getXml(id)
42 | val attributeSet = Xml.asAttributeSet(parser)
43 | try {
44 | var parserEventType = parser.eventType
45 | var group: String? = null
46 | while (parserEventType != XmlPullParser.END_DOCUMENT) {
47 | when (parserEventType) {
48 | XmlPullParser.START_TAG ->
49 | when (parser.name) {
50 | TAG_GROUP -> group = handleGroupTag(context, attributeSet)
51 | TAG_VECTOR -> {
52 | val vector = handleVectorTag(context, attributeSet)
53 | vector.recycle()
54 | }
55 | TAG_PATH -> {
56 | val path = handlePathTag(context, attributeSet, group)
57 | path.recycle()
58 | }
59 | }
60 | XmlPullParser.END_TAG ->
61 | when (parser.name) {
62 | TAG_GROUP -> group = null
63 | }
64 | }
65 | parserEventType = parser.next()
66 | }
67 | } catch (e: XmlPullParserException) {
68 | handleException(e)
69 | } catch (e: IOException) {
70 | handleException(e)
71 | }
72 | }
73 |
74 | private fun handleGroupTag(
75 | context: Context,
76 | attributeSet: AttributeSet?
77 | ): String? {
78 | val attrs = intArrayOf(attrName)
79 | val positionOfNameAttr = attrs.indexOf(attrName)
80 | val obtainedAttributeSet = context.obtainStyledAttributes(attributeSet, attrs)
81 | return obtainedAttributeSet.getString(positionOfNameAttr)
82 | }
83 |
84 | private fun handleVectorTag(
85 | context: Context,
86 | attributeSet: AttributeSet?
87 | ): TypedArray {
88 | val attrs = intArrayOf(attrWidth, attrHeight)
89 | val positionOfWidthAttr = attrs.indexOf(attrWidth)
90 | val positionOfHeightAttr = attrs.indexOf(attrHeight)
91 | val obtainedAttributeSet = context.obtainStyledAttributes(attributeSet, attrs)
92 | val viewportRight = obtainedAttributeSet.getFloat(positionOfWidthAttr, defaultViewportValue)
93 | val viewportBottom =
94 | obtainedAttributeSet.getFloat(positionOfHeightAttr, defaultViewportValue)
95 | viewportRect.set(0f, 0f, viewportRight, viewportBottom)
96 | return obtainedAttributeSet
97 | }
98 |
99 | private fun handlePathTag(
100 | context: Context,
101 | attributeSet: AttributeSet?,
102 | group: String?
103 | ): TypedArray {
104 | val attrs = intArrayOf(attrName, attrColor, attrPathData)
105 | val positionOfNameAttr = attrs.indexOf(attrName)
106 | val positionOfColorAttr = attrs.indexOf(attrColor)
107 | val positionOfPathDataAttr = attrs.indexOf(attrPathData)
108 | val obtainedAttributeSet = context.obtainStyledAttributes(attributeSet, attrs)
109 | val pathName = obtainedAttributeSet.getString(positionOfNameAttr) ?: "noNamePath"
110 | val pathFillColor = obtainedAttributeSet.getColor(positionOfColorAttr, defaultColorValue)
111 | val pathData = obtainedAttributeSet.getString(positionOfPathDataAttr)
112 | if (pathData != null) {
113 | val layer = Layer(pathData, pathFillColor, pathName, group)
114 | layers.add(layer)
115 | }
116 | return obtainedAttributeSet
117 | }
118 |
119 | private fun handleException(e: Exception) {
120 | Log.e("LayeredVectorShape", "LayeredVectorShape constructor error")
121 | e.printStackTrace()
122 | }
123 |
124 | fun getLayersAt(x: Int, y: Int): Layer {
125 | return layers.last {
126 | it.region.contains(x, y)
127 | }
128 | }
129 |
130 | fun getGroupLayersAt(x: Int, y: Int): List {
131 | val topLayerGroup = layers.last {
132 | it.region.contains(x, y)
133 | }.group
134 | return layers.filter {
135 | it.group == topLayerGroup && it.group != null
136 | }
137 | }
138 |
139 | fun resetColors() {
140 | layers.forEach {
141 | it.paint.color = it.baseColor
142 | }
143 | }
144 |
145 | override fun onResize(width: Float, height: Float) {
146 | val matrix = Matrix()
147 | val shapeRegion = Region(0, 0, width.toInt(), height.toInt())
148 | matrix.setRectToRect(viewportRect, RectF(0f, 0f, width, height), Matrix.ScaleToFit.FILL)
149 | for (layer in layers) {
150 | layer.transform(matrix, shapeRegion)
151 | }
152 | }
153 |
154 | override fun draw(canvas: Canvas, paint: Paint) {
155 | for (layer in layers) {
156 | canvas.drawPath(layer.transformedPath, layer.paint)
157 | }
158 | }
159 |
160 | class Layer(
161 | data: String,
162 | val baseColor: Int,
163 | var name: String,
164 | var group: String?
165 | ) {
166 | private var originalPath: Path = PathParser.createPathFromPathData(data)
167 | var transformedPath = Path()
168 | var paint = Paint(Paint.ANTI_ALIAS_FLAG)
169 | var region = Region()
170 |
171 |
172 | init {
173 | paint.color = baseColor
174 | }
175 |
176 | fun transform(matrix: Matrix, clip: Region) {
177 | originalPath.transform(matrix, transformedPath)
178 | region.setPath(transformedPath, clip)
179 | }
180 |
181 | override fun toString(): String {
182 | return name
183 | }
184 | }
185 | }
--------------------------------------------------------------------------------
/paintablevectorview/src/main/java/com/jakubaniola/paintablevectorview/PaintType.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorview
2 |
3 | enum class PaintType {
4 | PAINT_PATH,
5 | PAINT_GROUP
6 | }
7 |
--------------------------------------------------------------------------------
/paintablevectorview/src/main/java/com/jakubaniola/paintablevectorview/PaintableVectorView.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorview
2 |
3 | import android.content.Context
4 | import android.graphics.drawable.ShapeDrawable
5 | import android.util.AttributeSet
6 | import android.view.MotionEvent
7 | import androidx.appcompat.widget.AppCompatImageView
8 | import androidx.core.content.res.use
9 |
10 | class PaintableVectorView : AppCompatImageView {
11 |
12 | constructor(
13 | context: Context,
14 | drawableId: Int,
15 | paintType: PaintType = PaintType.PAINT_PATH,
16 | paintColor: Int
17 | ) : super(context) {
18 | this.drawableId = drawableId
19 | this.paintType = paintType
20 | this.paintColor = paintColor
21 | initBackground()
22 | }
23 |
24 | constructor(
25 | context: Context, attrs: AttributeSet
26 | ) : super(context, attrs) {
27 | initArgs(context, attrs)
28 | initBackground()
29 | }
30 |
31 | constructor(
32 | context: Context, attrs: AttributeSet, defStyle: Int = 0
33 | ) : super(context, attrs, defStyle) {
34 | initArgs(context, attrs)
35 | initBackground()
36 | }
37 |
38 | private var drawableId: Int = INVALID_RESOURCE
39 | var paintColor: Int = INVALID_RESOURCE
40 | var paintType: PaintType = PaintType.PAINT_PATH
41 | private lateinit var vectorShape: LayeredVectorShape
42 |
43 | private fun initArgs(context: Context, attrsSet: AttributeSet) {
44 | val attrs = context.obtainStyledAttributes(attrsSet, R.styleable.PaintableVectorView)
45 | attrs.use {
46 | drawableId =
47 | attrs.getResourceId(R.styleable.PaintableVectorView_drawable, INVALID_RESOURCE)
48 | paintColor =
49 | attrs.getResourceId(R.styleable.PaintableVectorView_paintColor, INVALID_RESOURCE)
50 | val paintTypeInt =
51 | attrs.getInt(R.styleable.PaintableVectorView_paintType, INVALID_RESOURCE)
52 | paintType = PaintType.values()[paintTypeInt]
53 | }
54 | }
55 |
56 | private fun initBackground() {
57 | checkIfArgumentsAreValid()
58 | vectorShape = LayeredVectorShape(context, drawableId)
59 | background = ShapeDrawable(vectorShape)
60 | }
61 |
62 | private fun checkIfArgumentsAreValid() {
63 | if (drawableId == INVALID_RESOURCE) {
64 | throw IllegalArgumentException("Missing obligatory drawableId")
65 | } else if (paintColor == INVALID_RESOURCE) {
66 | throw IllegalArgumentException("Missing obligatory paintColor")
67 | }
68 | }
69 |
70 | override fun onTouchEvent(event: MotionEvent): Boolean {
71 | when (paintType) {
72 | PaintType.PAINT_PATH -> onPathPaint(event)
73 | PaintType.PAINT_GROUP -> onGroupPaint(event)
74 | }
75 | return false
76 | }
77 |
78 | private fun onGroupPaint(event: MotionEvent) {
79 | val clickedLayers = vectorShape.getGroupLayersAt(event.x.toInt(), event.y.toInt())
80 | if (clickedLayers.isEmpty()) {
81 | onPathPaint(event)
82 | } else {
83 | paintLayers(clickedLayers)
84 | }
85 | }
86 |
87 | private fun onPathPaint(event: MotionEvent) {
88 | val clickedLayer = vectorShape.getLayersAt(event.x.toInt(), event.y.toInt())
89 | paintLayer(clickedLayer)
90 | }
91 |
92 | private fun paintLayers(clickedLayers: List) {
93 | clickedLayers.forEach {
94 | paintLayer(it)
95 | }
96 | }
97 |
98 | private fun paintLayer(it: LayeredVectorShape.Layer) {
99 | it.paint.color = paintColor
100 | invalidate()
101 | }
102 |
103 | fun resetColors() {
104 | vectorShape.resetColors()
105 | invalidate()
106 | }
107 |
108 | companion object {
109 | private const val INVALID_RESOURCE = -1
110 | }
111 | }
--------------------------------------------------------------------------------
/paintablevectorview/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/paintablevectorview/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | PaintableVectorView
3 |
4 |
--------------------------------------------------------------------------------
/paintablevectorview/src/test/java/com/jakubaniola/paintablevectorview/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.jakubaniola.paintablevectorview
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 | }
18 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':paintablevectorview'
2 | rootProject.name='VectorPainterExample'
3 |
--------------------------------------------------------------------------------