Skip to content

Commit

Permalink
Standardize common-ui namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
joshliebe committed Nov 7, 2023
1 parent ada67d2 commit 251fdbf
Show file tree
Hide file tree
Showing 547 changed files with 2,095 additions and 2,033 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ class ContributeToActivityStarterCodeGenerator : CodeGenerator {
private val paramToActivityMapperFqName = FqName("com.duckduckgo.navigation.api.GlobalActivityStarter.ParamToActivityMapper")
private val activityParamsFqName = FqName("com.duckduckgo.navigation.api.GlobalActivityStarter.ActivityParams")
private val appCompatActivityFqName = FqName("androidx.appcompat.app.AppCompatActivity")
private val duckduckgoActivityFqName = FqName("com.duckduckgo.app.global.DuckDuckGoActivity")
private val duckduckgoActivityFqName = FqName("com.duckduckgo.common.ui.DuckDuckGoActivity")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.duckduckgo.app.global.extensions.safeGetApplicationIcon
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.view.quietlySetIsChecked
import com.duckduckgo.mobile.android.ui.view.show
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.view.quietlySetIsChecked
import com.duckduckgo.common.ui.view.show
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.apps.AppsProtectionType
import com.duckduckgo.mobile.android.vpn.apps.AppsProtectionType.AppInfoType
Expand Down Expand Up @@ -166,23 +166,23 @@ class ExclusionListAdapter(val listener: ExclusionListListener) :
) {
when (bannerContent) {
BannerContent.ALL_OR_PROTECTED_APPS -> binding.excludedAppsEnabledVPNLabel.apply {
setImageResource(com.duckduckgo.mobile.android.R.drawable.ic_info_panel_info)
setImageResource(com.duckduckgo.common.ui.R.drawable.ic_info_panel_info)
setClickableLink(
TrackingProtectionExclusionListActivity.LEARN_WHY_ANNOTATION,
context.resources.getText(R.string.atp_ExcludedAppsEnabledLearnWhyLabel),
) { listener.onLaunchFAQ() }
}

BannerContent.UNPROTECTED_APPS -> binding.excludedAppsEnabledVPNLabel.apply {
setImageResource(com.duckduckgo.mobile.android.R.drawable.ic_info_panel_info)
setImageResource(com.duckduckgo.common.ui.R.drawable.ic_info_panel_info)
setClickableLink(
TrackingProtectionExclusionListActivity.LEARN_WHY_ANNOTATION,
context.resources.getText(R.string.atp_ExcludedAppsDisabledLearnWhyLabel),
) { listener.onLaunchFAQ() }
}

BannerContent.CUSTOMISED_PROTECTION -> binding.excludedAppsEnabledVPNLabel.apply {
setImageResource(com.duckduckgo.mobile.android.R.drawable.ic_info_panel_link)
setImageResource(com.duckduckgo.common.ui.R.drawable.ic_info_panel_link)
setText(context.resources.getString(R.string.atp_ExcludedAppsEnabledLabel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.di.AppCoroutineScope
import com.duckduckgo.app.global.DuckDuckGoActivity
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.view.addClickableLink
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.view.show
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.mobile.android.ui.view.addClickableLink
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.view.show
import com.duckduckgo.mobile.android.ui.viewbinding.viewBinding
import com.duckduckgo.mobile.android.vpn.AppTpVpnFeature
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.VpnFeaturesRegistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ManuallyDisableAppProtectionDialog : DialogFragment() {
val reportCTA = rootView.findViewById<Button>(R.id.trackingProtectionExcludeAppDialogReport)
val skipCTA = rootView.findViewById<Button>(R.id.trackingProtectionExcludeAppDialogSkip)

val alertDialog = MaterialAlertDialogBuilder(requireActivity(), com.duckduckgo.mobile.android.R.style.Widget_DuckDuckGo_Dialog)
val alertDialog = MaterialAlertDialogBuilder(requireActivity(), com.duckduckgo.common.ui.R.style.Widget_DuckDuckGo_Dialog)
.setView(rootView)

validateBundleArguments()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ManuallyEnableAppProtectionDialog : DialogFragment() {
val enableCTA = rootView.findViewById<Button>(R.id.trackingProtectionExcludeAppDialogEnable)
val skipCTA = rootView.findViewById<Button>(R.id.trackingProtectionExcludeAppDialogSkip)

val alertDialog = MaterialAlertDialogBuilder(requireActivity(), com.duckduckgo.mobile.android.R.style.Widget_DuckDuckGo_Dialog)
val alertDialog = MaterialAlertDialogBuilder(requireActivity(), com.duckduckgo.common.ui.R.style.Widget_DuckDuckGo_Dialog)
.setView(rootView)

validateBundleArguments()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RestoreDefaultProtectionDialog : DialogFragment() {
val restoreCTA = rootView.findViewById<Button>(R.id.trackingProtectionRestoreDefaultsRestore)
val cancelCTA = rootView.findViewById<Button>(R.id.trackingProtectionRestoreDefaultsCancel)

val alertDialog = MaterialAlertDialogBuilder(requireActivity(), com.duckduckgo.mobile.android.R.style.Widget_DuckDuckGo_Dialog)
val alertDialog = MaterialAlertDialogBuilder(requireActivity(), com.duckduckgo.common.ui.R.style.Widget_DuckDuckGo_Dialog)
.setView(rootView)

isCancelable = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.duckduckgo.app.global.extensions.safeGetApplicationIcon
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.view.quietlySetIsChecked
import com.duckduckgo.mobile.android.ui.view.setEnabledOpacity
import com.duckduckgo.mobile.android.ui.view.show
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.view.quietlySetIsChecked
import com.duckduckgo.common.ui.view.setEnabledOpacity
import com.duckduckgo.common.ui.view.show
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.apps.AppsProtectionType
import com.duckduckgo.mobile.android.vpn.apps.AppsProtectionType.AppInfoType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.di.AppCoroutineScope
import com.duckduckgo.app.global.DuckDuckGoActivity
import com.duckduckgo.browser.api.ui.WebViewActivityWithParams
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.R as commonR
import com.duckduckgo.common.ui.menu.PopupMenu
import com.duckduckgo.common.ui.view.getColorFromAttr
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.mobile.android.R as commonR
import com.duckduckgo.mobile.android.ui.menu.PopupMenu
import com.duckduckgo.mobile.android.ui.view.getColorFromAttr
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.viewbinding.viewBinding
import com.duckduckgo.mobile.android.vpn.AppTpVpnFeature
import com.duckduckgo.mobile.android.vpn.AppTpVpnFeature.APPTP_VPN
import com.duckduckgo.mobile.android.vpn.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import com.duckduckgo.anvil.annotations.ContributeToActivityStarter
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.global.DuckDuckGoActivity
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.viewbinding.viewBinding
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.databinding.ActivityReportBreakageAppListBinding
import com.duckduckgo.mobile.android.vpn.di.AppTpBreakageCategories
Expand Down Expand Up @@ -162,7 +162,7 @@ class ReportBreakageAppListActivity : DuckDuckGoActivity(), ReportBreakageAppLis
)
setSpan(
ForegroundColorSpan(
ContextCompat.getColor(baseContext, com.duckduckgo.mobile.android.R.color.cornflowerBlue),
ContextCompat.getColor(baseContext, com.duckduckgo.common.ui.R.color.cornflowerBlue),
),
fullText.getSpanStart(it),
fullText.getSpanEnd(it),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.duckduckgo.app.global.extensions.safeGetApplicationIcon
import com.duckduckgo.mobile.android.ui.view.quietlySetIsChecked
import com.duckduckgo.common.ui.view.quietlySetIsChecked
import com.duckduckgo.mobile.android.vpn.databinding.ViewDeviceShieldReportAppBreakageEntryBinding

class ReportBreakageAppListAdapter(private val listener: Listener) : RecyclerView.Adapter<ReportBreakageAppListViewHolder>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import com.duckduckgo.anvil.annotations.ContributeToActivityStarter
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.global.DuckDuckGoActivity
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.view.dialog.RadioListAlertDialogBuilder
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.VpnScope
import com.duckduckgo.mobile.android.ui.view.dialog.RadioListAlertDialogBuilder
import com.duckduckgo.mobile.android.ui.viewbinding.viewBinding
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.breakage.ReportBreakageCategorySingleChoiceViewModel.Command
import com.duckduckgo.mobile.android.vpn.breakage.ReportBreakageCategorySingleChoiceViewModel.ViewState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import android.view.ViewGroup
import androidx.core.text.HtmlCompat
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.appbuildconfig.api.AppBuildConfig
import com.duckduckgo.common.ui.store.AppTheme
import com.duckduckgo.di.scopes.FragmentScope
import com.duckduckgo.mobile.android.ui.store.AppTheme
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.databinding.ContentVpnAlwaysOnAlertBinding
import com.google.android.material.bottomsheet.BottomSheetBehavior
Expand All @@ -49,7 +49,7 @@ class AlwaysOnAlertDialogFragment private constructor() : BottomSheetDialogFragm
private lateinit var listener: Listener
private lateinit var fragmentType: FragmentType

override fun getTheme(): Int = com.duckduckgo.mobile.android.R.style.Widget_DuckDuckGo_BottomSheetDialogCollapsed
override fun getTheme(): Int = com.duckduckgo.common.ui.R.style.Widget_DuckDuckGo_BottomSheetDialogCollapsed

override fun onAttach(context: Context) {
AndroidSupportInjection.inject(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class AndroidDeviceShieldAlertNotificationBuilder constructor(
}

return NotificationCompat.Builder(context, VPN_ALERTS_CHANNEL_ID)
.setSmallIcon(com.duckduckgo.mobile.android.R.drawable.notification_logo)
.setSmallIcon(com.duckduckgo.common.ui.R.drawable.notification_logo)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setContentIntent(vpnControllerPendingIntent)
.setSilent(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class VpnEnabledNotificationBuilder {
notificationLayout.setTextViewText(R.id.deviceShieldNotificationHeader, vpnEnabledNotificationContent.title)

return NotificationCompat.Builder(context, VPN_FOREGROUND_SERVICE_NOTIFICATION_CHANNEL_ID)
.setSmallIcon(com.duckduckgo.mobile.android.R.drawable.notification_logo)
.setSmallIcon(com.duckduckgo.common.ui.R.drawable.notification_logo)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setContentIntent(vpnEnabledNotificationContent.onNotificationPressIntent)
.setCustomContentView(notificationLayout)
Expand All @@ -81,7 +81,7 @@ class VpnEnabledNotificationBuilder {
notificationLayout.setTextViewText(R.id.deviceShieldNotificationHeader, vpnNotification.title)

return NotificationCompat.Builder(context, VPN_FOREGROUND_SERVICE_NOTIFICATION_CHANNEL_ID)
.setSmallIcon(com.duckduckgo.mobile.android.R.drawable.notification_logo)
.setSmallIcon(com.duckduckgo.common.ui.R.drawable.notification_logo)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setContentIntent(vpnNotification.onNotificationPressIntent)
.setCustomContentView(notificationLayout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class RealVpnReminderNotificationBuilder @Inject constructor(
val notificationLayout = RemoteViews(context.packageName, vpnNotification.customViewLayout)

val builder = NotificationCompat.Builder(context, VPN_ALERTS_CHANNEL_ID)
.setSmallIcon(com.duckduckgo.mobile.android.R.drawable.notification_logo)
.setSmallIcon(com.duckduckgo.common.ui.R.drawable.notification_logo)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setContentIntent(vpnNotification.onNotificationPressIntent)
.setCustomContentView(notificationLayout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.duckduckgo.mobile.android.vpn.ui.onboarding

import com.duckduckgo.common.ui.store.AppTheme
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.mobile.android.ui.store.AppTheme
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.ui.onboarding.AppThemeAppTPOnboardingResourceHelper.AppTPOnboadingResource
import com.duckduckgo.mobile.android.vpn.ui.onboarding.AppThemeAppTPOnboardingResourceHelper.AppTPOnboadingResource.TRACKERS_COUNT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieCompositionFactory
import com.duckduckgo.mobile.android.ui.view.addClickableLink
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.view.show
import com.duckduckgo.common.ui.view.addClickableLink
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.view.show
import com.duckduckgo.mobile.android.vpn.R

class DeviceShieldOnboardingAdapter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import androidx.viewpager2.widget.ViewPager2
import com.duckduckgo.anvil.annotations.ContributeToActivityStarter
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.global.DispatcherProvider
import com.duckduckgo.app.global.DuckDuckGoActivity
import com.duckduckgo.appbuildconfig.api.AppBuildConfig
import com.duckduckgo.browser.api.ui.WebViewActivityWithParams
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.view.dialog.TextAlertDialogBuilder
import com.duckduckgo.common.ui.view.getColorFromAttr
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.mobile.android.app.tracking.ui.AppTrackerOnboardingActivityWithEmptyParamsParams
import com.duckduckgo.mobile.android.ui.view.dialog.TextAlertDialogBuilder
import com.duckduckgo.mobile.android.ui.view.getColorFromAttr
import com.duckduckgo.mobile.android.ui.viewbinding.viewBinding
import com.duckduckgo.mobile.android.vpn.AppTpVpnFeature
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.R.string
Expand Down Expand Up @@ -105,7 +105,7 @@ class VpnOnboardingActivity : DuckDuckGoActivity() {
}

private fun overrideStatusBarColor() {
window.statusBarColor = getColorFromAttr(com.duckduckgo.mobile.android.R.attr.appTPHeaderBackground)
window.statusBarColor = getColorFromAttr(com.duckduckgo.common.ui.R.attr.appTPHeaderBackground)
}

private fun observeViewModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.global.DuckDuckGoActivity
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.mobile.android.ui.viewbinding.viewBinding
import com.duckduckgo.mobile.android.vpn.databinding.ActivityAppTrackersInfoBinding
import com.duckduckgo.mobile.android.vpn.pixels.DeviceShieldPixels
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import androidx.core.os.postDelayed
import androidx.core.text.HtmlCompat
import androidx.lifecycle.*
import com.duckduckgo.anvil.annotations.InjectWith
import com.duckduckgo.app.global.DuckDuckGoFragment
import com.duckduckgo.app.global.FragmentViewModelFactory
import com.duckduckgo.common.ui.DuckDuckGoFragment
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.view.show
import com.duckduckgo.di.scopes.FragmentScope
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.view.show
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.pixels.DeviceShieldPixels
import com.duckduckgo.mobile.android.vpn.state.VpnStateMonitor.VpnRunningState.ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import android.widget.TextView
import androidx.core.view.isVisible
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.duckduckgo.mobile.android.ui.view.Chip
import com.duckduckgo.mobile.android.ui.view.gone
import com.duckduckgo.mobile.android.ui.view.show
import com.duckduckgo.common.ui.view.Chip
import com.duckduckgo.common.ui.view.gone
import com.duckduckgo.common.ui.view.show
import com.duckduckgo.mobile.android.vpn.R
import com.duckduckgo.mobile.android.vpn.ui.util.TextDrawable
import java.util.*
Expand Down Expand Up @@ -159,15 +159,15 @@ class AppTPCompanyDetailsAdapter : RecyclerView.Adapter<AppTPCompanyDetailsAdapt
val bottomSignals = companyDetails.trackingSignals.drop(TOP_SIGNALS)

topSignals.forEach {
val topSignal = inflater.inflate(com.duckduckgo.mobile.android.R.layout.view_chip, topSignalsLayout, false) as Chip
val topSignal = inflater.inflate(com.duckduckgo.common.ui.R.layout.view_chip, topSignalsLayout, false) as Chip
topSignal.setChipText(it.signalDisplayName)
topSignal.setChipIcon(it.signalIcon)
topSignalsLayout.addView(topSignal)
}

if (bottomSignals.isNotEmpty()) {
bottomSignals.forEach {
val bottomSignal = inflater.inflate(com.duckduckgo.mobile.android.R.layout.view_chip, bottomSignalsLayout, false) as Chip
val bottomSignal = inflater.inflate(com.duckduckgo.common.ui.R.layout.view_chip, bottomSignalsLayout, false) as Chip
bottomSignal.setChipText(it.signalDisplayName)
bottomSignal.setChipIcon(it.signalIcon)
bottomSignalsLayout.addView(bottomSignal)
Expand Down
Loading

0 comments on commit 251fdbf

Please sign in to comment.