mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 889094 - NPE in BrowserToolbar due to late initialization of mFocusOrder. [r=sriram,bnicholson]
This commit is contained in:
parent
9000441a55
commit
4543e6fdcf
@ -232,6 +232,16 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||
mMenuIcon = (GeckoImageView) findViewById(R.id.menu_icon);
|
||||
mActionItemBar = (LinearLayout) findViewById(R.id.menu_items);
|
||||
mHasSoftMenuButton = !HardwareUtils.hasMenuButton();
|
||||
|
||||
// We use different layouts on phones and tablets, so adjust the focus
|
||||
// order appropriately.
|
||||
if (HardwareUtils.isTablet()) {
|
||||
mFocusOrder = Arrays.asList(mTabs, mBack, mForward, this,
|
||||
mSiteSecurity, mReader, mStop, mActionItemBar, mMenu);
|
||||
} else {
|
||||
mFocusOrder = Arrays.asList(this, mSiteSecurity, mReader, mStop,
|
||||
mTabs, mMenu);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -419,16 +429,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// We use different layouts on phones and tablets, so adjust the focus
|
||||
// order appropriately.
|
||||
if (HardwareUtils.isTablet()) {
|
||||
mFocusOrder = Arrays.asList(mTabs, mBack, mForward, this,
|
||||
mSiteSecurity, mReader, mStop, mActionItemBar, mMenu);
|
||||
} else {
|
||||
mFocusOrder = Arrays.asList(this, mSiteSecurity, mReader, mStop,
|
||||
mTabs, mMenu);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -893,26 +893,27 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||
continue;
|
||||
}
|
||||
|
||||
if (prevView != null) {
|
||||
if (view == mActionItemBar) {
|
||||
final int childCount = mActionItemBar.getChildCount();
|
||||
if (childCount > 1) {
|
||||
View firstChild = mActionItemBar.getChildAt(0);
|
||||
firstChild.setNextFocusLeftId(prevView.getId());
|
||||
prevView.setNextFocusRightId(firstChild.getId());
|
||||
if (view == mActionItemBar) {
|
||||
final int childCount = mActionItemBar.getChildCount();
|
||||
for (int child = 0; child < childCount; child++) {
|
||||
View childView = mActionItemBar.getChildAt(child);
|
||||
if (prevView != null) {
|
||||
childView.setNextFocusLeftId(prevView.getId());
|
||||
prevView.setNextFocusRightId(childView.getId());
|
||||
}
|
||||
view = mActionItemBar.getChildAt(childCount - 1);
|
||||
prevView = childView;
|
||||
}
|
||||
|
||||
view.setNextFocusLeftId(prevView.getId());
|
||||
prevView.setNextFocusRightId(view.getId());
|
||||
} else {
|
||||
if (prevView != null) {
|
||||
view.setNextFocusLeftId(prevView.getId());
|
||||
prevView.setNextFocusRightId(view.getId());
|
||||
}
|
||||
prevView = view;
|
||||
}
|
||||
}
|
||||
|
||||
if (needsNewFocus) {
|
||||
requestFocus();
|
||||
}
|
||||
|
||||
prevView = view;
|
||||
if (needsNewFocus) {
|
||||
requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user