mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-25 13:45:39 +02:00
Simpler fix for the launcher activity
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true">
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" android:fitsSystemWindows="true">
|
||||
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">
|
||||
<TextView style="@style/paragraph" android:text="@string/launcher_description"/>
|
||||
<Button style="@style/paragraph" android:text="@string/launcher_button_imesettings" android:onClick="launch_imesettings" android:layout_width="wrap_content"/>
|
||||
|
@@ -36,9 +36,7 @@ public class LauncherActivity extends Activity implements Handler.Callback
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
View content_view = View.inflate(this, R.layout.launcher_activity, null);
|
||||
setContentView(content_view);
|
||||
Utils.enable_edge_to_edge(content_view);
|
||||
setContentView(R.layout.launcher_activity);
|
||||
_tryhere_text = (TextView)findViewById(R.id.launcher_tryhere_text);
|
||||
_tryhere_area = (EditText)findViewById(R.id.launcher_tryhere_area);
|
||||
if (VERSION.SDK_INT >= 28)
|
||||
|
@@ -59,20 +59,4 @@ public final class Utils
|
||||
int res_id = res.getIdentifier("config_navBarInteractionMode", "integer", "android");
|
||||
return (res_id > 0 && res.getInteger(res_id) == 2);
|
||||
}
|
||||
|
||||
public static void enable_edge_to_edge(View v)
|
||||
{
|
||||
/* Edge-to-edge became enabled by default on API 35. */
|
||||
if (VERSION.SDK_INT < 35)
|
||||
return;
|
||||
v.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener(){
|
||||
@Override
|
||||
public WindowInsets onApplyWindowInsets(View v, WindowInsets wi)
|
||||
{
|
||||
Insets i = wi.getInsets(WindowInsets.Type.systemBars());
|
||||
v.setPadding(i.left, i.top, i.right, i.bottom);
|
||||
return WindowInsets.CONSUMED;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user