Skip to content

Commit

Permalink
Merge pull request #18733 from wordpress-mobile/build/fix-non-transit…
Browse files Browse the repository at this point in the history
…ive-resources

[Build] Fix Non-Transitive Resources
  • Loading branch information
AjeshRPai authored Jul 4, 2023
2 parents 8c60d49 + addb9e3 commit 51879d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import androidx.compose.ui.res.colorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import org.wordpress.android.R
import org.wordpress.android.ui.compose.theme.AppTheme
import org.wordpress.android.widgets.WPSwitchCompat
import com.google.android.material.R as MaterialR

/**
* A switch that by default uses the same colors as the SwitchCompat from the App Compat libraries, so there are no
Expand Down Expand Up @@ -80,16 +80,16 @@ object WPSwitchDefaults {
// thumb colors
val thumbDisabledColor = colorResource(
if (MaterialTheme.colors.isLight) {
R.color.switch_thumb_disabled_material_light
MaterialR.color.switch_thumb_disabled_material_light
} else {
R.color.switch_thumb_disabled_material_dark
MaterialR.color.switch_thumb_disabled_material_dark
}
)
val thumbEnabledUncheckedColor = colorResource(
if (MaterialTheme.colors.isLight) {
R.color.switch_thumb_normal_material_light
MaterialR.color.switch_thumb_normal_material_light
} else {
R.color.switch_thumb_normal_material_dark
MaterialR.color.switch_thumb_normal_material_dark
}
)
val thumbEnabledCheckedColor = MaterialTheme.colors.primary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.appcompat.content.res.AppCompatResources
import androidx.appcompat.widget.SwitchCompat
import org.wordpress.android.R
import org.wordpress.android.ui.compose.components.buttons.WPSwitch
import com.google.android.material.R as MaterialR

/**
* SwitchCompat with custom track and thumb drawables and width to match closely the [WPSwitch] composable. This lets
Expand All @@ -19,7 +20,7 @@ import org.wordpress.android.ui.compose.components.buttons.WPSwitch
class WPSwitchCompat @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = R.attr.switchStyle,
defStyleAttr: Int = MaterialR.attr.switchStyle,
) : SwitchCompat(context, attrs, defStyleAttr) {
init {
setEnforceSwitchWidth(false)
Expand Down

0 comments on commit 51879d5

Please sign in to comment.