Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions AnkiDroid/src/main/java/com/ichi2/anki/Info.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import com.ichi2.anki.common.utils.android.getColorFromAttr
import com.ichi2.anki.databinding.ActivityInfoBinding
import com.ichi2.anki.snackbar.BaseSnackbarBuilderProvider
import com.ichi2.anki.snackbar.SnackbarBuilder
import com.ichi2.anki.utils.bottomCornerClearance
import com.ichi2.utils.IntentUtil.canOpenIntent
import com.ichi2.utils.IntentUtil.tryOpenIntent
import com.ichi2.utils.VersionUtils.appName
Expand Down Expand Up @@ -178,11 +177,9 @@ class Info :
// the toolbar's parent: padding on the Toolbar counts towards its minHeight,
// which would shrink the app bar's content below actionBarSize
binding.toolbarContainer.updatePadding(left = bars.left, top = bars.top, right = bars.right)
binding.content.updatePadding(
left = bars.left,
right = bars.right,
bottom = maxOf(bars.bottom, insets.bottomCornerClearance(binding.content)),
)
// no corner clearance: the buttons carry a 12dp horizontal margin, so the arc
// intrudes less than the navigation bar already clears
binding.content.updatePadding(left = bars.left, right = bars.right, bottom = bars.bottom)
insets
}
}
Expand Down
7 changes: 4 additions & 3 deletions AnkiDroid/src/test/java/com/ichi2/anki/InfoInsetsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ class InfoInsetsTest : RobolectricTest() {
}

@Test
fun `bottom controls clear rounded display corners larger than the navigation bar`() =
fun `rounded display corners do not lift the buttons any further`() =
withInfo { info ->
info.dispatchInsets(navBarBottom = 24.dp, bottomCornerRadius = 48.dp)

assertThat(
"'donate' rests above the corner arc, not just the navigation bar",
"the buttons' own 12dp margin puts them inboard of the corner arc, which at that " +
"radius intrudes ~16dp, so the navigation bar already clears them",
info.content.paddingBottom,
equalTo(48.dp.toPx(targetContext)),
equalTo(24.dp.toPx(targetContext)),
)
}

Expand Down
Loading