2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-11 13:11:01 +00:00

fixes #22889: add bottom spacer to onboarding adapter

This commit is contained in:
Matt Tighe 2021-12-17 13:02:58 -08:00 committed by mergify[bot]
parent eb2ec677ca
commit db71d8dfe7
5 changed files with 16 additions and 21 deletions

View File

@ -25,7 +25,7 @@ private const val EXPECTED_SUPPRESSION_COUNT = 19
@Suppress("TopLevelPropertyNaming") // it's silly this would have a different naming convention b/c no const
private val EXPECTED_RUNBLOCKING_RANGE = 0..1 // CI has +1 counts compared to local runs: increment these together
private const val EXPECTED_RECYCLER_VIEW_CONSTRAINT_LAYOUT_CHILDREN = 4
private const val EXPECTED_NUMBER_OF_INFLATION = 13
private const val EXPECTED_NUMBER_OF_INFLATION = 14
private val failureMsgStrictMode = getErrorMessage(
shortName = "StrictMode suppression",

View File

@ -5,24 +5,13 @@
package org.mozilla.fenix.home
import android.view.View
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.unit.dp
import androidx.recyclerview.widget.RecyclerView
import org.mozilla.fenix.theme.FirefoxTheme
class BottomSpacerViewHolder(val composeView: ComposeView) : RecyclerView.ViewHolder(composeView) {
init {
composeView.setContent {
FirefoxTheme {
Spacer(modifier = Modifier.height(88.dp))
}
}
}
import org.mozilla.fenix.R
class BottomSpacerViewHolder(
view: View,
) : RecyclerView.ViewHolder(view) {
companion object {
val LAYOUT_ID = View.generateViewId()
val LAYOUT_ID = R.layout.bottom_spacer
}
}

View File

@ -235,9 +235,6 @@ class SessionControlAdapter(
interactor = interactor,
metrics = components.analytics.metrics
)
BottomSpacerViewHolder.LAYOUT_ID -> return BottomSpacerViewHolder(
composeView = ComposeView(parent.context)
)
}
val view = LayoutInflater.from(parent.context).inflate(viewType, parent, false)
@ -284,6 +281,7 @@ class SessionControlAdapter(
view,
interactor
)
BottomSpacerViewHolder.LAYOUT_ID -> BottomSpacerViewHolder(view)
else -> throw IllegalStateException()
}
}

View File

@ -142,7 +142,8 @@ private fun onboardingAdapterItems(onboardingState: OnboardingState): List<Adapt
items.addAll(
listOf(
AdapterItem.OnboardingPrivacyNotice,
AdapterItem.OnboardingFinish
AdapterItem.OnboardingFinish,
AdapterItem.BottomSpacer
)
)

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="88dp" />