Fix calculation of screen height for quick contacts now that
DisplayMetrics reports it without screen decorations.
Change-Id: I344fa79dab2a22468651818746546553bbd6e4f5
diff --git a/src/com/android/contacts/quickcontact/QuickContactWindow.java b/src/com/android/contacts/quickcontact/QuickContactWindow.java
index 147e364..a66f506 100644
--- a/src/com/android/contacts/quickcontact/QuickContactWindow.java
+++ b/src/com/android/contacts/quickcontact/QuickContactWindow.java
@@ -54,6 +54,7 @@
import android.provider.ContactsContract.QuickContact;
import android.provider.ContactsContract.RawContacts;
import android.text.TextUtils;
+import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ActionMode;
import android.view.ContextThemeWrapper;
@@ -248,11 +249,9 @@
mBackground = new QuickContactBackgroundDrawable();
mRootView.setBackgroundDrawable(mBackground);
- mScreenWidth = mWindowManager.getDefaultDisplay().getWidth();
- // Status bar height
- final int screenMarginBottom = context.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.screen_margin_bottom);
- mUseableScreenHeight = mWindowManager.getDefaultDisplay().getHeight() - screenMarginBottom;
+ final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
+ mScreenWidth = metrics.widthPixels;
+ mUseableScreenHeight = metrics.heightPixels;
mTrack = (ViewGroup) mWindow.findViewById(R.id.quickcontact);
mTrackScroll = (HorizontalScrollView) mWindow.findViewById(R.id.scroll);