From 4057a8832f46aa33739949f96deab891109ab32e Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 7 Mar 2023 14:50:26 +0400 Subject: [PATCH] Use non-transitive R classes --- .../ui/common/UserEligibilityErrorFragment.kt | 4 +- .../ui/compose/component/TextFields.kt | 4 +- .../ui/login/LoginDiscoveryErrorFragment.kt | 4 +- .../LoginMagicLinkSentImprovedFragment.kt | 4 +- .../ui/login/MagicLinkInterceptFragment.kt | 2 +- .../AccountMismatchErrorViewModel.kt | 2 +- ...JetpackActivationMagicLinkRequestScreen.kt | 2 +- .../ui/login/signup/SignUpViewModel.kt | 2 +- .../domainpicker/DomainPickerScreen.kt | 2 +- .../installation/InstallationScreen.kt | 56 +++++++++---------- .../login/storecreation/plans/PlansScreen.kt | 10 ++-- .../profiler/StoreProfilerScreen.kt | 2 +- .../android/ui/moremenu/MoreMenuScreen.kt | 39 ++++++------- .../android/ui/moremenu/MoreMenuViewModel.kt | 2 +- .../customerlist/CustomerListScreen.kt | 4 +- .../views/OrderCreateEditSectionView.kt | 2 +- .../android/ui/orders/list/SwipeToComplete.kt | 2 +- .../ui/products/ProductImageViewerFragment.kt | 2 +- .../ui/products/ProductImagesViewModel.kt | 10 ++-- .../widgets/WCBottomSheetDialogFragment.kt | 2 +- .../WCMaterialOutlinedCurrencyEditTextView.kt | 2 +- .../widgets/WCProductImageGalleryView.kt | 9 +-- .../android/widgets/WCViewPagerIndicator.kt | 2 +- .../ui/moremenu/MoreMenuViewModelTests.kt | 2 +- ...eaderPaymentReaderTypeStateProviderTest.kt | 16 +++--- 25 files changed, 92 insertions(+), 96 deletions(-) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/UserEligibilityErrorFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/UserEligibilityErrorFragment.kt index 118681ecfe9..2b721e204d1 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/UserEligibilityErrorFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/common/UserEligibilityErrorFragment.kt @@ -60,11 +60,11 @@ class UserEligibilityErrorFragment : BaseFragment(layout.fragment_user_eligibili requireActivity().addMenuProvider( object : MenuProvider { override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) { - menuInflater.inflate(R.menu.menu_login, menu) + menuInflater.inflate(org.wordpress.android.login.R.menu.menu_login, menu) } override fun onMenuItemSelected(item: MenuItem): Boolean { - if (item.itemId == R.id.help) { + if (item.itemId == org.wordpress.android.login.R.id.help) { startActivity( HelpActivity.createIntent( requireActivity(), diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/compose/component/TextFields.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/compose/component/TextFields.kt index 1858198f810..e0ea65bf782 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/compose/component/TextFields.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/compose/component/TextFields.kt @@ -279,9 +279,9 @@ fun WCPasswordField( keyboardActions = keyboardActions, trailingIcon = { val image = if (isPasswordVisible) { - painterResource(id = R.drawable.ic_password_visibility) + painterResource(id = org.wordpress.android.login.R.drawable.ic_password_visibility) } else { - painterResource(id = R.drawable.ic_password_visibility_off) + painterResource(id = org.wordpress.android.login.R.drawable.ic_password_visibility_off) } val description = if (isPasswordVisible) stringResource(id = R.string.hide_password_content_description) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginDiscoveryErrorFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginDiscoveryErrorFragment.kt index e93c64dd99b..36595ace42d 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginDiscoveryErrorFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginDiscoveryErrorFragment.kt @@ -125,11 +125,11 @@ class LoginDiscoveryErrorFragment : Fragment(layout.fragment_login_discovery_err } override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) { - menuInflater.inflate(R.menu.menu_login, menu) + menuInflater.inflate(org.wordpress.android.login.R.menu.menu_login, menu) } override fun onMenuItemSelected(menuItem: MenuItem): Boolean { - if (menuItem.itemId == R.id.help) { + if (menuItem.itemId == org.wordpress.android.login.R.id.help) { AnalyticsTracker.track(AnalyticsEvent.LOGIN_DISCOVERY_ERROR_MENU_HELP_TAPPED) loginListener?.helpSiteAddress(siteAddress) return true diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginMagicLinkSentImprovedFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginMagicLinkSentImprovedFragment.kt index 8a0951850fe..2ab6e4d8f9b 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginMagicLinkSentImprovedFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/LoginMagicLinkSentImprovedFragment.kt @@ -87,12 +87,12 @@ class LoginMagicLinkSentImprovedFragment : Fragment(R.layout.fragment_login_magi override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) { menu.clear() - menuInflater.inflate(R.menu.menu_login, menu) + menuInflater.inflate(org.wordpress.android.login.R.menu.menu_login, menu) } override fun onMenuItemSelected(menuItem: MenuItem): Boolean { return when (menuItem.itemId) { - R.id.help -> { + org.wordpress.android.login.R.id.help -> { mAnalyticsListener.trackShowHelpClick() mLoginListener?.helpMagicLinkSent(mEmail) true diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptFragment.kt index 674d22034c2..4475b468e6c 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/MagicLinkInterceptFragment.kt @@ -63,7 +63,7 @@ class MagicLinkInterceptFragment : Fragment() { ): View? { setHasOptionsMenu(true) - return inflater.inflate(R.layout.login_magic_link_sent_screen, container, false) + return inflater.inflate(org.wordpress.android.login.R.layout.login_magic_link_sent_screen, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/accountmismatch/AccountMismatchErrorViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/accountmismatch/AccountMismatchErrorViewModel.kt index fa7d31a589d..92c78372e8e 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/accountmismatch/AccountMismatchErrorViewModel.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/accountmismatch/AccountMismatchErrorViewModel.kt @@ -239,7 +239,7 @@ class AccountMismatchErrorViewModel @Inject constructor( step.value = Step.SiteCredentials() return@launch } - _loadingDialogMessage.value = R.string.loading + _loadingDialogMessage.value = org.wordpress.android.mediapicker.R.string.loading accountMismatchRepository.fetchJetpackConnectionUrl(site).fold( onSuccess = { _loadingDialogMessage.value = null diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/jetpack/wpcom/JetpackActivationMagicLinkRequestScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/jetpack/wpcom/JetpackActivationMagicLinkRequestScreen.kt index e09f86b1600..98bd774f596 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/jetpack/wpcom/JetpackActivationMagicLinkRequestScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/jetpack/wpcom/JetpackActivationMagicLinkRequestScreen.kt @@ -152,7 +152,7 @@ private fun MagicLinkSentContent( .fillMaxWidth() .weight(1f) ) { - Image(painter = painterResource(id = R.drawable.img_envelope), contentDescription = null) + Image(painter = painterResource(id = org.wordpress.android.login.R.drawable.img_envelope), contentDescription = null) Spacer(modifier = Modifier.height(dimensionResource(id = R.dimen.major_100))) Text( text = stringResource(id = R.string.login_magic_links_sent_label_short), diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/signup/SignUpViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/signup/SignUpViewModel.kt index f639b080f65..eff7af52422 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/signup/SignUpViewModel.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/signup/SignUpViewModel.kt @@ -53,7 +53,7 @@ class SignUpViewModel @Inject constructor( AnalyticsTracker.track(stat = AnalyticsEvent.SIGNUP_SUBMITTED) if (!networkStatus.isConnected()) { - triggerEvent(ShowSnackbar(R.string.no_network_message)) + triggerEvent(ShowSnackbar(org.wordpress.android.mediapicker.source.wordpress.R.string.no_network_message)) return } diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/domainpicker/DomainPickerScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/domainpicker/DomainPickerScreen.kt index a23ab622136..d84c407bad2 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/domainpicker/DomainPickerScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/domainpicker/DomainPickerScreen.kt @@ -146,7 +146,7 @@ private fun DomainSearchForm( .border( BorderStroke( width = dimensionResource(id = R.dimen.minor_10), - color = colorResource(id = R.color.gray_5) + color = colorResource(id = org.wordpress.android.mediapicker.api.R.color.gray_5) ), RoundedCornerShape(dimensionResource(id = R.dimen.minor_100)) ), diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/installation/InstallationScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/installation/InstallationScreen.kt index 004ca63abf2..7c2945d4c79 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/installation/InstallationScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/installation/InstallationScreen.kt @@ -33,9 +33,7 @@ import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.viewinterop.AndroidView -import com.woocommerce.android.R.color -import com.woocommerce.android.R.dimen -import com.woocommerce.android.R.string +import com.woocommerce.android.R import com.woocommerce.android.ui.compose.component.ProgressIndicator import com.woocommerce.android.ui.compose.component.WCColoredButton import com.woocommerce.android.ui.compose.component.WCOutlinedButton @@ -63,7 +61,7 @@ fun InstallationScreen(viewModel: InstallationViewModel) { viewModel::onRetryButtonClicked ) is InitialState, LoadingState -> { - ProgressIndicator(stringResource(id = string.store_creation_in_progress)) + ProgressIndicator(stringResource(id = R.string.store_creation_in_progress)) } } } @@ -83,24 +81,24 @@ private fun InstallationSummary( .fillMaxSize() ) { Text( - text = stringResource(id = string.store_creation_installation_success), - color = colorResource(id = color.color_on_surface), + text = stringResource(id = R.string.store_creation_installation_success), + color = colorResource(id = R.color.color_on_surface), textAlign = TextAlign.Center, style = MaterialTheme.typography.h5, modifier = Modifier .padding( - top = dimensionResource(id = dimen.major_350) + top = dimensionResource(id = R.dimen.major_350) ) ) Box( modifier = Modifier .weight(1f) - .background(color = colorResource(id = color.color_surface)) - .clip(RoundedCornerShape(dimensionResource(id = dimen.minor_100))) + .background(color = colorResource(id = R.color.color_surface)) + .clip(RoundedCornerShape(dimensionResource(id = R.dimen.minor_100))) .padding( - horizontal = dimensionResource(id = dimen.major_350), - vertical = dimensionResource(id = dimen.major_200) + horizontal = dimensionResource(id = R.dimen.major_350), + vertical = dimensionResource(id = R.dimen.major_200) ) ) { PreviewWebView( @@ -109,42 +107,42 @@ private fun InstallationSummary( .fillMaxSize() .align(Alignment.Center) .drawShadow( - color = colorResource(id = color.color_on_surface), - backgroundColor = colorResource(id = color.color_surface), - borderRadius = dimensionResource(id = dimen.major_100) + color = colorResource(id = R.color.color_on_surface), + backgroundColor = colorResource(id = R.color.color_surface), + borderRadius = dimensionResource(id = R.dimen.major_100) ) ) } Divider( - color = colorResource(id = color.divider_color), - thickness = dimensionResource(id = dimen.minor_10), - modifier = Modifier.padding(bottom = dimensionResource(id = dimen.major_100)) + color = colorResource(id = R.color.divider_color), + thickness = dimensionResource(id = R.dimen.minor_10), + modifier = Modifier.padding(bottom = dimensionResource(id = R.dimen.major_100)) ) WCColoredButton( modifier = Modifier - .padding(horizontal = dimensionResource(id = dimen.major_100)) + .padding(horizontal = dimensionResource(id = R.dimen.major_100)) .fillMaxWidth(), onClick = onManageStoreButtonClicked ) { Text( - text = stringResource(id = string.store_creation_installation_manage_store_button) + text = stringResource(id = R.string.store_creation_installation_manage_store_button) ) } WCOutlinedButton( modifier = Modifier .padding( - start = dimensionResource(id = dimen.major_100), - end = dimensionResource(id = dimen.major_100), - bottom = dimensionResource(id = dimen.major_100) + start = dimensionResource(id = R.dimen.major_100), + end = dimensionResource(id = R.dimen.major_100), + bottom = dimensionResource(id = R.dimen.major_100) ) .fillMaxWidth(), onClick = onShowPreviewButtonClicked ) { Text( - text = stringResource(id = string.store_creation_installation_show_preview_button) + text = stringResource(id = R.string.store_creation_installation_show_preview_button) ) } } @@ -155,13 +153,13 @@ private fun InstallationSummary( private fun PreviewWebView(url: String, modifier: Modifier = Modifier) { Box( modifier = modifier - .padding(dimensionResource(id = dimen.minor_100)) + .padding(dimensionResource(id = R.dimen.minor_100)) .fillMaxSize() - .clip(RoundedCornerShape(dimensionResource(id = dimen.minor_100))) + .clip(RoundedCornerShape(dimensionResource(id = R.dimen.minor_100))) .border( - dimensionResource(id = dimen.minor_10), - colorResource(id = color.gray_0), - shape = RoundedCornerShape(dimensionResource(id = dimen.minor_100)), + dimensionResource(id = R.dimen.minor_10), + colorResource(id = R.color.woo_gray_0), + shape = RoundedCornerShape(dimensionResource(id = R.dimen.minor_100)), ) ) { var progress by remember { mutableStateOf(0) } @@ -201,7 +199,7 @@ private fun PreviewWebView(url: String, modifier: Modifier = Modifier) { }, modifier = Modifier .alpha(if (progress == 100) 1f else 0f) - .clip(RoundedCornerShape(dimensionResource(id = dimen.minor_75))) + .clip(RoundedCornerShape(dimensionResource(id = R.dimen.minor_75))) ) } } diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/plans/PlansScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/plans/PlansScreen.kt index 9d5dc5e816a..5c023543e61 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/plans/PlansScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/plans/PlansScreen.kt @@ -139,7 +139,7 @@ private fun PlanInformation( Icon( Icons.Filled.ArrowBack, contentDescription = stringResource(id = R.string.back), - tint = colorResource(id = R.color.white) + tint = colorResource(id = org.wordpress.aztec.R.color.white) ) } @@ -157,7 +157,7 @@ private fun PlanInformation( Text( text = planState.plan.name, fontWeight = FontWeight.Bold, - color = colorResource(id = R.color.white), + color = colorResource(id = org.wordpress.aztec.R.color.white), fontSize = 20.sp, modifier = Modifier .constrainAs(title) { @@ -169,7 +169,7 @@ private fun PlanInformation( ) Text( text = planState.plan.formattedPrice, - color = colorResource(id = R.color.white), + color = colorResource(id = org.wordpress.aztec.R.color.white), fontSize = 40.sp, fontWeight = FontWeight.Bold, modifier = Modifier @@ -209,7 +209,7 @@ private fun PlanInformation( Text( fontWeight = FontWeight.Bold, text = stringResource(id = R.string.store_creation_ecommerce_plan_features_tagline), - color = colorResource(id = R.color.white), + color = colorResource(id = org.wordpress.aztec.R.color.white), fontSize = 28.sp, lineHeight = 36.sp ) @@ -309,7 +309,7 @@ fun PlanFeatureRow(@DrawableRes iconId: Int, @StringRes textId: Int) { ) Text( text = stringResource(id = textId), - color = colorResource(id = R.color.white), + color = colorResource(id = org.wordpress.aztec.R.color.white), style = MaterialTheme.typography.body2 ) } diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/profiler/StoreProfilerScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/profiler/StoreProfilerScreen.kt index 7edf343b557..0994e3a3e08 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/profiler/StoreProfilerScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/storecreation/profiler/StoreProfilerScreen.kt @@ -213,7 +213,7 @@ private fun SearchBar( .border( BorderStroke( width = dimensionResource(id = R.dimen.minor_10), - color = colorResource(id = R.color.gray_5) + color = colorResource(id = org.wordpress.android.mediapicker.api.R.color.gray_5) ), RoundedCornerShape(dimensionResource(id = R.dimen.minor_100)) ), diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuScreen.kt index 6835477b4f1..a418d4893c9 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuScreen.kt @@ -67,9 +67,6 @@ import com.bumptech.glide.Glide import com.bumptech.glide.request.target.CustomTarget import com.bumptech.glide.request.transition.Transition import com.woocommerce.android.R -import com.woocommerce.android.R.color -import com.woocommerce.android.R.drawable -import com.woocommerce.android.R.string import com.woocommerce.android.ui.moremenu.MoreMenuViewModel.MoreMenuViewState @ExperimentalFoundationApi @@ -133,7 +130,7 @@ private fun MoreMenuHeader( .fillMaxWidth() .clickable( enabled = state.isStoreSwitcherEnabled, - onClickLabel = stringResource(id = string.settings_switch_store), + onClickLabel = stringResource(id = R.string.settings_switch_store), role = Role.Button, onClick = onSwitchStore ) @@ -170,8 +167,8 @@ private fun SettingsButton(modifier: Modifier, onSettingsClick: () -> Unit) { onClick = { onSettingsClick() }, ) { Icon( - painter = painterResource(id = drawable.ic_more_screen_settings), - contentDescription = stringResource(id = string.settings), + painter = painterResource(id = R.drawable.ic_more_screen_settings), + contentDescription = stringResource(id = R.string.settings), tint = Color.Unspecified ) } @@ -201,7 +198,7 @@ private fun StoreDetailsHeader( ) if (isStoreSwitcherEnabled) { Text( - text = stringResource(string.settings_switch_store), + text = stringResource(R.string.settings_switch_store), color = MaterialTheme.colors.secondary, style = MaterialTheme.typography.body2, ) @@ -242,12 +239,12 @@ private fun MoreMenuUserAvatar(avatarUrl: String) { bitmapState.value?.let { Image( bitmap = it.asImageBitmap(), - contentDescription = stringResource(id = string.more_menu_avatar), + contentDescription = stringResource(id = R.string.more_menu_avatar), modifier = circledModifier ) } ?: Image( - painter = painterResource(id = drawable.img_gravatar_placeholder), - contentDescription = stringResource(id = string.more_menu_avatar), + painter = painterResource(id = R.drawable.img_gravatar_placeholder), + contentDescription = stringResource(id = R.string.more_menu_avatar), modifier = circledModifier ) } @@ -263,7 +260,7 @@ private fun MoreMenuButton( onClick = onClick, contentPadding = PaddingValues(dimensionResource(id = R.dimen.major_75)), colors = ButtonDefaults.buttonColors( - backgroundColor = colorResource(id = color.more_menu_button_background) + backgroundColor = colorResource(id = R.color.more_menu_button_background) ), modifier = Modifier.height(dimensionResource(id = R.dimen.more_menu_button_height)), shape = RoundedCornerShape(dimensionResource(id = R.dimen.major_75)) @@ -280,7 +277,7 @@ private fun MoreMenuButton( modifier = Modifier .size(dimensionResource(id = R.dimen.major_350)) .clip(CircleShape) - .background(colorResource(id = color.more_menu_button_icon_background)) + .background(colorResource(id = R.color.more_menu_button_icon_background)) ) { Image( painter = painterResource(id = iconDrawable), @@ -350,28 +347,28 @@ private fun MoreMenuPreview() { val state = MoreMenuViewState( moreMenuItems = listOf( MenuUiButton( - string.more_menu_button_payments, drawable.ic_more_menu_payments, + R.string.more_menu_button_payments, R.drawable.ic_more_menu_payments, BadgeState( badgeSize = R.dimen.major_110, - backgroundColor = color.color_secondary, - textColor = color.color_on_surface_inverted, + backgroundColor = R.color.color_secondary, + textColor = org.wordpress.android.mediapicker.R.color.color_on_surface_inverted, textState = TextState("", R.dimen.text_minor_80), animateAppearance = true ) ), - MenuUiButton(string.more_menu_button_wс_admin, drawable.ic_more_menu_wp_admin), - MenuUiButton(string.more_menu_button_store, drawable.ic_more_menu_store), + MenuUiButton(R.string.more_menu_button_wс_admin, R.drawable.ic_more_menu_wp_admin), + MenuUiButton(R.string.more_menu_button_store, R.drawable.ic_more_menu_store), MenuUiButton( - string.more_menu_button_reviews, drawable.ic_more_menu_reviews, + R.string.more_menu_button_reviews, R.drawable.ic_more_menu_reviews, BadgeState( badgeSize = R.dimen.major_150, - backgroundColor = color.color_primary, - textColor = color.color_on_surface_inverted, + backgroundColor = R.color.color_primary, + textColor = org.wordpress.android.mediapicker.R.color.color_on_surface_inverted, textState = TextState("3", R.dimen.text_minor_80), animateAppearance = false ) ), - MenuUiButton(string.more_menu_button_coupons, drawable.ic_more_menu_coupons), + MenuUiButton(R.string.more_menu_button_coupons, R.drawable.ic_more_menu_coupons), ), siteName = "Example Site", siteUrl = "woocommerce.com", diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModel.kt index 572b0a536f2..f98be760b30 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModel.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModel.kt @@ -100,7 +100,7 @@ class MoreMenuViewModel @Inject constructor( if (unseenReviewsCount > 0) BadgeState( badgeSize = R.dimen.major_150, backgroundColor = R.color.color_primary, - textColor = R.color.color_on_surface_inverted, + textColor = org.wordpress.android.mediapicker.R.color.color_on_surface_inverted, textState = TextState(unseenReviewsCount.toString(), R.dimen.text_minor_80), ) else null diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/customerlist/CustomerListScreen.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/customerlist/CustomerListScreen.kt index 6990f7e4d8b..1a3bfb90d8f 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/customerlist/CustomerListScreen.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/customerlist/CustomerListScreen.kt @@ -124,8 +124,8 @@ private fun CustomerListViewItem( .data(customer.avatarUrl) .crossfade(true) .build(), - placeholder = painterResource(R.drawable.ic_photos_grey_c_24dp), - error = painterResource(R.drawable.ic_photos_grey_c_24dp), + placeholder = painterResource(org.wordpress.aztec.R.drawable.ic_photos_grey_c_24dp), + error = painterResource(org.wordpress.aztec.R.drawable.ic_photos_grey_c_24dp), contentDescription = null, contentScale = ContentScale.FillWidth, modifier = Modifier diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/views/OrderCreateEditSectionView.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/views/OrderCreateEditSectionView.kt index 3347e5b202e..aded050bddc 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/views/OrderCreateEditSectionView.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/creation/views/OrderCreateEditSectionView.kt @@ -19,7 +19,7 @@ import com.woocommerce.android.databinding.OrderCreationSectionBinding class OrderCreateEditSectionView @JvmOverloads constructor( ctx: Context, attrs: AttributeSet? = null, - defStyleAttr: Int = R.attr.materialCardViewStyle + defStyleAttr: Int = com.google.android.material.R.attr.materialCardViewStyle ) : MaterialCardView(ctx, attrs, defStyleAttr) { private val binding = OrderCreationSectionBinding.inflate(LayoutInflater.from(ctx), this, true) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/SwipeToComplete.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/SwipeToComplete.kt index ecc00750137..29ffa59028e 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/SwipeToComplete.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/SwipeToComplete.kt @@ -34,7 +34,7 @@ class SwipeToComplete( private val swipeAbleColor = ContextCompat.getColor(context, R.color.color_primary) private val noSwipeAbleColor = ContextCompat.getColor(context, R.color.color_on_surface_disabled) private val width = (displayMetrics.widthPixels / displayMetrics.density).toInt().dp - private val completeIcon = ContextCompat.getDrawable(context, R.drawable.ic_checkmark_white_24dp)?.apply { + private val completeIcon = ContextCompat.getDrawable(context, org.wordpress.android.mediapicker.R.drawable.ic_checkmark_white_24dp)?.apply { setTint(Color.WHITE) } private val messageSize = context.resources.getDimension(R.dimen.text_minor_125) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImageViewerFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImageViewerFragment.kt index 77e54bbbc5b..1e1f73738ad 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImageViewerFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImageViewerFragment.kt @@ -129,7 +129,7 @@ class ProductImageViewerFragment : resetAdapter() binding.viewPager.setPageTransformer( - MarginPageTransformer(resources.getDimensionPixelSize(R.dimen.margin_large)) + MarginPageTransformer(resources.getDimensionPixelSize(org.wordpress.aztec.R.dimen.margin_large)) ) binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImagesViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImagesViewModel.kt index 4c9a0f55a13..14c2978ee06 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImagesViewModel.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/products/ProductImagesViewModel.kt @@ -4,7 +4,7 @@ import android.net.Uri import android.os.Parcelable import androidx.core.net.toUri import androidx.lifecycle.SavedStateHandle -import com.woocommerce.android.R.string +import com.woocommerce.android.R import com.woocommerce.android.RequestCodes import com.woocommerce.android.analytics.AnalyticsEvent import com.woocommerce.android.analytics.AnalyticsEvent.PRODUCT_DETAIL_IMAGE_TAPPED @@ -89,7 +89,7 @@ class ProductImagesViewModel @Inject constructor( fun uploadProductImages(remoteProductId: Long, localUriList: List) { if (!networkStatus.isConnected()) { - triggerEvent(ShowSnackbar(string.network_activity_no_connectivity)) + triggerEvent(ShowSnackbar(com.zendesk.sdk.R.string.network_activity_no_connectivity)) return } @@ -178,9 +178,9 @@ class ProductImagesViewModel @Inject constructor( val numImages = (viewState.images?.size ?: 0) + (viewState.uploadingImageUris?.size ?: 0) viewState = viewState.copy( chooserButtonButtonTitleRes = when { - isMultiSelectionAllowed -> string.product_add_photos - numImages > 0 -> string.product_replace_photo - else -> string.product_add_photo + isMultiSelectionAllowed -> R.string.product_add_photos + numImages > 0 -> R.string.product_replace_photo + else -> R.string.product_add_photo } ) } diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCBottomSheetDialogFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCBottomSheetDialogFragment.kt index 9babf5a8a27..35200d67da4 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCBottomSheetDialogFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCBottomSheetDialogFragment.kt @@ -40,7 +40,7 @@ open class WCBottomSheetDialogFragment : BottomSheetDialogFragment { if (DisplayUtils.isLandscape(requireContext())) { dialog?.setOnShowListener { val dialog = it as BottomSheetDialog - dialog.findViewById(R.id.design_bottom_sheet)?.let { sheet -> + dialog.findViewById(org.wordpress.aztec.R.id.design_bottom_sheet)?.let { sheet -> dialog.behavior.peekHeight = if (DisplayUtils.isXLargeTablet(requireContext())) { sheet.height } else { diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCMaterialOutlinedCurrencyEditTextView.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCMaterialOutlinedCurrencyEditTextView.kt index 5edc96f1abb..517682ee1fd 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCMaterialOutlinedCurrencyEditTextView.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCMaterialOutlinedCurrencyEditTextView.kt @@ -191,7 +191,7 @@ class WCMaterialOutlinedCurrencyEditTextView @JvmOverloads constructor( } } -private abstract class CurrencyEditText(context: Context) : TextInputEditText(context, null, R.attr.editTextStyle) { +private abstract class CurrencyEditText(context: Context) : TextInputEditText(context, null, androidx.appcompat.R.attr.editTextStyle) { open var supportsEmptyState: Boolean = true abstract var supportsNegativeValues: Boolean abstract val value: LiveData diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCProductImageGalleryView.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCProductImageGalleryView.kt index 5c4263e38b7..d3421c03943 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCProductImageGalleryView.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCProductImageGalleryView.kt @@ -134,8 +134,8 @@ class WCProductImageGalleryView @JvmOverloads constructor( imageSize = if (isGridView) { val windowWidth = DisplayUtils.getWindowPixelWidth(context) - val margin = context.resources.getDimensionPixelSize(R.dimen.margin_extra_large) - val deleteIconsSpace = context.resources.getDimensionPixelSize(R.dimen.margin_extra_large) + val margin = context.resources.getDimensionPixelSize(org.wordpress.aztec.R.dimen.margin_extra_large) + val deleteIconsSpace = context.resources.getDimensionPixelSize(org.wordpress.aztec.R.dimen.margin_extra_large) ((windowWidth - margin * NUM_GRID_MARGINS) / 2) - deleteIconsSpace } else { context.resources.getDimensionPixelSize(R.dimen.image_major_120) @@ -145,7 +145,7 @@ class WCProductImageGalleryView @JvmOverloads constructor( if (isGridView) { GridItemDecoration( spanCount = NUM_COLUMNS, - spacing = resources.getDimensionPixelSize(R.dimen.margin_extra_large) + spacing = resources.getDimensionPixelSize(org.wordpress.aztec.R.dimen.margin_extra_large) ) } else { HorizontalItemDecoration( @@ -443,7 +443,8 @@ class WCProductImageGalleryView @JvmOverloads constructor( private fun setMargins() { (viewBinding.productImage.layoutParams as FrameLayout.LayoutParams).apply { val margin = if (isGridView) { - val additionalMarginToFitDeleteIcon = context.resources.getDimensionPixelSize(R.dimen.margin_medium) + val additionalMarginToFitDeleteIcon = context.resources.getDimensionPixelSize( + org.wordpress.aztec.R.dimen.margin_medium) additionalMarginToFitDeleteIcon } else { 0 diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCViewPagerIndicator.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCViewPagerIndicator.kt index b53565ddcb7..307cc063aa5 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCViewPagerIndicator.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/widgets/WCViewPagerIndicator.kt @@ -23,7 +23,7 @@ class WCViewPagerIndicator @JvmOverloads constructor( pageCount = viewPager.adapter?.itemCount ?: 0 orientation = HORIZONTAL - val padding = context.resources.getDimensionPixelSize(R.dimen.margin_small) + val padding = context.resources.getDimensionPixelSize(org.wordpress.aztec.R.dimen.margin_small) for (page in 0 until pageCount) { ImageView(context).also { imageView -> diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModelTests.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModelTests.kt index 6adb57c4440..72b8dfec753 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModelTests.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/moremenu/MoreMenuViewModelTests.kt @@ -106,7 +106,7 @@ class MoreMenuViewModelTests : BaseUnitTest() { val reviewsButton = states.last().moreMenuItems.first { it.text == R.string.more_menu_button_reviews } assertThat(reviewsButton.icon).isEqualTo(R.drawable.ic_more_menu_reviews) assertThat(reviewsButton.badgeState?.textColor).isEqualTo( - R.color.color_on_surface_inverted + org.wordpress.android.mediapicker.R.color.color_on_surface_inverted ) assertThat(reviewsButton.badgeState?.badgeSize).isEqualTo( R.dimen.major_150 diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/cardreader/payment/CardReaderPaymentReaderTypeStateProviderTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/cardreader/payment/CardReaderPaymentReaderTypeStateProviderTest.kt index 42e5c493d93..b5a97237b6c 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/cardreader/payment/CardReaderPaymentReaderTypeStateProviderTest.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/payments/cardreader/payment/CardReaderPaymentReaderTypeStateProviderTest.kt @@ -133,7 +133,7 @@ class CardReaderPaymentReaderTypeStateProviderTest { val result = provider.providePaymentSuccessfulReceiptSentAutomaticallyState( cardReaderType, "amountLabel", - UiStringRes(R.string.ok), + UiStringRes(androidx.navigation.dynamicfeatures.fragment.R.string.ok), {}, {}, ) @@ -141,7 +141,7 @@ class CardReaderPaymentReaderTypeStateProviderTest { // THEN assertThat(result).isInstanceOf(BuiltInReaderPaymentSuccessfulReceiptSentAutomaticallyState::class.java) assertThat(result.amountWithCurrencyLabel).isEqualTo("amountLabel") - assertThat(result.receiptSentAutomaticallyHint).isEqualTo(UiStringRes(R.string.ok)) + assertThat(result.receiptSentAutomaticallyHint).isEqualTo(UiStringRes(androidx.navigation.dynamicfeatures.fragment.R.string.ok)) } @Test @@ -153,7 +153,7 @@ class CardReaderPaymentReaderTypeStateProviderTest { val result = provider.providePaymentSuccessfulReceiptSentAutomaticallyState( cardReaderType, "amountLabel", - UiStringRes(R.string.ok), + UiStringRes(androidx.navigation.dynamicfeatures.fragment.R.string.ok), {}, {}, ) @@ -161,7 +161,7 @@ class CardReaderPaymentReaderTypeStateProviderTest { // THEN assertThat(result).isInstanceOf(ExternalReaderPaymentSuccessfulReceiptSentAutomaticallyState::class.java) assertThat(result.amountWithCurrencyLabel).isEqualTo("amountLabel") - assertThat(result.receiptSentAutomaticallyHint).isEqualTo(UiStringRes(R.string.ok)) + assertThat(result.receiptSentAutomaticallyHint).isEqualTo(UiStringRes(androidx.navigation.dynamicfeatures.fragment.R.string.ok)) } @Test @@ -174,14 +174,14 @@ class CardReaderPaymentReaderTypeStateProviderTest { cardReaderType, errorType = PaymentFlowError.AmountTooSmall, amountLabel = "amountLabel", - primaryLabel = R.string.ok, + primaryLabel = androidx.navigation.dynamicfeatures.fragment.R.string.ok, {}, ) // THEN assertThat(result).isInstanceOf(BuiltInReaderFailedPaymentState::class.java) assertThat(result.amountWithCurrencyLabel).isEqualTo("amountLabel") - assertThat(result.primaryActionLabel).isEqualTo(R.string.ok) + assertThat(result.primaryActionLabel).isEqualTo(androidx.navigation.dynamicfeatures.fragment.R.string.ok) assertThat(result.paymentStateLabel).isEqualTo(PaymentFlowError.AmountTooSmall.message) } @@ -195,14 +195,14 @@ class CardReaderPaymentReaderTypeStateProviderTest { cardReaderType, errorType = PaymentFlowError.AmountTooSmall, amountLabel = "amountLabel", - primaryLabel = R.string.ok, + primaryLabel = androidx.navigation.dynamicfeatures.fragment.R.string.ok, {}, ) // THEN assertThat(result).isInstanceOf(ExternalReaderFailedPaymentState::class.java) assertThat(result.amountWithCurrencyLabel).isEqualTo("amountLabel") - assertThat(result.primaryActionLabel).isEqualTo(R.string.ok) + assertThat(result.primaryActionLabel).isEqualTo(androidx.navigation.dynamicfeatures.fragment.R.string.ok) assertThat(result.paymentStateLabel).isEqualTo(PaymentFlowError.AmountTooSmall.message) }