2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00
* Added tint to onboarding icons and udpated finish button tint

* Replaced tint parameter with onboarding_card_icon color in setOnboardingIcon
This commit is contained in:
Mohammaduvez 2020-02-06 11:16:12 +05:30 committed by GitHub
parent 0437e6f5a5
commit 41c9adce29
6 changed files with 8 additions and 11 deletions

View File

@ -5,7 +5,6 @@
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
import android.widget.TextView import android.widget.TextView
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
@ -16,12 +15,10 @@ import org.mozilla.fenix.ext.setBounds
/** /**
* Sets the drawableStart of a header in an onboarding card. * Sets the drawableStart of a header in an onboarding card.
*/ */
fun TextView.setOnboardingIcon(@DrawableRes id: Int, @ColorRes tint: Int? = null) { fun TextView.setOnboardingIcon(@DrawableRes id: Int) {
val icon = AppCompatResources.getDrawable(context, id) val icon = AppCompatResources.getDrawable(context, id)
val size = context.resources.getDimensionPixelSize(R.dimen.onboarding_header_icon_height_width) val size = context.resources.getDimensionPixelSize(R.dimen.onboarding_header_icon_height_width)
icon?.setBounds(size) icon?.setBounds(size)
tint?.let { icon?.setTint(ContextCompat.getColor(context, R.color.onboarding_card_icon))
icon?.setTint(ContextCompat.getColor(context, tint))
}
putCompoundDrawablesRelative(start = icon) putCompoundDrawablesRelative(start = icon)
} }

View File

@ -8,8 +8,6 @@ import android.view.View
import android.widget.Switch import android.widget.Switch
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.* import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.*
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.description_text
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.header_text
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings import org.mozilla.fenix.ext.settings

View File

@ -8,16 +8,14 @@ import android.text.SpannableString
import android.text.style.UnderlineSpan import android.text.style.UnderlineSpan
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.header_text
import kotlinx.android.synthetic.main.onboarding_whats_new.view.* import kotlinx.android.synthetic.main.onboarding_whats_new.view.*
import kotlinx.android.synthetic.main.onboarding_whats_new.view.description_text
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.settings.SupportUtils import org.mozilla.fenix.settings.SupportUtils
class OnboardingWhatsNewViewHolder(view: View) : RecyclerView.ViewHolder(view) { class OnboardingWhatsNewViewHolder(view: View) : RecyclerView.ViewHolder(view) {
init { init {
view.header_text.setOnboardingIcon(R.drawable.ic_whats_new, R.color.accent_bright_dark_theme) view.header_text.setOnboardingIcon(R.drawable.ic_whats_new)
val appName = view.context.getString(R.string.app_name) val appName = view.context.getString(R.string.app_name)
view.description_text.text = view.context.getString(R.string.onboarding_whats_new_description, appName) view.description_text.text = view.context.getString(R.string.onboarding_whats_new_description, appName)

View File

@ -8,7 +8,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:background="@drawable/onboarding_button_background" android:background="@drawable/onboarding_button_background"
android:backgroundTint="?accent" android:backgroundTint="@color/onboarding_card_icon"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:gravity="center" android:gravity="center"

View File

@ -43,4 +43,7 @@
<!-- Reader View colors --> <!-- Reader View colors -->
<color name="mozac_feature_readerview_text_color">@color/primary_text_dark_theme</color> <color name="mozac_feature_readerview_text_color">@color/primary_text_dark_theme</color>
<!-- Onboarding colors -->
<color name="onboarding_card_icon">@color/accent_dark_theme</color>
</resources> </resources>

View File

@ -212,6 +212,7 @@
<color name="onboarding_card_primary_text_dark">#FFFFFF</color> <color name="onboarding_card_primary_text_dark">#FFFFFF</color>
<color name="onboarding_card_button_background_dark">#F9F9FB</color> <color name="onboarding_card_button_background_dark">#F9F9FB</color>
<color name="onboarding_card_button_text_dark">#312A65</color> <color name="onboarding_card_button_text_dark">#312A65</color>
<color name="onboarding_card_icon">@color/accent_bright_light_theme</color>
<!-- Share UI --> <!-- Share UI -->
<color name="default_share_background">#E3E2E3</color> <color name="default_share_background">#E3E2E3</color>