Skip to content

Commit

Permalink
lower compile sdk, use kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
bradmartin committed Aug 21, 2018
1 parent 0b45c81 commit 0965904
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions flexing/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
compileSdkVersion 27



defaultConfig {
minSdkVersion 17
targetSdkVersion 28
targetSdkVersion 27
versionCode 1
versionName "1.0"

Expand All @@ -27,7 +27,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
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
17 changes: 0 additions & 17 deletions flexing/src/main/java/net/bradmartin/flexing/Images.java

This file was deleted.

17 changes: 17 additions & 0 deletions flexing/src/main/java/net/bradmartin/flexing/Images.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package net.bradmartin.flexing

import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.widget.ImageView

class Images {
fun getBitmapFromImageView(value: ImageView): Bitmap {
// if not instance of imageview throw an exception
if (value !is ImageView) {
throw IllegalArgumentException("Value passed to getBitmapFromImageView is not of type ImageView")
}

val drawable = value.drawable as BitmapDrawable
return drawable.bitmap
}
}

0 comments on commit 0965904

Please sign in to comment.