Status Update
Comments
fs...@gmail.com <fs...@gmail.com> #2
removed the dup; this is possibly about how android spans work on empty strings.
- the calculation in the composable level seemed correct but the layout was not
- it happens for a new line as well
- one problem with both includeFontPadding true/false is that the cursor height is possibly can be visually improved to match the text ascent/descent rather than line top/bottom (might be challenging)
Description
Version used: 2.0.0
Devices/Android versions reproduced on: Android 8.1 on Zebra TC51 and TC52
==== MainActivity ====
override fun onCreate(savedInstanceState: Bundle?) {
val host = supportFragmentManager.findFragmentById(R.id.navigation_host_fragment)
val fragmentManager = host?.childFragmentManager
fragmentManager?.addOnBackStackChangedListener {
handleCurrentFragment()
}
handleCurrentFragment()
}
private fun handleCurrentFragment() {
val host = supportFragmentManager.findFragmentById(R.id.navigation_host_fragment)
val fragment = host?.childFragmentManager?.primaryNavigationFragment // This is null in the second case mentioned below
val enableRead = fragment is BarcodeListener && fragment.isScanningEnabled()
scanner.setScanningEnabled(enabled = enableRead)
scannerIndicatorCard.visibility = if (fragment is BarcodeListener) View.VISIBLE else View.GONE
}
=== Actions that work ====
- Start on <Fragment A>.
- Navigate from <Fragment A> to <Fragment B> using directions.
handleCurrentFragment() is called, primaryNavigationFragment is <Fragment B>
- Navigate from <Fragment B> to <Fragment C> using directions.
handleCurrentFragment() is called, primaryNavigationFragment is <Fragment C>
- Call navigateUp() from <Fragment C>
handleCurrentFragment() is called, primaryNavigationFragment is <Fragment B>
=== Actions that cause the issue ===
- Start on <Fragment A>.
- Navigate from <Fragment A> to <Fragment B> using directions.
handleCurrentFragment() is called, primaryNavigationFragment is <Fragment B>
- Navigate from <Fragment B> to <Fragment C> using directions.
handleCurrentFragment() is called, primaryNavigationFragment is <Fragment C>
- Navigate from <Fragment C> to <Fragment C> using directions (single top chosen in graph xml)
handleCurrentFragment() is called, primaryNavigationFragment is <Fragment C>
- Call navigateUp() from <Fragment C>
handleCurrentFragment() is called, primaryNavigationFragment is null
Attached are screenshots of a graph that would reproduce the issue and the graph discovered on.