diff --git a/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsActivity.kt b/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsActivity.kt index 9fe52cfa115f..7f9d87063a04 100644 --- a/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsActivity.kt +++ b/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsActivity.kt @@ -34,9 +34,9 @@ import com.duckduckgo.common.ui.view.listitem.TwoLineListItem import com.duckduckgo.common.ui.viewbinding.viewBinding import com.duckduckgo.common.utils.notification.checkPermissionAndNotify import com.duckduckgo.di.scopes.ActivityScope +import javax.inject.Inject import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach -import javax.inject.Inject @InjectWith(ActivityScope::class) class NotificationsActivity : DuckDuckGoActivity() { @@ -74,7 +74,6 @@ class NotificationsActivity : DuckDuckGoActivity() { private fun render(viewState: ViewState) { viewState.notificationItems.forEach { notificationItem -> TwoLineListItem(this).apply { - setPrimaryText(notificationItem.title) setSecondaryText(notificationItem.subtitle) setOnClickListener { @@ -88,7 +87,7 @@ class NotificationsActivity : DuckDuckGoActivity() { private fun addNotification( id: Int, - notification: Notification + notification: Notification, ) { NotificationManagerCompat.from(this) .checkPermissionAndNotify(context = this, id = id, notification = notification) diff --git a/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsViewModel.kt b/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsViewModel.kt index f5ce059426b1..275a73d5270b 100644 --- a/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsViewModel.kt +++ b/app/src/internal/java/com/duckduckgo/app/dev/settings/notifications/NotificationsViewModel.kt @@ -56,7 +56,7 @@ class NotificationViewModel @Inject constructor( val id: Int, val title: String, val subtitle: String, - val notification: Notification + val notification: Notification, ) } diff --git a/app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt b/app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt index 8fe4ad35f5d6..820a482f3a24 100644 --- a/app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt @@ -531,7 +531,7 @@ open class BrowserActivity : DuckDuckGoActivity() { } fun launchSettings() { - if(settings.isNewSettingsEnabled) { + if (settings.isNewSettingsEnabled) { globalActivityStarter.start(this, NewSettingsScreenNoParams) } else { startActivity(SettingsActivity.intent(this)) diff --git a/app/src/main/java/com/duckduckgo/app/global/shortcut/AppShortcutCreator.kt b/app/src/main/java/com/duckduckgo/app/global/shortcut/AppShortcutCreator.kt index 76596f441b08..7856e3e5b4e3 100644 --- a/app/src/main/java/com/duckduckgo/app/global/shortcut/AppShortcutCreator.kt +++ b/app/src/main/java/com/duckduckgo/app/global/shortcut/AppShortcutCreator.kt @@ -33,7 +33,6 @@ import com.duckduckgo.app.settings.NewSettingsActivity import com.duckduckgo.app.settings.SettingsActivity import com.duckduckgo.appbuildconfig.api.AppBuildConfig import com.duckduckgo.appbuildconfig.api.isInternalBuild -import com.duckduckgo.browser.api.ui.BrowserScreens.NewSettingsScreenNoParams import com.duckduckgo.common.ui.themepreview.ui.AppComponentsActivity import com.duckduckgo.common.utils.DispatcherProvider import com.duckduckgo.di.scopes.AppScope @@ -142,9 +141,9 @@ class AppShortcutCreator @Inject constructor( private fun buildAndroidDesignSystemShortcut(context: Context): ShortcutInfo { val browserActivity = BrowserActivity.intent(context).also { it.action = Intent.ACTION_VIEW } - val settingsActivity = if(settings.isNewSettingsEnabled) { + val settingsActivity = if (settings.isNewSettingsEnabled) { NewSettingsActivity.intent(context).also { it.action = Intent.ACTION_VIEW } - }else { + } else { SettingsActivity.intent(context).also { it.action = Intent.ACTION_VIEW } } val adsActivity = AppComponentsActivity.intent(context).also { it.action = Intent.ACTION_VIEW } diff --git a/app/src/main/java/com/duckduckgo/app/notification/model/ClearDataNotification.kt b/app/src/main/java/com/duckduckgo/app/notification/model/ClearDataNotification.kt index 9804b881fe91..f3691eaf0572 100644 --- a/app/src/main/java/com/duckduckgo/app/notification/model/ClearDataNotification.kt +++ b/app/src/main/java/com/duckduckgo/app/notification/model/ClearDataNotification.kt @@ -33,9 +33,9 @@ import com.duckduckgo.app.statistics.pixels.Pixel import com.duckduckgo.browser.api.ui.BrowserScreens.NewSettingsScreenNoParams import com.duckduckgo.common.utils.DispatcherProvider import com.duckduckgo.di.scopes.AppScope +import com.duckduckgo.mobile.android.R as CommonR import com.duckduckgo.navigation.api.GlobalActivityStarter import com.duckduckgo.settings.api.Settings -import com.duckduckgo.mobile.android.R as CommonR import com.squareup.anvil.annotations.ContributesMultibinding import javax.inject.Inject import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt index c86fef91f57d..a2511bf77f0e 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt @@ -73,7 +73,6 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import timber.log.Timber - @InjectWith(ActivityScope::class) @ContributeToActivityStarter(NewSettingsScreenNoParams::class, screenName = "newSettings") class NewSettingsActivity : DuckDuckGoActivity() { @@ -271,7 +270,9 @@ class NewSettingsActivity : DuckDuckGoActivity() { viewsPrivacy.cookiePopupProtectionSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.cookiePopupProtectionEnabled)) viewsPrivacy.cookiePopupProtectionSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) } else { - viewsPrivacy.cookiePopupProtectionSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.cookiePopupProtectionDescription)) + viewsPrivacy.cookiePopupProtectionSetting.setSecondaryText( + getString(com.duckduckgo.app.browser.R.string.cookiePopupProtectionDescription), + ) viewsPrivacy.cookiePopupProtectionSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) } } diff --git a/app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherActivity.kt b/app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherActivity.kt index 8c6e40a06c0c..df48d24dbed1 100644 --- a/app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherActivity.kt @@ -467,7 +467,7 @@ class TabSwitcherActivity : DuckDuckGoActivity(), TabSwitcherListener, Coroutine } private fun showSettings() { - if(settings.isNewSettingsEnabled) { + if (settings.isNewSettingsEnabled) { globalActivityStarter.start(this, NewSettingsScreenNoParams) } else { startActivity(SettingsActivity.intent(this)) diff --git a/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/notification/NetPDisabledNotificationBuilder.kt b/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/notification/NetPDisabledNotificationBuilder.kt index fc76be3835ae..ebc17676f0fb 100644 --- a/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/notification/NetPDisabledNotificationBuilder.kt +++ b/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/notification/NetPDisabledNotificationBuilder.kt @@ -181,7 +181,7 @@ class RealNetPDisabledNotificationBuilder @Inject constructor( override fun buildVpnAccessRevokedNotification(context: Context): Notification { registerChannel(context) - val intent = if(settings.isNewSettingsEnabled) { + val intent = if (settings.isNewSettingsEnabled) { globalActivityStarter.startIntent(context, NewSettingsScreenNoParams) } else { globalActivityStarter.startIntent(context, SettingsScreenNoParams) diff --git a/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/UpdatedSettingsFeature.kt b/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/UpdatedSettingsFeature.kt index 99fddcf40f0c..ae9090765d23 100644 --- a/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/UpdatedSettingsFeature.kt +++ b/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/UpdatedSettingsFeature.kt @@ -25,7 +25,7 @@ import com.duckduckgo.feature.toggles.api.Toggle.DefaultValue scope = AppScope::class, featureName = "updatedSettings", ) -interface UpdatedSettingsFeature{ +interface UpdatedSettingsFeature { @DefaultValue(false) fun self(): Toggle diff --git a/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/store/RealSettings.kt b/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/store/RealSettings.kt index 7526326ae498..6fefeca5be70 100644 --- a/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/store/RealSettings.kt +++ b/settings/settings-impl/src/main/java/com/duckduckgo/settings/impl/store/RealSettings.kt @@ -27,7 +27,7 @@ import javax.inject.Inject @SingleInstanceIn(AppScope::class) class RealSettings @Inject constructor( private val updatedSettingsFeature: UpdatedSettingsFeature, -): Settings { +) : Settings { override val isNewSettingsEnabled: Boolean get() = updatedSettingsFeature.self().isEnabled() diff --git a/subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/RealSubscriptions.kt b/subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/RealSubscriptions.kt index 9d45f7510ac8..d388a8f2b813 100644 --- a/subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/RealSubscriptions.kt +++ b/subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/RealSubscriptions.kt @@ -179,7 +179,7 @@ class PrivacyProFeatureStore @Inject constructor( private fun SharedPreferences.save( key: String, - state: State + state: State, ) { coroutineScope.launch(dispatcherProvider.io()) { edit(commit = true) { putString(key, stateAdapter.toJson(state)) }