mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1137483 - Move search engine bar under keyboard when shown. r=liuche
This requires the window to resize when the keyboard is shown, which required a revision in when we draw the window background.
This commit is contained in:
parent
39ab2404db
commit
d36db03485
@ -2634,6 +2634,16 @@ public class BrowserApp extends GeckoApp
|
||||
|
||||
fm.beginTransaction().add(R.id.search_container, mBrowserSearch, BROWSER_SEARCH_TAG).commitAllowingStateLoss();
|
||||
mBrowserSearch.setUserVisibleHint(true);
|
||||
|
||||
// We want to adjust the window size when the keyboard appears to bring the
|
||||
// SearchEngineBar above the keyboard. However, adjusting the window size
|
||||
// when hiding the keyboard results in graphical glitches where the keyboard was
|
||||
// because nothing was being drawn underneath (bug 933422). This can be
|
||||
// prevented drawing content under the keyboard (i.e. in the Window).
|
||||
//
|
||||
// We do this here because there are glitches when unlocking a device with
|
||||
// BrowserSearch in the foreground if we use BrowserSearch.onStart/Stop.
|
||||
getActivity().getWindow().setBackgroundDrawableResource(android.R.color.white);
|
||||
}
|
||||
|
||||
private void hideBrowserSearch() {
|
||||
@ -2650,6 +2660,8 @@ public class BrowserApp extends GeckoApp
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.remove(mBrowserSearch).commitAllowingStateLoss();
|
||||
mBrowserSearch.setUserVisibleHint(false);
|
||||
|
||||
getWindow().setBackgroundDrawable(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -230,23 +230,6 @@ public class BrowserSearch extends HomeFragment
|
||||
mSearchEngines = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
// Adjusting the window size when showing the keyboard results in the underlying
|
||||
// activity being painted when the keyboard is hidden (bug 933422). This can be
|
||||
// prevented by not resizing the window.
|
||||
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
@ -19,10 +19,15 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<!-- The window background is set to our desired color, #fff, so
|
||||
reduce overdraw by not drawing the background.
|
||||
|
||||
Note: this needs to be transparent and not null because we
|
||||
draw a divider in onDraw. -->
|
||||
<view class="org.mozilla.gecko.home.SearchEngineBar$SearchEngineBarContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff">
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<!-- We add a marginTop so the outer container can draw a divider.
|
||||
|
||||
|
@ -77,7 +77,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/browser_chrome"
|
||||
android:background="@android:color/white"
|
||||
android:visibility="invisible"/>
|
||||
|
||||
<!-- When focus is cleared from from BrowserToolbar's EditText to
|
||||
|
Loading…
Reference in New Issue
Block a user