Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #20927: Replace icons with AC icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarare authored and mergify[bot] committed Aug 23, 2021
1 parent f88be38 commit 83b752a
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ open class DefaultToolbarMenu(

val installToHomescreen = BrowserMenuHighlightableItem(
label = context.getString(R.string.browser_menu_install_on_homescreen),
startImageResource = R.drawable.ic_add_to_homescreen,
startImageResource = R.drawable.mozac_ic_add_to_home_screen,
iconTintColorResource = primaryTextColor(),
highlight = BrowserMenuHighlight.LowPriority(
label = context.getString(R.string.browser_menu_install_on_homescreen),
Expand Down Expand Up @@ -266,7 +266,7 @@ open class DefaultToolbarMenu(

val addToHomeScreenItem = BrowserMenuImageText(
label = context.getString(R.string.browser_menu_add_to_homescreen),
imageResource = R.drawable.ic_add_to_homescreen,
imageResource = R.drawable.mozac_ic_add_to_home_screen,
iconTintColorResource = primaryTextColor(),
isCollapsingMenuLimit = true
) {
Expand All @@ -291,7 +291,7 @@ open class DefaultToolbarMenu(

val settingsItem = BrowserMenuHighlightableItem(
label = context.getString(R.string.browser_menu_settings),
startImageResource = R.drawable.ic_settings,
startImageResource = R.drawable.mozac_ic_settings,
iconTintColorResource = if (hasAccountProblem)
ThemeManager.resolveAttribute(R.attr.syncDisconnected, context) else
primaryTextColor(),
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class HomeMenu(

val helpItem = BrowserMenuImageText(
context.getString(R.string.browser_menu_help),
R.drawable.ic_help,
R.drawable.mozac_ic_help,
primaryTextColor
) {
onItemTapped.invoke(Item.Help)
Expand All @@ -171,7 +171,7 @@ class HomeMenu(
val variables = experiments.getVariables(FeatureId.NIMBUS_VALIDATION)
val settingsItem = BrowserMenuImageText(
variables.getText("settings-title") ?: context.getString(R.string.browser_menu_settings),
variables.getDrawableResource("settings-icon") ?: R.drawable.ic_settings,
variables.getDrawableResource("settings-icon") ?: R.drawable.mozac_ic_settings,
primaryTextColor
) {
onItemTapped.invoke(Item.Settings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ package org.mozilla.fenix.search.awesomebar

import android.content.Context
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.graphics.BlendModeColorFilterCompat.createBlendModeColorFilterCompat
import androidx.core.graphics.BlendModeCompat.SRC_IN
import androidx.core.graphics.drawable.toBitmap
import mozilla.components.browser.state.search.SearchEngine
import mozilla.components.browser.state.state.searchEngines
import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.concept.awesomebar.AwesomeBar
import mozilla.components.support.ktx.android.content.getColorFromAttr
import org.mozilla.fenix.R
import java.util.UUID

Expand All @@ -26,7 +29,12 @@ class ShortcutsSuggestionProvider(
override val id: String = UUID.randomUUID().toString()

private val settingsIcon by lazy {
AppCompatResources.getDrawable(context, R.drawable.ic_settings)?.toBitmap()
AppCompatResources.getDrawable(context, R.drawable.mozac_ic_settings)?.apply {
colorFilter = createBlendModeColorFilterCompat(
context.getColorFromAttr(R.attr.primaryText),
SRC_IN
)
}?.toBitmap()
}

override suspend fun onInputChanged(text: String): List<AwesomeBar.Suggestion> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ClearableEditText @JvmOverloads constructor(
// lengthAfter has inconsistent behaviour when there are spaces in the entered text, so we'll use text.length.
val textLength = text?.length ?: 0
val drawable = if (shouldShowClearButton(textLength)) {
AppCompatResources.getDrawable(context, R.drawable.ic_clear)?.apply {
AppCompatResources.getDrawable(context, R.drawable.mozac_ic_clear)?.apply {
colorFilter = createBlendModeColorFilterCompat(context.getColorFromAttr(R.attr.primaryText), SRC_IN)
}
} else {
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/drawable/ic_add_to_homescreen.xml

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/res/drawable/ic_clear.xml

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/main/res/drawable/ic_help.xml

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/main/res/drawable/ic_home.xml

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/main/res/drawable/ic_settings.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/tracking_protection_item_height"
android:text="@string/etp_settings"
app:drawableStartCompat="@drawable/ic_settings"
app:drawableStartCompat="@drawable/mozac_ic_settings"
app:layout_constraintTop_toBottomOf="@id/line_divider" />
</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_edit_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
app:tint="@color/saved_login_clear_edit_text_tint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/inputLayoutUsername"
app:srcCompat="@drawable/ic_clear" />
app:srcCompat="@drawable/mozac_ic_clear" />

<TextView
android:id="@+id/passwordHeader"
Expand Down Expand Up @@ -223,5 +223,5 @@
app:tint="@color/saved_login_clear_edit_text_tint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/revealPasswordButton"
app:srcCompat="@drawable/ic_clear" />
app:srcCompat="@drawable/mozac_ic_clear" />
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
android:text="@string/mozac_feature_addons_settings"
android:textSize="16sp"
android:textColor="?primaryText"
app:drawableStartCompat="@drawable/ic_settings"
app:drawableStartCompat="@drawable/mozac_ic_settings"
app:drawableTint="?primaryText" />

<TextView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_pwa_onboarding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
app:layout_constraintEnd_toStartOf="@id/description"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_title"
app:srcCompat="@drawable/ic_add_to_homescreen" />
app:srcCompat="@drawable/mozac_ic_add_to_home_screen" />

<TextView
android:id="@+id/description"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ShortcutsSuggestionProviderTest {
every { getString(R.string.search_shortcuts_engine_settings) } returns "Search engine settings"
}

every { AppCompatResources.getDrawable(context, R.drawable.ic_settings) } returns null
every { AppCompatResources.getDrawable(context, R.drawable.mozac_ic_settings) } returns null
}

@After
Expand Down

0 comments on commit 83b752a

Please sign in to comment.