diff --git a/.gitignore b/.gitignore index 3c117df..d12915e 100644 --- a/.gitignore +++ b/.gitignore @@ -62,4 +62,9 @@ fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output -fastlane/readme.md \ No newline at end of file +fastlane/readme.md + + +# general +**/.settings/ +**/.classpath diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d45040 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +

+

Flexing :muscle: for Android

+

+ by Brad Martin +

+

+ +

+ + license + + + JitPack + + + Twitter + + + donate + +

+ +## Install + +### Gradle: + +- Add it in your root build.gradle at the end of repositories: + +```groovy +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} +``` + +- Add the dependency: + +```groovy +dependencies { + implementation 'com.github.bradmartin:flexing:0.1.30' +} +``` + +### Maven + +- Add the JitPack repository to your build file: + +```xml + + + jitpack.io + https://jitpack.io + + +``` + +- Add the dependency: + +```xml + + com.github.bradmartin + flexing + 0.1.30 + +``` + +### API + +### ImagesKt Static Methods + +| Method | Description | +| -------------------------------------------------- | ---------------------------------- | +| _getBitmapFromImageView(ImageView: image)_: Bitmap | Returns a Bitmap from an ImageView | diff --git a/flexing/src/main/java/net/bradmartin/flexing/keyboard.kt b/flexing/src/main/java/net/bradmartin/flexing/keyboard.kt new file mode 100644 index 0000000..1d1669b --- /dev/null +++ b/flexing/src/main/java/net/bradmartin/flexing/keyboard.kt @@ -0,0 +1,11 @@ +package net.bradmartin.flexing + +import android.app.Activity +import android.view.inputmethod.InputMethodManager + +fun hideSoftKeyboard(activity: Activity) { + if (activity.currentFocus != null) { + val inputMethodManager = activity.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager + inputMethodManager.hideSoftInputFromWindow(activity.currentFocus.windowToken, 0) + } +} \ No newline at end of file