|
|
|
@ -180,32 +180,31 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
return WindowInsetsCompat.CONSUMED;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (this instanceof ActivityCompose)
|
|
|
|
|
ViewCompat.setWindowInsetsAnimationCallback(
|
|
|
|
|
holder,
|
|
|
|
|
new WindowInsetsAnimationCompat.Callback(WindowInsetsAnimationCompat.Callback.DISPATCH_MODE_STOP) {
|
|
|
|
|
@NonNull
|
|
|
|
|
@Override
|
|
|
|
|
public WindowInsetsCompat onProgress(
|
|
|
|
|
@NonNull WindowInsetsCompat windowInsets,
|
|
|
|
|
@NonNull List<WindowInsetsAnimationCompat> runningAnimations) {
|
|
|
|
|
try {
|
|
|
|
|
// https://developer.android.com/develop/ui/views/layout/sw-keyboard
|
|
|
|
|
for (WindowInsetsAnimationCompat animation : runningAnimations)
|
|
|
|
|
if ((animation.getTypeMask() & WindowInsetsCompat.Type.ime()) != 0) {
|
|
|
|
|
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
|
|
|
|
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
|
|
|
|
int pad = bottom - insets.bottom;
|
|
|
|
|
holder.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return windowInsets;
|
|
|
|
|
ViewCompat.setWindowInsetsAnimationCallback(
|
|
|
|
|
holder,
|
|
|
|
|
new WindowInsetsAnimationCompat.Callback(WindowInsetsAnimationCompat.Callback.DISPATCH_MODE_STOP) {
|
|
|
|
|
@NonNull
|
|
|
|
|
@Override
|
|
|
|
|
public WindowInsetsCompat onProgress(
|
|
|
|
|
@NonNull WindowInsetsCompat windowInsets,
|
|
|
|
|
@NonNull List<WindowInsetsAnimationCompat> runningAnimations) {
|
|
|
|
|
try {
|
|
|
|
|
// https://developer.android.com/develop/ui/views/layout/sw-keyboard
|
|
|
|
|
for (WindowInsetsAnimationCompat animation : runningAnimations)
|
|
|
|
|
if ((animation.getTypeMask() & WindowInsetsCompat.Type.ime()) != 0) {
|
|
|
|
|
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
|
|
|
|
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
|
|
|
|
int pad = bottom - insets.bottom;
|
|
|
|
|
holder.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return windowInsets;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
super.setContentView(holder);
|
|
|
|
|
|
|
|
|
|