GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — DelayedTextWatcher---Android/DelayedTextWatcher.java at master · Sudeepatgithub/DelayedTextWatcher---Android Expand file tree/ Copy pathDelayedTextWatcher.javaMore file actions 64 lines (49 loc) · 1.52 KB / Copy pathDelayedTextWatcher.javaFile metadata and controls64 lines (49 loc) · 1.52 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 package com.naukri.modules; /** * Created by sudeep.srivastava on 05-Aug-16. */ import android.os.AsyncTask; import android.text.Editable; import android.text.TextWatcher; public abstract class DelayedTextWatcher implements TextWatcher { private long delayTime; private WaitTask lastWaitTask; public DelayedTextWatcher(long delayTime) { super(); this.delayTime = delayTime; } @Override public void afterTextChanged(Editable s) { synchronized (this) { if (lastWaitTask != null){ lastWaitTask.cancel(true); } lastWaitTask = new WaitTask(); lastWaitTask.execute(s); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } public abstract void afterTextChangedDelayed(Editable s); private class WaitTask extends AsyncTask<Editable, Void, Editable> { @Override protected Editable doInBackground(Editable... params) { try { Thread.sleep(delayTime); } catch (InterruptedException e) { } return params[0]; } @Override protected void onPostExecute(Editable result) { super.onPostExecute(result); afterTextChangedDelayed(result); } } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |