Skip to content

Commit

Permalink
Bump versions, expose softInputMode and inputMethodMode (#14)
Browse files Browse the repository at this point in the history
* Fix bug, expose softInputType, bump version

* bump gradle  version

* fix travis
  • Loading branch information
natario1 authored Apr 18, 2018
1 parent 2dde071 commit 5a08de3
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ android:
components:
- tools
- platform-tools
- build-tools-26.0.1
- android-26
- doc-26
- build-tools-27.0.3
- android-27
- doc-27

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Simple yet powerful autocomplete behavior for `EditText`s, to avoid working with
`MultiAutoCompleteTextView` APIs.

```groovy
compile 'com.otaliastudios:autocomplete:1.0.2'
implementation 'com.otaliastudios:autocomplete:1.0.3'
```

To see it in action, take a look at the sample app in the `sample` module.
Expand Down
9 changes: 5 additions & 4 deletions autocomplete/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

// Required by bintray
version = '1.0.2'
version = '1.0.3'
group = 'com.otaliastudios'

android {
Expand All @@ -28,11 +28,12 @@ android {
}

dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
api "com.android.support:recyclerview-v7:$supportLibVersion"

testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:recyclerview-v7:$supportLibVersion"
testCompile 'junit:junit:4.12'
}

install {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.otaliastudios.autocomplete;

import android.database.DataSetObserver;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
Expand All @@ -13,6 +15,8 @@
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.PopupWindow;

Expand Down Expand Up @@ -212,6 +216,27 @@ public void click(T item) {
builder.clear();
}

/**
* Controls how the popup operates with an input method.
*
* If the popup is showing, calling this method will take effect only
* the next time the popup is shown.
*
* @param mode a {@link PopupWindow} input method mode
*/
public void setInputMethodMode(int mode) {
popup.setInputMethodMode(mode);
}

/**
* Sets the operating mode for the soft input area.
*
* @param mode The desired mode, see {@link WindowManager.LayoutParams#softInputMode}
*/
public void setSoftInputMode(int mode) {
popup.setSoftInputMode(mode);
}

/**
* Shows the popup with the given query.
* There is rarely need to call this externally: it is already triggered by events on the anchor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ void show() {

// Update.
mPopup.setOutsideTouchable(isOutsideTouchable());
mPopup.update(getAnchorView(), mHorizontalOffset, mVerticalOffset, widthSpec, heightSpec);
if (heightSpec == 0) {
dismiss();
} else {
mPopup.update(getAnchorView(), mHorizontalOffset, mVerticalOffset, widthSpec, heightSpec);
}

} else {
int widthSpec;
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.1'
// https://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
// https://www.theguardian.com/technology/developer-blog/2016/dec/06/how-to-publish-an-android-library-a-mysterious-conversation
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
Expand All @@ -25,11 +25,11 @@ allprojects {
}

ext {
compileSdkVersion = 26
buildToolsVersion = "26.0.1"
supportLibVersion = '26.0.2'
compileSdkVersion = 27
buildToolsVersion = "27.0.3"
supportLibVersion = '27.1.1'
minSdkVersion = 14
targetSdkVersion = 26
targetSdkVersion = 27
}

task clean(type: Delete) {
Expand Down
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-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 comments on commit 5a08de3

Please sign in to comment.