Skip to content

Commit

Permalink
targetSDK 27
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-manshu committed Jul 4, 2018
1 parent 7aafa61 commit 53243d1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
15 changes: 11 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
compileSdkVersion 27
defaultConfig {
applicationId "com.mindorks.editdrawabletextsample"
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,15 +20,22 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '27.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.github.MindorksOpenSource:EditDrawableText:0.1.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':editdrawabletext')
}
Binary file added app/src/main/assets/EditDrawableText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions editdrawabletext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28



compileSdkVersion 27
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 27
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

buildToolsVersion '27.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.mindorks.editdrawabletext

enum class DrawablePosition {
TOP,
BOTTOM,
LEFT,
RIGHT
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,7 @@ class EditDrawableText : EditText {
if (event.action == MotionEvent.ACTION_DOWN) {
positionX = event.x.toInt()
positionY = event.y.toInt()
if (drawableBottom != null && drawableBottom!!.bounds.contains(positionX, positionY)) {
onDrawableClickListener!!.onClick(DrawablePosition.BOTTOM)
return super.onTouchEvent(event)
}

if (drawableTop != null && drawableTop!!.bounds.contains(positionX, positionY)) {
onDrawableClickListener!!.onClick(DrawablePosition.TOP)
return super.onTouchEvent(event)
}


// this works for left since container shares 0,0 origin with bounds
if (drawableLeft != null) {
Expand Down

0 comments on commit 53243d1

Please sign in to comment.