diff options
author | Yorke Lee <yorkelee@google.com> | 2014-08-07 14:43:28 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-08-07 14:43:28 -0700 |
commit | 94762c39403e4b49aefa8f49620b4a6bc2e675b3 (patch) | |
tree | 06003b5c918a9ae1cac2978b2dbd8be9e075396b /src | |
parent | ba1fca910e44151a4e2f7f221d737c239dd610c1 (diff) |
Fix IllegalStateException in Dialer
Bug: 16862804
Change-Id: Ifa16032686547bb2df213c9155662d0e85b72d49
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteListView.java | 7 | ||||
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoritesTileAdapter.java | 16 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteListView.java b/src/com/android/dialer/list/PhoneFavoriteListView.java index 4ecc1cd90..2b4575486 100644 --- a/src/com/android/dialer/list/PhoneFavoriteListView.java +++ b/src/com/android/dialer/list/PhoneFavoriteListView.java @@ -317,4 +317,11 @@ public class PhoneFavoriteListView extends GridView implements OnDragDropListene return (PhoneFavoriteSquareTileView) child; } + + // Temporary workaround for b/16862804 + @Override + public void onWindowFocusChanged(boolean hasWindowFocus) { + setAddStatesFromChildren(false); + super.onWindowFocusChanged(hasWindowFocus); + } } diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java index 382e42e56..600bd8b5c 100644 --- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java +++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java @@ -35,7 +35,9 @@ import android.provider.ContactsContract.PinnedPositions; import android.text.TextUtils; import android.util.Log; import android.util.LongSparseArray; +import android.view.MotionEvent; import android.view.View; +import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.FrameLayout; @@ -129,6 +131,18 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements } }; + // Temporary workaround for b/16862804 + final OnTouchListener mOnTouchListener = new OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + if (v.getParent() != null) { + ViewGroup parent = (ViewGroup) v.getParent(); + parent.setAddStatesFromChildren(false); + } + return false; + } + }; + public interface OnDataSetChangedForAnimationListener { public void onDataSetChangedForAnimation(long... idsInPlace); public void cacheOffsetsForDatasetChange(); @@ -399,6 +413,8 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements tileView.setPhotoManager(mPhotoManager); tileView.setListener(mListener); tileView.loadFromContact(getItem(position)); + + tileView.setOnTouchListener(mOnTouchListener); return tileView; } |