No issue: Fix Crash lower API by setting gradient drawables in onBind
parent
79160255c8
commit
015922ddd2
|
@ -5,14 +5,15 @@
|
|||
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
||||
|
||||
import android.view.View
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import kotlinx.android.synthetic.main.onboarding_automatic_signin.view.turn_on_sync_button
|
||||
import kotlinx.android.synthetic.main.onboarding_automatic_signin.view.header_text
|
||||
import kotlinx.android.synthetic.main.onboarding_automatic_signin.view.*
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import mozilla.components.service.fxa.sharing.ShareableAccount
|
||||
import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelativeWithIntrinsicBounds
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.components.FenixSnackbar
|
||||
import org.mozilla.fenix.ext.components
|
||||
|
@ -51,6 +52,8 @@ class OnboardingAutomaticSignInViewHolder(private val view: View) : RecyclerView
|
|||
view.header_text.text = view.context.getString(
|
||||
R.string.onboarding_firefox_account_auto_signin_header_2, account.email
|
||||
)
|
||||
val icon = AppCompatResources.getDrawable(view.context, R.drawable.ic_onboarding_avatar_anonymous)
|
||||
view.header_text.putCompoundDrawablesRelativeWithIntrinsicBounds(start = icon)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
|
||||
|
||||
import android.view.View
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.navigation.Navigation
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlinx.android.synthetic.main.onboarding_manual_signin.view.*
|
||||
import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelativeWithIntrinsicBounds
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.home.HomeFragmentDirections
|
||||
|
||||
|
@ -22,6 +24,8 @@ class OnboardingManualSignInViewHolder(private val view: View) : RecyclerView.Vi
|
|||
fun bind() {
|
||||
val appName = view.context.getString(R.string.app_name)
|
||||
view.header_text.text = view.context.getString(R.string.onboarding_firefox_account_header, appName)
|
||||
val icon = AppCompatResources.getDrawable(view.context, R.drawable.ic_onboarding_firefox_accounts)
|
||||
view.header_text.putCompoundDrawablesRelativeWithIntrinsicBounds(start = icon)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:drawableStart="@drawable/ic_onboarding_avatar_anonymous"
|
||||
android:drawablePadding="12dp"
|
||||
android:textAppearance="@style/Header16TextStyle"
|
||||
android:textColor="@color/onboarding_card_primary_text_dark"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:drawableStart="@drawable/ic_onboarding_firefox_accounts"
|
||||
android:drawablePadding="12dp"
|
||||
android:textAppearance="@style/Header16TextStyle"
|
||||
android:textColor="@color/onboarding_card_primary_text_dark"
|
||||
|
|
Loading…
Reference in New Issue