Loading app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener, val origFabMarginRight = (fab.layoutParams as ViewGroup.MarginLayoutParams).rightMargin val origFabMarginBottom = (fab.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin ViewCompat.setOnApplyWindowInsetsListener(fab) { v, insets -> val bars = insets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.systemBars()) val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) v.updateLayoutParams<ViewGroup.MarginLayoutParams> { rightMargin = origFabMarginRight + bars.right Loading app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardActivity.kt +5 −6 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import im.angry.openeuicc.util.OpenEuiccContextMarker import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import net.typeblog.lpac_jni.LocalProfileAssistant import kotlin.math.max class DownloadWizardActivity : BaseEuiccAccessActivity() { data class DownloadWizardState( Loading Loading @@ -98,21 +97,21 @@ class DownloadWizardActivity : BaseEuiccAccessActivity() { val origHeight = navigation.layoutParams.height ViewCompat.setOnApplyWindowInsetsListener(navigation) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() or WindowInsetsCompat.Type.ime() ) val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) v.updatePadding(bars.left, 0, bars.right, max(bars.bottom, ime.bottom)) v.updatePadding(bars.left, 0, bars.right, bars.bottom) val newParams = navigation.layoutParams newParams.height = origHeight + max(bars.bottom, ime.bottom) newParams.height = origHeight + bars.bottom navigation.layoutParams = newParams WindowInsetsCompat.CONSUMED } val fragmentRoot = requireViewById<View>(R.id.step_fragment_container) ViewCompat.setOnApplyWindowInsetsListener(fragmentRoot) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) Loading app-common/src/main/java/im/angry/openeuicc/util/UiUtils.kt +9 −1 Original line number Diff line number Diff line Loading @@ -34,10 +34,18 @@ fun DialogFragment.setWidthPercent(percentage: Int) { dialog?.window?.setLayout(percentWidth.toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) } /** * Call this method (in onActivityCreated or later) * to make the dialog near-full screen. */ fun DialogFragment.setFullScreen() { dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } fun AppCompatActivity.setupToolbarInsets() { val spacer = requireViewById<View>(R.id.toolbar_spacer) ViewCompat.setOnApplyWindowInsetsListener(requireViewById(R.id.toolbar)) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) Loading app/src/main/java/im/angry/openeuicc/ui/LuiActivity.kt +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class LuiActivity : AppCompatActivity() { setContentView(R.layout.activity_lui) ViewCompat.setOnApplyWindowInsetsListener(requireViewById(R.id.lui_container)) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) Loading Loading
app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener, val origFabMarginRight = (fab.layoutParams as ViewGroup.MarginLayoutParams).rightMargin val origFabMarginBottom = (fab.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin ViewCompat.setOnApplyWindowInsetsListener(fab) { v, insets -> val bars = insets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.systemBars()) val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) v.updateLayoutParams<ViewGroup.MarginLayoutParams> { rightMargin = origFabMarginRight + bars.right Loading
app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardActivity.kt +5 −6 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import im.angry.openeuicc.util.OpenEuiccContextMarker import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import net.typeblog.lpac_jni.LocalProfileAssistant import kotlin.math.max class DownloadWizardActivity : BaseEuiccAccessActivity() { data class DownloadWizardState( Loading Loading @@ -98,21 +97,21 @@ class DownloadWizardActivity : BaseEuiccAccessActivity() { val origHeight = navigation.layoutParams.height ViewCompat.setOnApplyWindowInsetsListener(navigation) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() or WindowInsetsCompat.Type.ime() ) val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) v.updatePadding(bars.left, 0, bars.right, max(bars.bottom, ime.bottom)) v.updatePadding(bars.left, 0, bars.right, bars.bottom) val newParams = navigation.layoutParams newParams.height = origHeight + max(bars.bottom, ime.bottom) newParams.height = origHeight + bars.bottom navigation.layoutParams = newParams WindowInsetsCompat.CONSUMED } val fragmentRoot = requireViewById<View>(R.id.step_fragment_container) ViewCompat.setOnApplyWindowInsetsListener(fragmentRoot) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) Loading
app-common/src/main/java/im/angry/openeuicc/util/UiUtils.kt +9 −1 Original line number Diff line number Diff line Loading @@ -34,10 +34,18 @@ fun DialogFragment.setWidthPercent(percentage: Int) { dialog?.window?.setLayout(percentWidth.toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) } /** * Call this method (in onActivityCreated or later) * to make the dialog near-full screen. */ fun DialogFragment.setFullScreen() { dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } fun AppCompatActivity.setupToolbarInsets() { val spacer = requireViewById<View>(R.id.toolbar_spacer) ViewCompat.setOnApplyWindowInsetsListener(requireViewById(R.id.toolbar)) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) Loading
app/src/main/java/im/angry/openeuicc/ui/LuiActivity.kt +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class LuiActivity : AppCompatActivity() { setContentView(R.layout.activity_lui) ViewCompat.setOnApplyWindowInsetsListener(requireViewById(R.id.lui_container)) { v, insets -> val bars = insets.getInsetsIgnoringVisibility( val bars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) Loading