From 0fc3134f6c4108682bdd1e5db2d81517307e26fc Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Tue, 30 Jul 2019 12:50:50 -0400 Subject: [PATCH] [fenix] Closes https://github.com/mozilla-mobile/fenix/issues/4012 - Animate quick settings (https://github.com/mozilla-mobile/fenix/pull/4047) --- .../org/mozilla/fenix/settings/Extensions.kt | 8 +- .../mozilla/fenix/settings/PhoneFeature.kt | 8 +- .../quicksettings/QuickSettingsUIView.kt | 180 ++++++------------ .../TrackingProtectionSettingView.kt | 52 +++++ app/src/main/res/animator/fill_disable.xml | 13 ++ app/src/main/res/animator/fill_enable.xml | 13 ++ .../res/animator/strike_thru_mask_disable.xml | 13 ++ .../res/animator/strike_thru_mask_enable.xml | 13 ++ .../res/animator/strike_thru_path_disable.xml | 22 +++ .../res/animator/strike_thru_path_enable.xml | 22 +++ app/src/main/res/drawable/ic_camera.xml | 26 ++- .../res/drawable/ic_camera_anim_disable.xml | 11 ++ .../res/drawable/ic_camera_anim_enable.xml | 11 ++ .../main/res/drawable/ic_camera_disabled.xml | 28 ++- .../main/res/drawable/ic_camera_enabled.xml | 27 +++ app/src/main/res/drawable/ic_location.xml | 27 ++- .../res/drawable/ic_location_anim_disable.xml | 11 ++ .../res/drawable/ic_location_anim_enable.xml | 11 ++ .../res/drawable/ic_location_disabled.xml | 28 ++- .../main/res/drawable/ic_location_enabled.xml | 27 +++ app/src/main/res/drawable/ic_microphone.xml | 27 ++- .../drawable/ic_microphone_anim_disable.xml | 11 ++ .../drawable/ic_microphone_anim_enable.xml | 11 ++ .../res/drawable/ic_microphone_disabled.xml | 29 ++- .../res/drawable/ic_microphone_enabled.xml | 27 +++ app/src/main/res/drawable/ic_notification.xml | 13 -- .../main/res/drawable/ic_notifications.xml | 22 +++ .../ic_notifications_anim_disable.xml | 11 ++ .../drawable/ic_notifications_anim_enable.xml | 11 ++ .../drawable/ic_notifications_disabled.xml | 28 ++- .../res/drawable/ic_notifications_enabled.xml | 27 +++ .../res/drawable/ic_tracking_protection.xml | 27 ++- .../ic_tracking_protection_anim_disable.xml | 11 ++ .../ic_tracking_protection_anim_enable.xml | 11 ++ .../ic_tracking_protection_disabled.xml | 28 ++- .../ic_tracking_protection_enabled.xml | 27 +++ .../fragment_quick_settings_dialog_sheet.xml | 43 +++-- app/src/main/res/values/integers.xml | 8 + ...issions_details_exceptions_preferences.xml | 10 +- .../res/xml/site_permissions_preferences.xml | 10 +- 40 files changed, 698 insertions(+), 245 deletions(-) create mode 100644 app/src/main/java/org/mozilla/fenix/settings/quicksettings/TrackingProtectionSettingView.kt create mode 100644 app/src/main/res/animator/fill_disable.xml create mode 100644 app/src/main/res/animator/fill_enable.xml create mode 100644 app/src/main/res/animator/strike_thru_mask_disable.xml create mode 100644 app/src/main/res/animator/strike_thru_mask_enable.xml create mode 100644 app/src/main/res/animator/strike_thru_path_disable.xml create mode 100644 app/src/main/res/animator/strike_thru_path_enable.xml create mode 100644 app/src/main/res/drawable/ic_camera_anim_disable.xml create mode 100644 app/src/main/res/drawable/ic_camera_anim_enable.xml create mode 100644 app/src/main/res/drawable/ic_camera_enabled.xml create mode 100644 app/src/main/res/drawable/ic_location_anim_disable.xml create mode 100644 app/src/main/res/drawable/ic_location_anim_enable.xml create mode 100644 app/src/main/res/drawable/ic_location_enabled.xml create mode 100644 app/src/main/res/drawable/ic_microphone_anim_disable.xml create mode 100644 app/src/main/res/drawable/ic_microphone_anim_enable.xml create mode 100644 app/src/main/res/drawable/ic_microphone_enabled.xml delete mode 100644 app/src/main/res/drawable/ic_notification.xml create mode 100644 app/src/main/res/drawable/ic_notifications.xml create mode 100644 app/src/main/res/drawable/ic_notifications_anim_disable.xml create mode 100644 app/src/main/res/drawable/ic_notifications_anim_enable.xml create mode 100644 app/src/main/res/drawable/ic_notifications_enabled.xml create mode 100644 app/src/main/res/drawable/ic_tracking_protection_anim_disable.xml create mode 100644 app/src/main/res/drawable/ic_tracking_protection_anim_enable.xml create mode 100644 app/src/main/res/drawable/ic_tracking_protection_enabled.xml create mode 100644 app/src/main/res/values/integers.xml diff --git a/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt b/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt index 0e9c42e205..6a2e55ad3c 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/Extensions.kt @@ -8,10 +8,10 @@ import android.content.Context import android.view.View import android.widget.RadioButton import android.widget.TextView -import androidx.core.content.ContextCompat import androidx.core.text.HtmlCompat import mozilla.components.feature.sitepermissions.SitePermissions import mozilla.components.feature.sitepermissions.SitePermissionsRules +import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelative import org.mozilla.fenix.R import org.mozilla.fenix.ThemeManager @@ -104,11 +104,11 @@ fun PhoneFeature.getPreferenceKey(context: Context): String { */ fun RadioButton.setStartCheckedIndicator() { val attr = ThemeManager.resolveAttribute(android.R.attr.listChoiceIndicatorSingle, context) - val buttonDrawable = ContextCompat.getDrawable(context, attr) + val buttonDrawable = context.getDrawable(attr) buttonDrawable?.apply { - setBounds(0, 0, this.intrinsicWidth, this.intrinsicHeight) + setBounds(0, 0, intrinsicWidth, intrinsicHeight) } - setCompoundDrawablesRelative(buttonDrawable, null, null, null) + putCompoundDrawablesRelative(start = buttonDrawable) } fun initBlockedByAndroidView(phoneFeature: PhoneFeature, blockedByAndroidView: View) { diff --git a/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt b/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt index 95e752c37d..64cd2ada3d 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt @@ -24,13 +24,11 @@ enum class PhoneFeature(val id: Int, val androidPermissionsList: Array) MICROPHONE(ID_MICROPHONE_PERMISSION, arrayOf(RECORD_AUDIO)), NOTIFICATION(ID_NOTIFICATION_PERMISSION, emptyArray()); - @Suppress("SpreadOperator") fun isAndroidPermissionGranted(context: Context): Boolean { - val permissions = when (this) { - CAMERA, LOCATION, MICROPHONE -> androidPermissionsList - NOTIFICATION -> return true + return when (this) { + CAMERA, LOCATION, MICROPHONE -> context.isPermissionGranted(androidPermissionsList.asIterable()) + NOTIFICATION -> true } - return context.isPermissionGranted(*permissions) } fun getActionLabel(context: Context, sitePermissions: SitePermissions? = null, settings: Settings? = null): String { diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsUIView.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsUIView.kt index c5f0e07114..50c5bcd181 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsUIView.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsUIView.kt @@ -4,15 +4,16 @@ package org.mozilla.fenix.settings.quicksettings -import android.graphics.drawable.Drawable import android.view.View -import android.view.View.GONE -import android.view.View.VISIBLE import android.view.ViewGroup import android.widget.TextView -import androidx.appcompat.content.res.AppCompatResources +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.IdRes +import androidx.annotation.StringRes import androidx.core.content.ContextCompat import androidx.core.net.toUri +import androidx.core.view.isVisible import io.reactivex.Observable import io.reactivex.Observer import io.reactivex.functions.Consumer @@ -21,6 +22,7 @@ import mozilla.components.feature.sitepermissions.SitePermissions import mozilla.components.feature.sitepermissions.SitePermissions.Status.BLOCKED import mozilla.components.feature.sitepermissions.SitePermissions.Status.NO_DECISION import mozilla.components.support.ktx.android.net.hostWithoutCommonPrefixes +import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelativeWithIntrinsicBounds import org.mozilla.fenix.R import org.mozilla.fenix.mvi.UIView import org.mozilla.fenix.settings.PhoneFeature @@ -30,6 +32,8 @@ import org.mozilla.fenix.settings.PhoneFeature.MICROPHONE import org.mozilla.fenix.settings.PhoneFeature.NOTIFICATION import org.mozilla.fenix.utils.Settings +typealias LabelActionPair = Pair + @Suppress("TooManyFunctions") class QuickSettingsUIView( container: ViewGroup, @@ -40,8 +44,28 @@ class QuickSettingsUIView( container, actionEmitter, changesObservable ) { private val blockedByAndroidPhoneFeatures = mutableListOf() - private val context get() = view.context + private inline val context get() = view.context private val settings: Settings = Settings.getInstance(context) + private val trackingProtectionSettingView = TrackingProtectionSettingView(view, actionEmitter) + private val labelAndActions = mapOf( + CAMERA to findLabelActionPair(R.id.camera_icon, R.id.camera_action_label), + LOCATION to findLabelActionPair(R.id.location_icon, R.id.location_action_label), + MICROPHONE to findLabelActionPair(R.id.microphone_icon, R.id.microphone_action_label), + NOTIFICATION to findLabelActionPair(R.id.notification_icon, R.id.notification_action_label) + ) + + private val blockedByAndroidClickListener = View.OnClickListener { + val feature = it.tag as PhoneFeature + actionEmitter.onNext( + QuickSettingsAction.SelectBlockedByAndroid(feature.androidPermissionsList) + ) + } + private val togglePermissionClickListener = View.OnClickListener { + val feature = it.tag as PhoneFeature + actionEmitter.onNext( + QuickSettingsAction.TogglePermission(feature) + ) + } override fun updateView() = Consumer { state -> when (state.mode) { @@ -49,8 +73,7 @@ class QuickSettingsUIView( bindUrl(state.mode.url) bindSecurityInfo(state.mode.isSecured) bindReportSiteIssueAction(state.mode.url) - bindTrackingProtectionAction() - bindTrackingProtectionInfo(state.mode.isTrackingProtectionOn) + trackingProtectionSettingView.bind(state.mode.isTrackingProtectionOn) bindPhoneFeatureItem(CAMERA, state.mode.sitePermissions) bindPhoneFeatureItem(MICROPHONE, state.mode.sitePermissions) bindPhoneFeatureItem(NOTIFICATION, state.mode.sitePermissions) @@ -69,35 +92,6 @@ class QuickSettingsUIView( this.url.text = url.toUri().hostWithoutCommonPrefixes } - private fun bindTrackingProtectionInfo(isTrackingProtectionOn: Boolean) { - val globalTPSetting = Settings.getInstance(context).shouldUseTrackingProtection - val drawableId = - if (isTrackingProtectionOn) R.drawable.ic_tracking_protection else - R.drawable.ic_tracking_protection_disabled - val icon = AppCompatResources.getDrawable(context, drawableId) - tracking_protection.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null) - tracking_protection.isChecked = isTrackingProtectionOn - tracking_protection.isEnabled = globalTPSetting - - tracking_protection.setOnCheckedChangeListener { _, isChecked -> - actionEmitter.onNext( - QuickSettingsAction.ToggleTrackingProtection( - isChecked - ) - ) - } - } - - private fun bindTrackingProtectionAction() { - val globalTPSetting = Settings.getInstance(context).shouldUseTrackingProtection - tracking_protection_action.visibility = if (globalTPSetting) View.GONE else View.VISIBLE - tracking_protection_action.setOnClickListener { - actionEmitter.onNext( - QuickSettingsAction.SelectTrackingProtectionSettings - ) - } - } - private fun bindReportSiteIssueAction(url: String) { report_site_issue_action.setOnClickListener { actionEmitter.onNext( @@ -107,9 +101,9 @@ class QuickSettingsUIView( } private fun bindSecurityInfo(isSecured: Boolean) { - val stringId: Int - val drawableId: Int - val drawableTint: Int + @StringRes val stringId: Int + @DrawableRes val drawableId: Int + @ColorRes val drawableTint: Int if (isSecured) { stringId = R.string.quick_settings_sheet_secure_connection @@ -121,39 +115,29 @@ class QuickSettingsUIView( drawableTint = R.color.photonRed50 } - val icon = AppCompatResources.getDrawable(context, drawableId) + val icon = context.getDrawable(drawableId) icon?.setTint(ContextCompat.getColor(context, drawableTint)) security_info.setText(stringId) - security_info.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null) + security_info.putCompoundDrawablesRelativeWithIntrinsicBounds(start = icon) } private fun bindPhoneFeatureItem(phoneFeature: PhoneFeature, sitePermissions: SitePermissions? = null) { - if (phoneFeature.shouldBeHidden(sitePermissions)) { - hide(phoneFeature) - return - } - show(phoneFeature) - if (!phoneFeature.isAndroidPermissionGranted(context)) { - handleBlockedByAndroidAction(phoneFeature) - } else { - bindPhoneAction(phoneFeature, sitePermissions) + val (label, action) = labelAndActions.getValue(phoneFeature) + val shouldBeVisible = phoneFeature.shouldBeVisible(sitePermissions) + label.isVisible = shouldBeVisible + action.isVisible = shouldBeVisible + + if (shouldBeVisible) { + if (phoneFeature.isAndroidPermissionGranted(context)) { + bindPhoneAction(phoneFeature, sitePermissions) + } else { + handleBlockedByAndroidAction(phoneFeature) + } } } - private fun show(phoneFeature: PhoneFeature) { - val (label, action) = phoneFeature.labelAndAction - label.visibility = VISIBLE - action.visibility = VISIBLE - } - - private fun hide(phoneFeature: PhoneFeature) { - val (label, action) = phoneFeature.labelAndAction - label.visibility = GONE - action.visibility = GONE - } - - private fun PhoneFeature.shouldBeHidden(sitePermissions: SitePermissions?): Boolean { - return getStatus(sitePermissions, settings) == NO_DECISION + private fun PhoneFeature.shouldBeVisible(sitePermissions: SitePermissions?): Boolean { + return getStatus(sitePermissions, settings) != NO_DECISION } private fun PhoneFeature.isPermissionBlocked(sitePermissions: SitePermissions?): Boolean { @@ -161,25 +145,17 @@ class QuickSettingsUIView( } private fun handleBlockedByAndroidAction(phoneFeature: PhoneFeature) { - val (label, action) = phoneFeature.labelAndAction + val (label, action) = labelAndActions.getValue(phoneFeature) action.setText(R.string.phone_feature_blocked_by_android) action.tag = phoneFeature - action.setOnClickListener { - val feature = it.tag as PhoneFeature - actionEmitter.onNext( - QuickSettingsAction.SelectBlockedByAndroid( - feature.androidPermissionsList - ) - ) - } - label.setCompoundDrawablesWithIntrinsicBounds(phoneFeature.disabledIcon, null, null, null) + action.setOnClickListener(blockedByAndroidClickListener) label.isEnabled = false blockedByAndroidPhoneFeatures.add(phoneFeature) } private fun bindPhoneAction(phoneFeature: PhoneFeature, sitePermissions: SitePermissions? = null) { - val (label, action) = phoneFeature.labelAndAction + val (label, action) = labelAndActions.getValue(phoneFeature) action.text = phoneFeature.getActionLabel( context = context, @@ -188,63 +164,21 @@ class QuickSettingsUIView( ) action.tag = phoneFeature - action.setOnClickListener { - val feature = it.tag as PhoneFeature - actionEmitter.onNext( - QuickSettingsAction.TogglePermission(feature) - ) - } + action.setOnClickListener(togglePermissionClickListener) - val icon = if (phoneFeature.isPermissionBlocked(sitePermissions)) { - label.isEnabled = false - phoneFeature.disabledIcon - } else { - label.isEnabled = true - phoneFeature.enabledIcon - } - - label.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null) + label.isEnabled = !phoneFeature.isPermissionBlocked(sitePermissions) blockedByAndroidPhoneFeatures.remove(phoneFeature) } private fun checkFeaturesBlockedByAndroid(sitePermissions: SitePermissions?) { - val clonedList = blockedByAndroidPhoneFeatures.toTypedArray() - clonedList.forEach { phoneFeature -> + blockedByAndroidPhoneFeatures.forEach { phoneFeature -> if (phoneFeature.isAndroidPermissionGranted(context)) { bindPhoneAction(phoneFeature, sitePermissions) } } } - private val PhoneFeature.labelAndAction - get(): Pair { - return when (this) { - CAMERA -> camera_icon to camera_action_label - LOCATION -> location_icon to location_action_label - MICROPHONE -> microphone_icon to microphone_action_label - NOTIFICATION -> notification_icon to notification_action_label - } - } - - private val PhoneFeature.enabledIcon - get(): Drawable { - val drawableId = when (this) { - CAMERA -> R.drawable.ic_camera - LOCATION -> R.drawable.ic_location - MICROPHONE -> R.drawable.ic_microphone - NOTIFICATION -> R.drawable.ic_notification - } - return requireNotNull(AppCompatResources.getDrawable(context, drawableId)) - } - - private val PhoneFeature.disabledIcon - get(): Drawable { - val drawableId = when (this) { - CAMERA -> R.drawable.ic_camera_disabled - LOCATION -> R.drawable.ic_location_disabled - MICROPHONE -> R.drawable.ic_microphone_disabled - NOTIFICATION -> R.drawable.ic_notifications_disabled - } - return requireNotNull(AppCompatResources.getDrawable(context, drawableId)) - } + private fun findLabelActionPair(@IdRes labelId: Int, @IdRes actionId: Int): LabelActionPair { + return view.findViewById(labelId) to view.findViewById(actionId) + } } diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/TrackingProtectionSettingView.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/TrackingProtectionSettingView.kt new file mode 100644 index 0000000000..8e25fa27d4 --- /dev/null +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/TrackingProtectionSettingView.kt @@ -0,0 +1,52 @@ +/* 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/. */ + +package org.mozilla.fenix.settings.quicksettings + +import android.view.View +import android.widget.CompoundButton +import android.widget.Switch +import android.widget.TextView +import androidx.core.view.isVisible +import io.reactivex.Observer +import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelativeWithIntrinsicBounds +import org.mozilla.fenix.R +import org.mozilla.fenix.utils.Settings + +class TrackingProtectionSettingView( + container: View, + private val actionEmitter: Observer +) : View.OnClickListener, CompoundButton.OnCheckedChangeListener { + private val trackingProtectionSwitch: Switch = container.findViewById(R.id.tracking_protection) + private val trackingProtectionAction: TextView = container.findViewById(R.id.tracking_protection_action) + + init { + trackingProtectionSwitch.putCompoundDrawablesRelativeWithIntrinsicBounds( + start = container.context.getDrawable(R.drawable.ic_tracking_protection) + ) + } + + fun bind(isTrackingProtectionOn: Boolean) { + val globalTPSetting = Settings.getInstance(trackingProtectionSwitch.context).shouldUseTrackingProtection + + trackingProtectionAction.isVisible = !globalTPSetting + trackingProtectionAction.setOnClickListener(this) + + trackingProtectionSwitch.isChecked = isTrackingProtectionOn + trackingProtectionSwitch.isEnabled = globalTPSetting + trackingProtectionSwitch.setOnCheckedChangeListener(this) + } + + override fun onClick(view: View) { + actionEmitter.onNext( + QuickSettingsAction.SelectTrackingProtectionSettings + ) + } + + override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) { + actionEmitter.onNext( + QuickSettingsAction.ToggleTrackingProtection(isChecked) + ) + } +} diff --git a/app/src/main/res/animator/fill_disable.xml b/app/src/main/res/animator/fill_disable.xml new file mode 100644 index 0000000000..c0887a6ac5 --- /dev/null +++ b/app/src/main/res/animator/fill_disable.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/animator/fill_enable.xml b/app/src/main/res/animator/fill_enable.xml new file mode 100644 index 0000000000..52d745f775 --- /dev/null +++ b/app/src/main/res/animator/fill_enable.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/animator/strike_thru_mask_disable.xml b/app/src/main/res/animator/strike_thru_mask_disable.xml new file mode 100644 index 0000000000..09049a7b6b --- /dev/null +++ b/app/src/main/res/animator/strike_thru_mask_disable.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/animator/strike_thru_mask_enable.xml b/app/src/main/res/animator/strike_thru_mask_enable.xml new file mode 100644 index 0000000000..e45b8c6763 --- /dev/null +++ b/app/src/main/res/animator/strike_thru_mask_enable.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/animator/strike_thru_path_disable.xml b/app/src/main/res/animator/strike_thru_path_disable.xml new file mode 100644 index 0000000000..b56cca0e2b --- /dev/null +++ b/app/src/main/res/animator/strike_thru_path_disable.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/app/src/main/res/animator/strike_thru_path_enable.xml b/app/src/main/res/animator/strike_thru_path_enable.xml new file mode 100644 index 0000000000..8ea41146c1 --- /dev/null +++ b/app/src/main/res/animator/strike_thru_path_enable.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_camera.xml b/app/src/main/res/drawable/ic_camera.xml index e21aa8435b..00ef35e6ad 100644 --- a/app/src/main/res/drawable/ic_camera.xml +++ b/app/src/main/res/drawable/ic_camera.xml @@ -2,11 +2,21 @@ - - - + + + + + + + diff --git a/app/src/main/res/drawable/ic_camera_anim_disable.xml b/app/src/main/res/drawable/ic_camera_anim_disable.xml new file mode 100644 index 0000000000..8cf218a7dd --- /dev/null +++ b/app/src/main/res/drawable/ic_camera_anim_disable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_camera_anim_enable.xml b/app/src/main/res/drawable/ic_camera_anim_enable.xml new file mode 100644 index 0000000000..4cf33171aa --- /dev/null +++ b/app/src/main/res/drawable/ic_camera_anim_enable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_camera_disabled.xml b/app/src/main/res/drawable/ic_camera_disabled.xml index b14b293cc2..ce49afbc2f 100644 --- a/app/src/main/res/drawable/ic_camera_disabled.xml +++ b/app/src/main/res/drawable/ic_camera_disabled.xml @@ -3,11 +3,25 @@ - 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/. --> - + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + + + + + + + diff --git a/app/src/main/res/drawable/ic_camera_enabled.xml b/app/src/main/res/drawable/ic_camera_enabled.xml new file mode 100644 index 0000000000..7eead7c05a --- /dev/null +++ b/app/src/main/res/drawable/ic_camera_enabled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_location.xml b/app/src/main/res/drawable/ic_location.xml index 8c75cf47ae..a6fbc4b6db 100644 --- a/app/src/main/res/drawable/ic_location.xml +++ b/app/src/main/res/drawable/ic_location.xml @@ -2,12 +2,21 @@ - - - + + + + + + + diff --git a/app/src/main/res/drawable/ic_location_anim_disable.xml b/app/src/main/res/drawable/ic_location_anim_disable.xml new file mode 100644 index 0000000000..4664906a7e --- /dev/null +++ b/app/src/main/res/drawable/ic_location_anim_disable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_location_anim_enable.xml b/app/src/main/res/drawable/ic_location_anim_enable.xml new file mode 100644 index 0000000000..89b92fd4a2 --- /dev/null +++ b/app/src/main/res/drawable/ic_location_anim_enable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_location_disabled.xml b/app/src/main/res/drawable/ic_location_disabled.xml index f7071487b9..b7f85fa0a7 100644 --- a/app/src/main/res/drawable/ic_location_disabled.xml +++ b/app/src/main/res/drawable/ic_location_disabled.xml @@ -3,11 +3,25 @@ - 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/. --> - + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + + + + + + + diff --git a/app/src/main/res/drawable/ic_location_enabled.xml b/app/src/main/res/drawable/ic_location_enabled.xml new file mode 100644 index 0000000000..41270ef01c --- /dev/null +++ b/app/src/main/res/drawable/ic_location_enabled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_microphone.xml b/app/src/main/res/drawable/ic_microphone.xml index 261a61deca..e3d9712f56 100644 --- a/app/src/main/res/drawable/ic_microphone.xml +++ b/app/src/main/res/drawable/ic_microphone.xml @@ -2,12 +2,21 @@ - - - + + + + + + + diff --git a/app/src/main/res/drawable/ic_microphone_anim_disable.xml b/app/src/main/res/drawable/ic_microphone_anim_disable.xml new file mode 100644 index 0000000000..556580d5b6 --- /dev/null +++ b/app/src/main/res/drawable/ic_microphone_anim_disable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_microphone_anim_enable.xml b/app/src/main/res/drawable/ic_microphone_anim_enable.xml new file mode 100644 index 0000000000..bccb4de819 --- /dev/null +++ b/app/src/main/res/drawable/ic_microphone_anim_enable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_microphone_disabled.xml b/app/src/main/res/drawable/ic_microphone_disabled.xml index 7788b8a9b3..ffe797fc9c 100644 --- a/app/src/main/res/drawable/ic_microphone_disabled.xml +++ b/app/src/main/res/drawable/ic_microphone_disabled.xml @@ -3,12 +3,25 @@ - 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/. --> - + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + + + + + + + diff --git a/app/src/main/res/drawable/ic_microphone_enabled.xml b/app/src/main/res/drawable/ic_microphone_enabled.xml new file mode 100644 index 0000000000..148a6695d8 --- /dev/null +++ b/app/src/main/res/drawable/ic_microphone_enabled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_notification.xml b/app/src/main/res/drawable/ic_notification.xml deleted file mode 100644 index 7532157eef..0000000000 --- a/app/src/main/res/drawable/ic_notification.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_notifications.xml b/app/src/main/res/drawable/ic_notifications.xml new file mode 100644 index 0000000000..23fd8c1d06 --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_notifications_anim_disable.xml b/app/src/main/res/drawable/ic_notifications_anim_disable.xml new file mode 100644 index 0000000000..b54382c081 --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_anim_disable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_notifications_anim_enable.xml b/app/src/main/res/drawable/ic_notifications_anim_enable.xml new file mode 100644 index 0000000000..8f4aa3bdad --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_anim_enable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_notifications_disabled.xml b/app/src/main/res/drawable/ic_notifications_disabled.xml index db6e9b78f7..9c30ac7bdc 100644 --- a/app/src/main/res/drawable/ic_notifications_disabled.xml +++ b/app/src/main/res/drawable/ic_notifications_disabled.xml @@ -3,11 +3,25 @@ - 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/. --> - + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + + + + + + + diff --git a/app/src/main/res/drawable/ic_notifications_enabled.xml b/app/src/main/res/drawable/ic_notifications_enabled.xml new file mode 100644 index 0000000000..86447ec03f --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_enabled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_tracking_protection.xml b/app/src/main/res/drawable/ic_tracking_protection.xml index 8cfd085b72..ed41ca68e3 100644 --- a/app/src/main/res/drawable/ic_tracking_protection.xml +++ b/app/src/main/res/drawable/ic_tracking_protection.xml @@ -2,12 +2,21 @@ - - - + + + + + + + diff --git a/app/src/main/res/drawable/ic_tracking_protection_anim_disable.xml b/app/src/main/res/drawable/ic_tracking_protection_anim_disable.xml new file mode 100644 index 0000000000..14f17035dd --- /dev/null +++ b/app/src/main/res/drawable/ic_tracking_protection_anim_disable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_tracking_protection_anim_enable.xml b/app/src/main/res/drawable/ic_tracking_protection_anim_enable.xml new file mode 100644 index 0000000000..3080ef51bc --- /dev/null +++ b/app/src/main/res/drawable/ic_tracking_protection_anim_enable.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_tracking_protection_disabled.xml b/app/src/main/res/drawable/ic_tracking_protection_disabled.xml index 2dde72118a..1bdb069ad8 100644 --- a/app/src/main/res/drawable/ic_tracking_protection_disabled.xml +++ b/app/src/main/res/drawable/ic_tracking_protection_disabled.xml @@ -3,11 +3,25 @@ - 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/. --> - + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + + + + + + + diff --git a/app/src/main/res/drawable/ic_tracking_protection_enabled.xml b/app/src/main/res/drawable/ic_tracking_protection_enabled.xml new file mode 100644 index 0000000000..633271b15d --- /dev/null +++ b/app/src/main/res/drawable/ic_tracking_protection_enabled.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_quick_settings_dialog_sheet.xml b/app/src/main/res/layout/fragment_quick_settings_dialog_sheet.xml index 9e782d994e..9700c77093 100644 --- a/app/src/main/res/layout/fragment_quick_settings_dialog_sheet.xml +++ b/app/src/main/res/layout/fragment_quick_settings_dialog_sheet.xml @@ -20,22 +20,24 @@ + tools:text="https://wikipedia.org" + app:layout_constraintEnd_toEndOf="parent" /> + tools:text="Secure connection" + app:layout_constraintEnd_toEndOf="parent"/> + app:layout_constraintTop_toBottomOf="@id/line_divider" + app:layout_constraintEnd_toStartOf="@+id/camera_action_label"/> - + app:layout_constraintTop_toBottomOf="@id/camera_icon" + app:layout_constraintEnd_toStartOf="@+id/microphone_action_label"/> + app:layout_constraintTop_toBottomOf="@id/microphone_icon" + app:layout_constraintEnd_toStartOf="@+id/notification_action_label" /> + app:layout_constraintTop_toBottomOf="@id/notification_icon" + app:layout_constraintEnd_toStartOf="@+id/location_action_label"/> + + + 0 + 500 + diff --git a/app/src/main/res/xml/site_permissions_details_exceptions_preferences.xml b/app/src/main/res/xml/site_permissions_details_exceptions_preferences.xml index 0ba1929d31..7d76b2cb80 100644 --- a/app/src/main/res/xml/site_permissions_details_exceptions_preferences.xml +++ b/app/src/main/res/xml/site_permissions_details_exceptions_preferences.xml @@ -5,25 +5,25 @@ @@ -32,4 +32,4 @@ android:key="@string/pref_key_exceptions_clear_site_permissions" android:layout="@layout/layout_clear_permission_button"/> - \ No newline at end of file + diff --git a/app/src/main/res/xml/site_permissions_preferences.xml b/app/src/main/res/xml/site_permissions_preferences.xml index b6f24c3ba3..914ee7e863 100644 --- a/app/src/main/res/xml/site_permissions_preferences.xml +++ b/app/src/main/res/xml/site_permissions_preferences.xml @@ -15,27 +15,27 @@ app:iconSpaceReserved="false" app:allowDividerAbove="false"> - \ No newline at end of file +