diff --git a/app/src/main/java/org/mozilla/fenix/trackingprotection/SwitchWithDescription.kt b/app/src/main/java/org/mozilla/fenix/trackingprotection/SwitchWithDescription.kt index e0123de74..2f5c17164 100644 --- a/app/src/main/java/org/mozilla/fenix/trackingprotection/SwitchWithDescription.kt +++ b/app/src/main/java/org/mozilla/fenix/trackingprotection/SwitchWithDescription.kt @@ -11,8 +11,6 @@ import androidx.appcompat.content.res.AppCompatResources import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.withStyledAttributes import kotlinx.android.synthetic.main.switch_with_description.view.* -import kotlinx.android.synthetic.main.tracking_protection_category.view.switchItemDescription -import kotlinx.android.synthetic.main.tracking_protection_category.view.switchItemTitle import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelativeWithIntrinsicBounds import org.mozilla.fenix.R @@ -36,13 +34,13 @@ class SwitchWithDescription @JvmOverloads constructor( id ) ) - switchItemTitle.text = resources.getString( + trackingProtectionCategoryTitle.text = resources.getString( getResourceId( R.styleable.SwitchWithDescription_switchTitle, R.string.preference_enhanced_tracking_protection ) ) - switchItemDescription.text = resources.getString( + trackingProtectionCategoryItemDescription.text = resources.getString( getResourceId( R.styleable.SwitchWithDescription_switchDescription, R.string.preference_enhanced_tracking_protection_explanation diff --git a/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionCategoryItem.kt b/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionCategoryItem.kt index 41abe8749..1f42a5a6c 100644 --- a/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionCategoryItem.kt +++ b/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionCategoryItem.kt @@ -30,14 +30,14 @@ class TrackingProtectionCategoryItem @JvmOverloads constructor( R.styleable.TrackingProtectionCategory_categoryItemIcon, R.drawable.ic_cryptominers ) - switchIcon?.background = resources.getDrawable(id, context.theme) - switchItemTitle?.text = resources.getString( + trackingProtectionCategoryIcon?.background = resources.getDrawable(id, context.theme) + trackingProtectionCategoryTitle?.text = resources.getString( getResourceId( R.styleable.TrackingProtectionCategory_categoryItemTitle, R.string.etp_cookies_title ) ) - switchItemDescription?.text = resources.getString( + trackingProtectionCategoryItemDescription?.text = resources.getString( getResourceId( R.styleable.TrackingProtectionCategory_categoryItemDescription, R.string.etp_cookies_description diff --git a/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelView.kt b/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelView.kt index a4be4c941..898afca5c 100644 --- a/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelView.kt +++ b/app/src/main/java/org/mozilla/fenix/trackingprotection/TrackingProtectionPanelView.kt @@ -162,7 +162,7 @@ class TrackingProtectionPanelView( } private fun bindTrackingProtectionInfo(isTrackingProtectionOn: Boolean) { - trackingProtectionSwitch.switchItemDescription.text = + trackingProtectionSwitch.trackingProtectionCategoryItemDescription.text = view.context.getString(if (isTrackingProtectionOn) R.string.etp_panel_on else R.string.etp_panel_off) trackingProtectionSwitch.switch_widget.isChecked = isTrackingProtectionOn trackingProtectionSwitch.switch_widget.jumpDrawablesToCurrentState() diff --git a/app/src/main/res/layout/switch_with_description.xml b/app/src/main/res/layout/switch_with_description.xml index e841dc5f5..6366a204b 100644 --- a/app/src/main/res/layout/switch_with_description.xml +++ b/app/src/main/res/layout/switch_with_description.xml @@ -10,7 +10,7 @@ @@ -48,7 +48,7 @@ android:layout_marginStart="@dimen/library_item_icon_margin_horizontal" android:layout_marginEnd="@dimen/library_item_icon_margin_horizontal" app:drawableStartCompat="@drawable/ic_tracking_protection" - app:layout_constraintBottom_toBottomOf="@id/switchItemDescription" + app:layout_constraintBottom_toBottomOf="@id/trackingProtectionCategoryItemDescription" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="@id/switchItemTitle" /> + app:layout_constraintTop_toTopOf="@id/trackingProtectionCategoryTitle" /> diff --git a/app/src/main/res/layout/tracking_protection_category.xml b/app/src/main/res/layout/tracking_protection_category.xml index b5f06c576..e3a832192 100644 --- a/app/src/main/res/layout/tracking_protection_category.xml +++ b/app/src/main/res/layout/tracking_protection_category.xml @@ -10,7 +10,7 @@ tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">