File tree Expand file tree Collapse file tree 5 files changed +23
-25
lines changed
src/main/java/com/mindorks/editdrawabletext Expand file tree Collapse file tree 5 files changed +23
-25
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ apply plugin: 'kotlin-android'
55apply plugin : ' kotlin-android-extensions'
66
77android {
8- compileSdkVersion 28
8+ compileSdkVersion 27
99 defaultConfig {
1010 applicationId " com.mindorks.editdrawabletextsample"
1111 minSdkVersion 21
12- targetSdkVersion 28
12+ targetSdkVersion 27
1313 versionCode 1
1414 versionName " 1.0"
1515 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
@@ -20,15 +20,22 @@ android {
2020 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
2121 }
2222 }
23+ buildToolsVersion ' 27.0.3'
24+ compileOptions {
25+ sourceCompatibility JavaVersion . VERSION_1_8
26+ targetCompatibility JavaVersion . VERSION_1_8
27+ }
28+ productFlavors {
29+ }
2330}
2431
2532dependencies {
2633 implementation fileTree(include : [' *.jar' ], dir : ' libs' )
2734 implementation " org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version "
28- implementation ' com.android.support:appcompat-v7:28.0.0-alpha3 '
35+ implementation ' com.android.support:appcompat-v7:27.1.1 '
2936 implementation ' com.android.support.constraint:constraint-layout:1.1.2'
3037 testImplementation ' junit:junit:4.12'
3138 androidTestImplementation ' com.android.support.test:runner:1.0.2'
32- implementation ' com.github.MindorksOpenSource:EditDrawableText:0.1.0'
3339 androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
40+ implementation project(' :editdrawabletext' )
3441}
Original file line number Diff line number Diff line change @@ -2,33 +2,34 @@ apply plugin: 'com.android.library'
22apply plugin : ' kotlin-android'
33
44android {
5- compileSdkVersion 28
6-
7-
8-
5+ compileSdkVersion 27
96 defaultConfig {
107 minSdkVersion 21
11- targetSdkVersion 28
8+ targetSdkVersion 27
129 versionCode 1
1310 versionName " 1.0"
1411
1512 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
1613
1714 }
18-
1915 buildTypes {
2016 release {
2117 minifyEnabled false
2218 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
2319 }
2420 }
25-
21+ buildToolsVersion ' 27.0.3'
22+ compileOptions {
23+ sourceCompatibility JavaVersion . VERSION_1_8
24+ targetCompatibility JavaVersion . VERSION_1_8
25+ }
26+ productFlavors {
27+ }
2628}
2729
2830dependencies {
29- implementation fileTree(dir : ' libs' , include : [' *.jar' ])
30-
31- implementation ' com.android.support:appcompat-v7:28.0.0-alpha3'
31+ implementation fileTree(include : [' *.jar' ], dir : ' libs' )
32+ implementation ' com.android.support:appcompat-v7:27.1.1'
3233 testImplementation ' junit:junit:4.12'
3334 androidTestImplementation ' com.android.support.test:runner:1.0.2'
3435 androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
Original file line number Diff line number Diff line change 11package com.mindorks.editdrawabletext
22
33enum class DrawablePosition {
4- TOP ,
5- BOTTOM ,
64 LEFT ,
75 RIGHT
86}
Original file line number Diff line number Diff line change @@ -38,15 +38,7 @@ class EditDrawableText : EditText {
3838 if (event.action == MotionEvent .ACTION_DOWN ) {
3939 positionX = event.x.toInt()
4040 positionY = event.y.toInt()
41- if (drawableBottom != null && drawableBottom!! .bounds.contains(positionX, positionY)) {
42- onDrawableClickListener!! .onClick(DrawablePosition .BOTTOM )
43- return super .onTouchEvent(event)
44- }
45-
46- if (drawableTop != null && drawableTop!! .bounds.contains(positionX, positionY)) {
47- onDrawableClickListener!! .onClick(DrawablePosition .TOP )
48- return super .onTouchEvent(event)
49- }
41+
5042
5143 // this works for left since container shares 0,0 origin with bounds
5244 if (drawableLeft != null ) {
You can’t perform that action at this time.
0 commit comments