Merge branch 'dev'
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
android:label="@string/title_activity_main"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -23,7 +23,11 @@ public class MainActivity extends BridgeActivity {
|
||||
final View content = findViewById(android.R.id.content);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(content, (v, windowInsets) -> {
|
||||
Insets bars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);
|
||||
Insets ime = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
|
||||
// 키보드(IME)가 올라오면 그 높이만큼 하단 패딩 → WebView가 키보드 위로 줄어든다.
|
||||
// (입력 모달이 키보드에 가려지지 않고, 포커스된 입력칸이 보이도록 재배치됨)
|
||||
int bottom = Math.max(bars.bottom, ime.bottom);
|
||||
v.setPadding(bars.left, bars.top, bars.right, bottom);
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
ViewCompat.requestApplyInsets(content);
|
||||
|
||||
Reference in New Issue
Block a user