This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class DelayAutoCompleteTextView extends AutoCompleteTextView { | |
| private static final int MESSAGE_TEXT_CHANGED = 100; | |
| private static final int DEFAULT_AUTOCOMPLETE_DELAY = 1000; | |
| private int mAutoCompleteDelay = DEFAULT_AUTOCOMPLETE_DELAY; | |
| private static class AvoidingMemoryLeakHandler extends Handler { | |
| private final WeakReference<DelayAutoCompleteTextView> delayAutoCompleteTextViewWeakReference; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.graphics.Bitmap; | |
| import androidx.annotation.IntRange; | |
| import androidx.annotation.NonNull; | |
| import java.util.Arrays; | |
| /** | |
| * This is copied from https://stackoverflow.com/a/10028267/3050249 | |
| * and optimized for less memory consumption & better locality, and creates less GC pressure. |
OlderNewer