fix: keep chat composer above ime on android
This commit is contained in:
@@ -35,4 +35,25 @@ public class BossWindowInsetsTest {
|
||||
assertEquals(20, view.getPaddingBottom());
|
||||
assertEquals(insets, applied);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void applyKeyboardAvoidingInset_addsImeInsetToBottomPadding() {
|
||||
View view = new View(RuntimeEnvironment.getApplication());
|
||||
view.setPadding(10, 12, 14, 16);
|
||||
|
||||
BossWindowInsets.applyKeyboardAvoidingInset(view);
|
||||
|
||||
WindowInsetsCompat insets = new WindowInsetsCompat.Builder()
|
||||
.setInsets(WindowInsetsCompat.Type.navigationBars(), Insets.of(0, 0, 0, 24))
|
||||
.setInsets(WindowInsetsCompat.Type.ime(), Insets.of(0, 0, 0, 180))
|
||||
.build();
|
||||
|
||||
WindowInsetsCompat applied = androidx.core.view.ViewCompat.dispatchApplyWindowInsets(view, insets);
|
||||
|
||||
assertEquals(10, view.getPaddingLeft());
|
||||
assertEquals(12, view.getPaddingTop());
|
||||
assertEquals(14, view.getPaddingRight());
|
||||
assertEquals(196, view.getPaddingBottom());
|
||||
assertEquals(insets, applied);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user