diff options
author | Yorke Lee <yorkelee@google.com> | 2014-04-17 19:56:18 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-17 19:56:18 +0000 |
commit | d2f6070b32ce0c5b24ae056d79e79a7c29202fc0 (patch) | |
tree | bab18337762fd635b6c1ceb7579a9cd24b5a1a09 /src | |
parent | b4cae012ebdd18b5f3b854e8a91f21307c2dbdb7 (diff) | |
parent | 33932ff9433bcd172749d416c23655c8d8bdafc2 (diff) |
am 33932ff9: Fix Dial intent interactions
* commit '33932ff9433bcd172749d416c23655c8d8bdafc2':
Fix Dial intent interactions
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 15 | ||||
-rw-r--r-- | src/com/android/dialer/list/SearchFragment.java | 6 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 54041b087..9890b4a3c 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -29,6 +29,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.content.res.TypedArray; import android.graphics.Outline; import android.net.Uri; import android.os.Bundle; @@ -159,6 +160,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private View mFragmentsFrame; + private int mActionBarHeight; private boolean mInDialpadSearch; private boolean mInRegularSearch; private boolean mClearSearchOnPause; @@ -306,6 +308,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O getActionBar().setDisplayShowHomeEnabled(false); getActionBar().setDisplayShowTitleEnabled(false); + final TypedArray styledAttributes = getTheme().obtainStyledAttributes( + new int[] { android.R.attr.actionBarSize }); + mActionBarHeight = (int) styledAttributes.getDimension(0, 0); + styledAttributes.recycle(); + // Add the favorites fragment, and the dialpad fragment, but only if savedInstanceState // is null. Otherwise the fragment manager takes care of recreating these fragments. if (savedInstanceState == null) { @@ -597,11 +604,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O fragment = mRegularSearchFragment; } if (fragment != null && fragment.isVisible()) { - fragment.getListView().animate().translationY(-getActionBar().getHeight()) + fragment.getListView().animate().translationY(-mActionBarHeight) .setInterpolator(hideActionBarInterpolator).setDuration(ANIMATION_DURATION); } - if (mListsFragment != null && mListsFragment.isVisible()) { + if (mListsFragment != null && mListsFragment.isResumed() && mListsFragment.isVisible()) { // If the favorites fragment is showing, fade to blank. mFragmentsFrame.animate().alpha(0.0f); } @@ -967,4 +974,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void onHomeInActionBarSelected() { mPhoneNumberPickerActionListener.onHomeInActionBarSelected(); } + + public int getActionBarHeight() { + return mActionBarHeight; + } } diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java index 19553fbd6..c4fac695a 100644 --- a/src/com/android/dialer/list/SearchFragment.java +++ b/src/com/android/dialer/list/SearchFragment.java @@ -40,6 +40,7 @@ public class SearchFragment extends PhoneNumberPickerFragment { * intent. */ private String mAddToContactNumber; + private int mActionBarHeight; @Override public void onAttach(Activity activity) { @@ -65,10 +66,11 @@ public class SearchFragment extends PhoneNumberPickerFragment { getAdapter().setHasHeader(0, false); } + mActionBarHeight = ((DialtactsActivity) getActivity()).getActionBarHeight(); final ListView listView = getListView(); listView.setPaddingRelative( listView.getPaddingStart(), - getActivity().getActionBar().getHeight(), + mActionBarHeight, listView.getPaddingEnd(), listView.getPaddingBottom()); listView.setClipToPadding(false); @@ -86,7 +88,7 @@ public class SearchFragment extends PhoneNumberPickerFragment { }); if (!getActivity().getActionBar().isShowing()) { - listView.setTranslationY(-getActivity().getActionBar().getHeight()); + listView.setTranslationY(-mActionBarHeight); } } |