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,27 +893,28 @@ 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());
|
||||
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;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (prevView != null) {
|
||||
view.setNextFocusLeftId(prevView.getId());
|
||||
prevView.setNextFocusRightId(view.getId());
|
||||
}
|
||||
prevView = view;
|
||||
}
|
||||
}
|
||||
|
||||
if (needsNewFocus) {
|
||||
requestFocus();
|
||||
}
|
||||
|
||||
prevView = view;
|
||||
}
|
||||
}
|
||||
|
||||
public void setShadowVisibility(boolean visible) {
|
||||
|
Loading…
Reference in New Issue
Block a user