@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
- mQuickContactWindow.dismiss();
+ mQuickContactWindow.onBackPressed();
return true;
} else {
return super.dispatchKeyEventPreIme(event);
private int mMode;
private RootLayout mRootView;
- private View mHeaderView;
private View mHeader;
private HorizontalScrollView mTrackScroll;
private ViewGroup mTrack;
mRootView = (RootLayout)mWindow.findViewById(R.id.root);
mRootView.mQuickContactWindow = this;
-
- mHeaderView = mWindow.findViewById(R.id.header);
- mHeaderView.setFocusable(true);
- mHeaderView.setFocusableInTouchMode(true);
+ mRootView.setFocusable(true);
+ mRootView.setFocusableInTouchMode(true);
+ mRootView.setDescendantFocusability(RootLayout.FOCUS_AFTER_DESCENDANTS);
mArrowUp = (ImageView)mWindow.findViewById(R.id.arrow_up);
mArrowDown = (ImageView)mWindow.findViewById(R.id.arrow_down);
resetTrack();
// We need to have a focused view inside the QuickContact window so
- // that the BACK key event can be delivered to the RootLayout
- mHeaderView.requestFocus();
+ // that the BACK key event can be intercepted
+ mRootView.requestFocus();
mHasValidSocial = false;
mDismissed = false;