Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autocomplete/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ group = 'com.otaliastudios'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ public void click(T item) {
if (dismiss) dismissPopup();
block = saved;
}

@Override
public void removePopUp() {
boolean saved = block;
block = true;
dismissPopup();
block = saved;
}
});

builder.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ private int buildDropDown() {
// Add padding only if the list has items in it, that way we don't show
// the popup if it is not needed. For this reason, we measure as wrap_content.
mView.measure(childWidthSpec, View.MeasureSpec.makeMeasureSpec(maxContentHeight, View.MeasureSpec.AT_MOST));
if(mView==null) return 0;
final int viewHeight = mView.getMeasuredHeight();
if (viewHeight > 0) {
otherHeights += paddingVert + mView.getPaddingTop() + mView.getPaddingBottom();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ final void hideView() {

public interface ClickProvider<T> {
void click(T item);
void removePopUp();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ protected final void dispatchClick(T item) {
if (clicks != null) clicks.click(item);
}

protected final void dispatchRemovePopUp(){
if(clicks!=null) clicks.removePopUp();
}

/**
* Request that the popup should recompute its dimensions based on a recent change in
* the view being displayed.
Expand Down
8 changes: 4 additions & 4 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:3.1.1'
classpath 'com.android.tools.build:gradle:3.2.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 = 27
compileSdkVersion = 28
buildToolsVersion = "27.0.3"
supportLibVersion = '27.1.1'
supportLibVersion = '28.0.0'
minSdkVersion = 14
targetSdkVersion = 27
targetSdkVersion = 28
}

task clean(type: Delete) {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Apr 20 17:28:27 CEST 2017
#Mon Jan 07 17:28:59 PKT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.otaliastudios.sample"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ private boolean isEmpty() {
@Override
public void onBindViewHolder(Holder holder, int position) {
if (isEmpty()) {
holder.fullname.setText("No user here!");
holder.username.setText("Sorry!");
holder.root.setOnClickListener(null);
// holder.fullname.setText("No user here!");
// holder.username.setText("Sorry!");
// holder.root.setOnClickListener(null);
dispatchRemovePopUp();
return;
}
final User user = data.get(position);
Expand Down