Skip to content

Commit

Permalink
Apply both offsets to main activity and no longer adjust post detail …
Browse files Browse the repository at this point in the history
…footer
  • Loading branch information
nbradbury committed Feb 27, 2025
1 parent a014055 commit eca60a7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,5 @@ open class BaseAppCompatActivity : AppCompatActivity() {
applyTopOffset = false,
applyBottomOffset = true
),

// apply top offset only
WPMainActivity::class.java.name to ActivityOffsets(
applyTopOffset = true,
applyBottomOffset = false
),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -487,21 +487,6 @@ class ReaderPostDetailFragment : ViewPagerFragment(),
params.behavior = HideBottomViewOnScrollBehavior<View>()
}
layoutFooterBinding.root.isInvisible = true

// on SDK 35+ edge-to-edge is enabled so we want to avoid covering the navigation bar icons by
// taking the nav bar height into account (nav height will be 0 when gesture nav is enabled)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
layoutFooterBinding.root.findViewById<View>(R.id.reader_detail_footer_button_container)
?.let { footerContainer ->
ViewCompat.setOnApplyWindowInsetsListener(footerContainer) { _, insets ->
val navigationBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
val addedMargin = resources.getDimensionPixelSize(R.dimen.margin_small)
(footerContainer.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin =
addedMargin + navigationBarInsets.bottom
insets
}
}
}
}
}.also { stub ->
stub.inflate()
Expand Down

0 comments on commit eca60a7

Please sign in to comment.