<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
- <com.android.browser.TitleBarSet android:id="@+id/title_bar"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/tab_unselected"
- />
<LinearLayout android:id="@+id/error_console"
android:layout_width="fill_parent"
// holds everything else.
FrameLayout browserFrameLayout = (FrameLayout) LayoutInflater.from(this)
.inflate(R.layout.custom_screen, null);
- mTitleBar = (TitleBarSet) browserFrameLayout.findViewById(R.id.title_bar);
mContentView = (FrameLayout) browserFrameLayout.findViewById(
R.id.main_content);
mErrorConsoleContainer = (LinearLayout) browserFrameLayout.findViewById(
mCustomViewContainer = (FrameLayout) browserFrameLayout
.findViewById(R.id.fullscreen_custom_content);
frameLayout.addView(browserFrameLayout, COVER_SCREEN_PARAMS);
+ mTitleBar = new TitleBarSet(this);
} else {
mCustomViewContainer = new FrameLayout(this);
mCustomViewContainer.setBackgroundColor(Color.BLACK);
attachTabToContentView(tab);
if (CUSTOM_BROWSER_BAR) {
mTitleBar.setCurrentTab(index);
- WebView view = tab.getWebView();
- view.slideIntoFocus();
}
return true;
}
ViewGroup.LayoutParams.WRAP_CONTENT));
}
+ WebView view = t.getWebView();
+ view.addTitleBar(mTitleBar);
// Attach the sub window if necessary
attachSubWindow(t);
// Request focus on the top window.
mErrorConsoleContainer.removeView(mTabControl.getCurrentErrorConsole(false));
}
+ WebView view = t.getWebView();
+ view.addTitleBar(null);
+
// Remove the sub window if it exists.
if (t.getSubWebView() != null) {
mContentView.removeView(t.getSubWebViewContainer());
CookieSyncManager.getInstance().resetSync();
mInLoad = true;
- if (CUSTOM_BROWSER_BAR) {
- mTitleBar.setVisibility(View.VISIBLE);
- }
updateInLoadMenuItems();
if (!mIsNetworkUp) {
if ( mAlertDialog == null) {
}
@Override
- public void onChangeViewingMode(WebView view, int newViewingMode) {
- if (!CUSTOM_BROWSER_BAR || view != getTopWindow()) {
- return;
- }
- switch (newViewingMode) {
- case WebView.NO_VIEWING_MODE:
- break;
- case WebView.OVERVIEW_MODE:
- case WebView.READING_MODE_WITH_TITLE_BAR:
- case WebView.TITLE_BAR_DISMISS_MODE:
- mTitleBar.setVisibility(View.VISIBLE);
- break;
- case WebView.READING_MODE:
- mTitleBar.setVisibility(View.GONE);
- break;
- default:
- break;
- }
- }
-
- @Override
public boolean onCreateWindow(WebView view, final boolean dialog,
final boolean userGesture, final Message resultMsg) {
// Short-circuit if we can't create any more tabs or sub windows.