Skip to content

Commit

Permalink
updated gradle and android libs
Browse files Browse the repository at this point in the history
  • Loading branch information
AP\RavinduW committed Jun 4, 2018
1 parent cca4ae4 commit 0bb004e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
5 changes: 1 addition & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "com.rw.keyboardutils"
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -25,8 +25,8 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support.constraint:constraint-layout:1.1.0'
testCompile 'junit:junit:4.12'
compile project(':keyboard-listener')
}
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -20,4 +21,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
8 changes: 4 additions & 4 deletions keyboard-listener/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
compileSdkVersion 27
buildToolsVersion "27.0.0"

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"

Expand All @@ -26,6 +26,6 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
//compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
testCompile 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class KeyboardUtils implements ViewTreeObserver.OnGlobalLayoutListener
private SoftKeyboardToggleListener mCallback;
private View mRootView;
private Boolean prevValue = null;
private float mScreenDensity = 1;
private float mScreenDensity;
private static HashMap<SoftKeyboardToggleListener, KeyboardUtils> sListenerMap = new HashMap<>();

public interface SoftKeyboardToggleListener
Expand Down Expand Up @@ -92,7 +92,8 @@ public static void removeAllKeyboardToggleListeners()
public static void toggleKeyboardVisibility(Context context)
{
InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
if(inputMethodManager != null)
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}

/**
Expand All @@ -102,7 +103,8 @@ public static void toggleKeyboardVisibility(Context context)
public static void forceCloseKeyboard(View activeView)
{
InputMethodManager inputMethodManager = (InputMethodManager) activeView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(activeView.getWindowToken(), 0);
if(inputMethodManager != null)
inputMethodManager.hideSoftInputFromWindow(activeView.getWindowToken(), 0);
}

private void removeListener()
Expand Down

0 comments on commit 0bb004e

Please sign in to comment.