Skip to content

Instantly share code, notes, and snippets.

@xuhaibahmad
Created May 2, 2017 10:29
Show Gist options
  • Save xuhaibahmad/ce8e4837eba3a0233e8271d186d362d5 to your computer and use it in GitHub Desktop.
Save xuhaibahmad/ce8e4837eba3a0233e8271d186d362d5 to your computer and use it in GitHub Desktop.
Variation of AutoCompleteTextView that displays suggestions even in absence of any text input. Often used in conjunction with a handle view to mimic a custom drop down behavior
package com.android.tresmark.utils;
import android.content.Context;
import android.support.v7.widget.AppCompatAutoCompleteTextView;
import android.util.AttributeSet;
/**
* Created by Zuhaib on 5/2/2017.
* <p>
* Variation of {@link android.widget.AutoCompleteTextView} that displays suggestions even in
* absence of any text input. Often used in conjunction with a handle view to mimic a custom
* drop down behavior.
*/
public class DropDownEditText extends AppCompatAutoCompleteTextView {
public DropDownEditText(Context context) {
super(context);
}
public DropDownEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public DropDownEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean enoughToFilter() {
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment