Fixes existing lint errors

This commit is contained in:
ekager 2020-10-02 17:58:11 -07:00 committed by Michael Comella
parent aeb0205ea5
commit 4d348dd26a
34 changed files with 179 additions and 156 deletions

View File

@ -39,7 +39,7 @@ class TabCounter @JvmOverloads constructor(
counter_root.contentDescription = if (count == 1) {
context?.getString(R.string.open_tab_tray_single)
} else {
context?.getString(R.string.open_tab_tray_plural, count.toString())
String.format(context.getString(R.string.open_tab_tray_plural), count.toString())
}
}
@ -191,7 +191,8 @@ class TabCounter @JvmOverloads constructor(
ONE_DIGIT_SIZE_RATIO
}
val counterBoxWidth = context.resources.getDimensionPixelSize(R.dimen.tab_counter_box_width_height)
val counterBoxWidth =
context.resources.getDimensionPixelSize(R.dimen.tab_counter_box_width_height)
val textSize = newRatio * counterBoxWidth
counter_text.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize)
counter_text.setTypeface(null, Typeface.BOLD)

View File

@ -25,6 +25,7 @@ import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getStringWithArgSafe
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.theme.ThemeManager
import java.util.Locale
/**
* Builds the toolbar object used with the 3-dot menu in the custom tab browser fragment.
@ -121,7 +122,11 @@ class CustomTabToolbarMenu(
BrowserMenuDivider(),
menuToolbar
)
if (shouldReverseItems) { menuItems.reversed() } else { menuItems }
if (shouldReverseItems) {
menuItems.reversed()
} else {
menuItems
}
}
private val desktopMode = BrowserMenuImageSwitch(
@ -161,7 +166,8 @@ class CustomTabToolbarMenu(
}
private val poweredBy = BrowserMenuCategory(
label = context.getStringWithArgSafe(R.string.browser_menu_powered_by, appName).toUpperCase(),
label = context.getStringWithArgSafe(R.string.browser_menu_powered_by, appName)
.toUpperCase(Locale.getDefault()),
textSize = CAPTION_TEXT_SIZE,
textColorResource = primaryTextColor(),
textStyle = Typeface.NORMAL

View File

@ -24,8 +24,7 @@ class DataChoicesFragment : PreferenceFragmentCompat() {
super.onCreate(savedInstanceState)
val context = requireContext()
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) {
_, key ->
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) { _, key ->
if (key == getPreferenceKey(R.string.pref_key_telemetry)) {
if (context.settings().isTelemetryEnabled) {
context.components.analytics.metrics.start(MetricServiceType.Data)
@ -63,7 +62,10 @@ class DataChoicesFragment : PreferenceFragmentCompat() {
isChecked = context.settings().isMarketingTelemetryEnabled
val appName = context.getString(R.string.app_name)
summary = context.getString(R.string.preferences_marketing_data_description, appName)
summary = String.format(
context.getString(R.string.preferences_marketing_data_description),
appName
)
onPreferenceChangeListener = SharedPreferenceUpdater()
}

View File

@ -7,8 +7,6 @@ package org.mozilla.fenix.settings
import android.content.Context
import android.util.AttributeSet
import android.widget.ImageView
import androidx.core.content.res.TypedArrayUtils
import androidx.core.content.withStyledAttributes
import androidx.preference.PreferenceViewHolder
import org.mozilla.fenix.R
@ -32,29 +30,6 @@ class RadioButtonInfoPreference @JvmOverloads constructor(
init {
layoutResource = R.layout.preference_widget_radiobutton_with_info
context.withStyledAttributes(
attrs,
androidx.preference.R.styleable.Preference,
TypedArrayUtils.getAttr(
context,
androidx.preference.R.attr.preferenceStyle,
android.R.attr.preferenceStyle
),
0
) {
val defaultValue = when {
hasValue(androidx.preference.R.styleable.Preference_defaultValue) ->
getBoolean(androidx.preference.R.styleable.Preference_defaultValue, false)
hasValue(androidx.preference.R.styleable.Preference_android_defaultValue) ->
getBoolean(
androidx.preference.R.styleable.Preference_android_defaultValue,
false
)
else -> false
}
setDefaultValue(defaultValue)
}
}
override fun onBindViewHolder(holder: PreferenceViewHolder) {

View File

@ -403,8 +403,8 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
)
}
}
is LastSyncTime.Success -> getString(
R.string.sync_last_synced_summary,
is LastSyncTime.Success -> String.format(
getString(R.string.sync_last_synced_summary),
DateUtils.getRelativeTimeSpanString(state.lastSyncedDate.lastSync)
)
}

View File

@ -50,8 +50,10 @@ class SignOutFragment : BottomSheetDialogFragment() {
): View? {
accountManager = requireComponents.backgroundServices.accountManager
val view = inflater.inflate(R.layout.fragment_sign_out, container, false)
view.sign_out_message.text = view.context.getString(
R.string.sign_out_confirmation_message_2,
view.sign_out_message.text = String.format(
view.context.getString(
R.string.sign_out_confirmation_message_2
),
view.context.getString(R.string.app_name)
)
return view

View File

@ -155,8 +155,9 @@ class AddSearchEngineFragment : Fragment(R.layout.fragment_add_search_engine),
.map { it.toLowerCase(Locale.ROOT) }
if (existingIdentifiers.contains(name.toLowerCase(Locale.ROOT))) {
custom_search_engine_name_field.error = resources
.getString(R.string.search_add_custom_engine_error_existing_name, name)
custom_search_engine_name_field.error = String.format(
resources.getString(R.string.search_add_custom_engine_error_existing_name), name
)
hasError = true
}

View File

@ -85,6 +85,7 @@ class EditCustomSearchEngineFragment : Fragment(R.layout.fragment_add_search_eng
}
}
@Suppress("LongMethod")
private fun saveCustomEngine() {
custom_search_engine_name_field.error = ""
custom_search_engine_search_string_field.error = ""
@ -108,24 +109,30 @@ class EditCustomSearchEngineFragment : Fragment(R.layout.fragment_add_search_eng
val nameHasChanged = name != args.searchEngineIdentifier
if (existingIdentifiers.contains(name.toLowerCase(Locale.ROOT)) && nameHasChanged) {
custom_search_engine_name_field.error = resources
.getString(R.string.search_add_custom_engine_error_existing_name, name)
custom_search_engine_name_field.error = String.format(
resources
.getString(R.string.search_add_custom_engine_error_existing_name), name
)
hasError = true
}
if (searchString.isEmpty()) {
custom_search_engine_search_string_field
.error = resources.getString(R.string.search_add_custom_engine_error_empty_search_string)
.error =
resources.getString(R.string.search_add_custom_engine_error_empty_search_string)
hasError = true
}
if (!searchString.contains("%s")) {
custom_search_engine_search_string_field
.error = resources.getString(R.string.search_add_custom_engine_error_missing_template)
.error =
resources.getString(R.string.search_add_custom_engine_error_missing_template)
hasError = true
}
if (hasError) { return }
if (hasError) {
return
}
viewLifecycleOwner.lifecycleScope.launch(Main) {
val result = withContext(IO) {
@ -166,8 +173,4 @@ class EditCustomSearchEngineFragment : Fragment(R.layout.fragment_add_search_eng
}
}
}
companion object {
private const val DPS_TO_INCREASE = 20
}
}

View File

@ -581,7 +581,7 @@ class TabTrayView(
view.tab_layout.getTabAt(0)?.contentDescription = if (count == 1) {
view.context?.getString(R.string.open_tab_tray_single)
} else {
view.context?.getString(R.string.open_tab_tray_plural, count.toString())
String.format(view.context.getString(R.string.open_tab_tray_plural), count.toString())
}
view.tabsTray.accessibilityDelegate = object : View.AccessibilityDelegate() {

View File

@ -13,6 +13,7 @@
<ImageView
android:id="@android:id/icon"
android:importantForAccessibility="no"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"

View File

@ -3,30 +3,34 @@
- 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/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/custom_amo_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/customize_addon_collection_user_hint"
android:singleLine="true"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:textColor="?primaryText"/>
android:layout_marginEnd="16dp"
android:autofillHints="false"
android:hint="@string/customize_addon_collection_user_hint"
android:inputType="number"
android:singleLine="true"
android:textColor="?primaryText" />
<EditText
android:id="@+id/custom_amo_collection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/customize_addon_collection_hint"
android:singleLine="true"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:textColor="?primaryText"/>
android:autofillHints="false"
android:hint="@string/customize_addon_collection_hint"
android:inputType="text"
android:singleLine="true"
android:textColor="?primaryText" />
</LinearLayout>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
<?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/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -14,6 +15,7 @@
<Button
android:id="@+id/copy"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectableItemBackground"
@ -26,6 +28,7 @@
<Button
android:id="@+id/paste"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectableItemBackground"
@ -38,6 +41,7 @@
<Button
android:id="@+id/paste_and_go"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectableItemBackground"

View File

@ -35,7 +35,7 @@
android:layout_height="48dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/create_collection_close"
android:tint="@color/primary_text_dark_theme"
app:tint="@color/primary_text_dark_theme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_close" />

View File

@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:importantForAccessibility="no"
app:srcCompat="@drawable/ic_tab_collection"
android:tint="@null"
app:tint="@null"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -14,53 +14,55 @@
android:id="@+id/back_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:drawablePadding="8dp"
android:gravity="start|center_vertical"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="8dp"
android:paddingBottom="16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:drawableStartCompat="@drawable/mozac_ic_back"
android:drawablePadding="8dp"
app:drawableTint="@color/neutral_text"
android:gravity="start|center_vertical"
android:text="@string/create_collection_select_tabs"
android:textAppearance="@style/HeaderTextStyle"
android:textColor="@color/neutral_text"
android:textSize="20sp"
app:drawableStartCompat="@drawable/mozac_ic_back"
app:drawableTint="@color/neutral_text"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap"/>
app:layout_constraintWidth_default="wrap"
tools:ignore="ButtonStyleXmlDetector" />
<Button
android:id="@+id/select_all_button"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:fontFamily="@font/metropolis_bold"
android:gravity="start|center_vertical"
android:paddingStart="8dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="start|center_vertical"
android:text="@string/create_collection_select_all"
android:textAllCaps="false"
android:textColor="@color/neutral_text"
android:textSize="16sp"
android:fontFamily="@font/metropolis_bold"
app:layout_constraintBottom_toBottomOf="@id/back_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="@id/back_button"
app:layout_constraintWidth_default="wrap"/>
app:layout_constraintWidth_default="wrap"
tools:ignore="ButtonStyleXmlDetector" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
app:layout_constraintGuide_percent="0.5" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/collections_list"
@ -106,8 +108,8 @@
android:layout_width="match_parent"
android:layout_height="102dp"
android:background="@drawable/simple_dark_grey_gradient"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="false"/>
android:focusable="false"
app:layout_constraintBottom_toBottomOf="parent" />
<EditText
android:id="@+id/name_collection_edittext"
@ -117,6 +119,7 @@
android:autofillHints="false"
android:background="?foundation"
android:focusedByDefault="true"
android:hint="@string/collection_name_hint"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="textCapSentences"
@ -136,9 +139,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:foreground="@drawable/rounded_ripple"
android:background="@drawable/add_tabs_to_collection_background"
android:clipToPadding="false"
android:foreground="@drawable/rounded_ripple"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
@ -147,24 +150,24 @@
android:id="@+id/bottom_bar_icon_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/create_collection_close"
app:srcCompat="@drawable/mozac_ic_close"
android:tint="?neutral"
android:padding="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/mozac_ic_close"
app:tint="?neutral" />
<TextView
android:id="@+id/bottom_bar_text"
android:layout_width="0dp"
android:layout_height="0dp"
android:fontFamily="@font/metropolis_semibold"
android:gravity="center_vertical"
android:text="@string/create_collection_save_to_collection_empty"
android:textColor="?neutral"
android:textSize="16sp"
android:fontFamily="@font/metropolis_semibold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/save_button"
app:layout_constraintStart_toEndOf="@id/bottom_bar_icon_button"

View File

@ -16,16 +16,17 @@
android:layout_height="0dp"
android:layout_margin="16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:drawableStartCompat="@drawable/mozac_ic_back"
android:drawablePadding="8dp"
app:drawableTint="@color/neutral_text"
android:gravity="start|center_vertical"
android:text="@string/create_collection_name_collection"
android:textAppearance="@style/HeaderTextStyle"
android:textColor="@color/neutral_text"
android:textSize="20sp"
app:drawableStartCompat="@drawable/mozac_ic_back"
app:drawableTint="@color/neutral_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ButtonStyleXmlDetector" />
<Button
android:id="@+id/select_all_button"
@ -40,7 +41,8 @@
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ButtonStyleXmlDetector" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/collections_list"
@ -60,6 +62,7 @@
android:autofillHints="false"
android:background="?foundation"
android:focusedByDefault="true"
android:hint="@string/collection_name_hint"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="textCapSentences"
@ -121,11 +124,11 @@
android:layout_margin="16dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/create_collection_close"
app:srcCompat="@drawable/mozac_ic_close"
android:tint="?neutral"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/mozac_ic_close"
app:tint="?neutral" />
<TextView
android:id="@+id/bottom_bar_text"
@ -154,6 +157,7 @@
android:textColor="?neutral"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ButtonStyleXmlDetector" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -16,16 +16,17 @@
android:layout_height="0dp"
android:layout_margin="16dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:drawableStartCompat="@drawable/mozac_ic_back"
android:drawablePadding="8dp"
android:gravity="start|center_vertical"
app:drawableTint="@color/neutral_text"
android:text="@string/create_collection_select_collection"
android:textAppearance="@style/HeaderTextStyle"
android:textColor="@color/neutral_text"
android:textSize="20sp"
app:drawableStartCompat="@drawable/mozac_ic_back"
app:drawableTint="@color/neutral_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ButtonStyleXmlDetector" />
<Button
android:id="@+id/select_all_button"
@ -40,7 +41,8 @@
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ButtonStyleXmlDetector" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/collections_list"
@ -64,6 +66,7 @@
android:autofillHints="false"
android:background="?foundation"
android:focusedByDefault="true"
android:hint="@string/collection_name_hint"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="textCapSentences"
@ -124,12 +127,12 @@
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_new"
android:tint="?neutral"
android:importantForAccessibility="no"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_new"
app:tint="?neutral" />
<TextView
android:id="@+id/bottom_bar_text"
@ -137,10 +140,10 @@
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/metropolis"
android:gravity="center_vertical"
android:singleLine="true"
android:text="@string/create_collection_add_new_collection"
android:fontFamily="@font/metropolis"
android:textColor="?neutral"
android:textSize="16sp"
android:textStyle="bold"
@ -161,6 +164,7 @@
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ButtonStyleXmlDetector" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -18,10 +18,10 @@
android:layout_marginTop="8dp"
android:importantForAccessibility="no"
android:scaleType="center"
android:tint="?primaryText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/mozac_feature_download_ic_download_complete" />
app:srcCompat="@drawable/mozac_feature_download_ic_download_complete"
app:tint="?primaryText" />
<TextView
android:id="@+id/download_dialog_title"
@ -48,10 +48,10 @@
android:layout_height="50dp"
android:background="@null"
android:contentDescription="@string/mozac_feature_downloads_button_close"
android:tint="?primaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/mozac_ic_close" />
app:srcCompat="@drawable/mozac_ic_close"
app:tint="?primaryText" />
<TextView
android:id="@+id/download_dialog_filename"
@ -69,6 +69,7 @@
<Button
android:id="@+id/download_dialog_action_button"
style="@style/PositiveButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
@ -76,9 +77,9 @@
android:layout_marginBottom="8dp"
android:background="@drawable/rounded_all_corners"
android:backgroundTint="?accent"
android:padding="16dp"
android:text="@string/mozac_feature_downloads_button_open"
android:textAllCaps="false"
android:padding="16dp"
android:textColor="?contrastText"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -55,6 +55,7 @@
app:layout_constraintWidth_percent="0.9" />
<Button
style="@style/PositiveButton"
android:id="@+id/restoreTabButton"
android:layout_width="0dp"
android:layout_height="48dp"
@ -66,7 +67,6 @@
android:fontFamily="Sharp Sans"
android:text="@string/tab_crash_restore"
android:textAllCaps="false"
android:textColor="?contrastText"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
@ -74,6 +74,7 @@
app:layout_constraintWidth_percent="0.4" />
<Button
style="@style/NeutralButton"
android:id="@+id/closeTabButton"
android:layout_width="0dp"
android:layout_height="48dp"

View File

@ -26,7 +26,7 @@
android:layout_marginBottom="8dp"
android:importantForAccessibility="no"
app:srcCompat="@drawable/ic_tab_collection"
android:tint="@null"
app:tint="@null"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="parent"/>

View File

@ -25,7 +25,9 @@
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:autofillHints="false"
android:backgroundTint="?neutral"
android:hint="@string/collection_name_hint"
android:inputType="textCapSentences"
android:singleLine="true"
android:textAlignment="viewStart" />

View File

@ -23,6 +23,7 @@
<Button
android:id="@+id/fxa_sign_in_button"
style="@style/NeutralButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
@ -37,5 +38,4 @@
android:textSize="14sp"
android:textStyle="bold"
app:backgroundTint="@color/onboarding_card_button_background_dark" />
</LinearLayout>

View File

@ -57,9 +57,9 @@
android:id="@+id/vertical_divider"
android:layout_width="1dp"
android:layout_height="0dp"
android:background="?neutralFaded"
android:paddingStart="1dp"
android:paddingEnd="1dp"
android:background="?neutralFaded"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/info_button"
app:layout_constraintStart_toEndOf="@+id/title"
@ -71,11 +71,12 @@
android:layout_height="48dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:contentDescription="@string/radio_preference_info_content_description"
android:padding="12dp"
app:srcCompat="@drawable/ic_info"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/vertical_divider"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_info" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -2,21 +2,21 @@
<!-- 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/. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@id/button_search_widget_new_tab"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/rounded_search_widget_background"
android:layout_gravity="center">
android:layout_gravity="center"
android:background="@drawable/rounded_search_widget_background">
<ImageView
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:contentDescription="@string/search_widget_content_description"
android:scaleType="centerInside"
tools:src="@drawable/ic_launcher_foreground"
android:layout_gravity="center"/>
tools:src="@drawable/ic_launcher_foreground" />
</FrameLayout>

View File

@ -2,20 +2,20 @@
<!-- 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/. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@id/button_search_widget_new_tab"
android:layout_width="64dp"
android:layout_height="50dp"
android:background="@drawable/rounded_search_widget_background"
android:layout_gravity="center">
xmlns:tools="http://schemas.android.com/tools"
android:id="@id/button_search_widget_new_tab"
android:layout_width="64dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:background="@drawable/rounded_search_widget_background">
<ImageView
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="centerInside"
tools:src="@drawable/ic_launcher_foreground"
android:layout_gravity="center"/>
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:contentDescription="@string/search_widget_content_description"
android:scaleType="centerInside"
tools:src="@drawable/ic_launcher_foreground" />
</FrameLayout>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
<?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/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -11,33 +11,33 @@
<ImageView
android:id="@+id/button_search_widget_new_tab_icon"
android:contentDescription="@string/browser_menu_new_tab"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentStart="true"
android:contentDescription="@string/search_widget_content_description"
android:scaleType="centerInside" />
<TextView
android:id="@+id/button_search_widget_new_tab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignEnd="@id/button_search_widget_voice"
android:layout_marginStart="9dp"
android:layout_toEndOf="@id/button_search_widget_new_tab_icon"
android:layout_alignEnd="@id/button_search_widget_voice"
android:gravity="start|center_vertical"
android:letterSpacing="-0.025"
android:textAlignment="viewStart"
android:textColor="@color/search_widget_text"
android:textSize="15sp"
tools:text="Search the web"/>
tools:text="Search the web" />
<ImageButton
android:id="@+id/button_search_widget_voice"
android:contentDescription="@string/search_widget_voice"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="1dp"
android:background="@drawable/ic_microphone_widget_padded" />
android:background="@drawable/ic_microphone_widget_padded"
android:contentDescription="@string/search_widget_voice" />
</RelativeLayout>

View File

@ -11,7 +11,7 @@
<ImageView
android:id="@+id/button_search_widget_new_tab_icon"
android:contentDescription="@string/browser_menu_new_tab"
android:contentDescription="@string/search_widget_content_description"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentStart="true"

View File

@ -3,9 +3,9 @@
- 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/. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="100dp"
android:layout_height="50dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/rounded_search_widget_background"
android:orientation="horizontal">
@ -13,13 +13,15 @@
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:contentDescription="@string/search_widget_content_description"
android:scaleType="centerInside" />
<ImageView
android:id="@+id/button_search_widget_voice"
android:layout_width="50dp"
android:layout_height="50dp"
android:contentDescription="@string/search_widget_voice"
android:padding="10dp"
app:srcCompat="@drawable/ic_microphone_widget"
android:scaleType="centerInside" />
android:scaleType="centerInside"
app:srcCompat="@drawable/ic_microphone_widget" />
</LinearLayout>

View File

@ -2,18 +2,18 @@
<!-- 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/. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/button_search_widget_new_tab"
android:layout_width="100dp"
android:layout_height="50dp"
android:background="@drawable/rounded_search_widget_background"
android:layout_gravity="center"
android:orientation="vertical">
android:id="@id/button_search_widget_new_tab"
android:layout_width="100dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:background="@drawable/rounded_search_widget_background"
android:orientation="vertical">
<ImageView
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"/>
android:id="@+id/button_search_widget_new_tab_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:contentDescription="@string/search_widget_content_description" />
</FrameLayout>

View File

@ -39,7 +39,7 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/tabs_menu_close_all_tabs"
app:srcCompat="@drawable/ic_delete"
android:tint="?primaryText"
app:tint="?primaryText"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tabs_overflow_button"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -77,7 +77,7 @@
android:layout_marginStart="12dp"
android:paddingBottom="12dp"
android:importantForAccessibility="no"
android:tint="@color/primary_text_dark_theme"
app:tint="@color/primary_text_dark_theme"
app:layout_constraintBottom_toBottomOf="@id/learn_more"
app:layout_constraintStart_toEndOf="@id/learn_more"
app:layout_constraintTop_toTopOf="@id/learn_more"

View File

@ -11,7 +11,7 @@
<TextView
style="@style/Header16TextStyle"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="60dp"

View File

@ -211,6 +211,8 @@
<string name="search_suggestions_onboarding_learn_more_link">Learn more</string>
<!-- Search Widget -->
<!-- Content description for searching with a widget. Firefox is intentionally hardcoded.-->
<string name="search_widget_content_description">Open a new Firefox tab</string>
<!-- Text preview for smaller sized widgets -->
<string name="search_widget_text_short">Search</string>
<!-- Text preview for larger sized widgets -->
@ -615,6 +617,8 @@
<string name="collection_rename">Rename collection</string>
<!-- Text for the button to open tabs of the selected collection -->
<string name="collection_open_tabs">Open tabs</string>
<!-- Hint for adding name of a collection -->
<string name="collection_name_hint">Collection name</string>
<!-- Text for the menu button to remove a top site -->
<string name="remove_top_site">Remove</string>
<!-- Text for the menu button to delete a top site from history -->
@ -1587,6 +1591,9 @@
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_firefox_account_header">Get the most out of %s.</string>
<!-- Content description radio buttons with a link to more information -->
<string name="radio_preference_info_content_description">Click for more details</string>
<!-- Deprecated: No Open Tabs Message Header -->
<string name="no_collections_header1">Collect the things that matter to you</string>
<!-- Deprecated: Label to describe what collections are to a new user without any collections -->

View File

@ -5,6 +5,7 @@
package org.mozilla.fenix.lintrules
import com.android.SdkConstants
import com.android.SdkConstants.ATTR_STYLE
import com.android.resources.ResourceFolderType
import com.android.tools.lint.detector.api.Category
import com.android.tools.lint.detector.api.Implementation
@ -20,8 +21,6 @@ import org.w3c.dom.Element
*/
class ButtonStyleXmlDetector : ResourceXmlDetector() {
companion object {
const val SCHEMA = "http://schemas.android.com/apk/res-auto"
const val ERROR_MESSAGE =
"All buttons must have a style, try using NeutralButton or similar."
@ -53,7 +52,7 @@ class ButtonStyleXmlDetector : ResourceXmlDetector() {
}
override fun visitElement(context: XmlContext, element: Element) {
if (element.hasAttributeNS(SCHEMA, SdkConstants.ATTR_STYLE)) { return }
if (element.hasAttribute(ATTR_STYLE)) { return }
context.report(
issue = ISSUE_XML_STYLE,