diff options
author | Yorke Lee <yorkelee@google.com> | 2013-09-25 08:15:13 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-25 08:15:13 -0700 |
commit | 3642700d940a72dec32d2cf123554f8c561f0174 (patch) | |
tree | cfe44da208bd9129d6d56e01cb9ac1b36b806891 | |
parent | 1275f91071cc489bb7103190c07a3295784c4a51 (diff) | |
parent | ad4a5f1f6ded88bcf4e91f1819550619a8a99d19 (diff) |
am ad4a5f1f: Merge "Fix brief flash when clicking on a search result to dial" into klp-dev
* commit 'ad4a5f1f6ded88bcf4e91f1819550619a8a99d19':
Fix brief flash when clicking on a search result to dial
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 4c747c95b..05c9e2c2a 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -29,6 +29,8 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.os.Handler; +import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.CallLog.Calls; @@ -165,6 +167,21 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private DialerDatabaseHelper mDialerDatabaseHelper; + private static final int EVENT_DELAYED_HIDE_SEARCH = 1; + + // Wait this much time (in ms) before hiding the search fragment after clicking on + // a search result to dial, to avoid jank + private static final int CLEAR_SEARCH_DELAY = 500; + + final Handler mHandler = new Handler() { + @Override + public void handleMessage(Message msg) { + if (msg.what == EVENT_DELAYED_HIDE_SEARCH) { + hideDialpadAndSearchUi(); + } + } + }; + /** * Listener used when one of phone numbers in search UI is selected. This will initiate a * phone call using the phone number. @@ -177,14 +194,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O // CallLog screen (search UI will be automatically exited). PhoneNumberInteraction.startInteractionForPhoneCall( DialtactsActivity.this, dataUri, getCallOrigin()); - hideDialpadAndSearchUi(); + mHandler.sendEmptyMessageDelayed(EVENT_DELAYED_HIDE_SEARCH, + CLEAR_SEARCH_DELAY); } @Override public void onCallNumberDirectly(String phoneNumber) { Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin()); startActivity(intent); - hideDialpadAndSearchUi(); + mHandler.sendEmptyMessageDelayed(EVENT_DELAYED_HIDE_SEARCH, + CLEAR_SEARCH_DELAY); } @Override |