Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose material 3 bindings #197

Merged
merged 9 commits into from
Oct 18, 2023
Merged

Conversation

js-bonin
Copy link
Member

Description

On ajoute une version des bindings compose qui utilise material 3.

Motivation and Context

Les bindings compose actuel utilisent tous material 1, on garde ces bindings pour ne pas causer de breaking changes ni de changement UI mais on ajoute un package material3 pour avoir le choix d'utiliser la version material3 des composants qui apporte certaines features (dynamic colors) et modifications au niveau de la gestion du thème de couleurs ainsi qu'un update visuel pour certain composants (switch/checkbox, textfield, progress).

How Has This Been Tested?

Les bindings ajoutés ont tous été ajouté dans les samples.

Types of changes

  • [ x] New feature (non-breaking change which adds functionality)


@Preview
@Composable
fun EnabledToggleCheckboxPreview() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all Previews should be private, we don't want to expose that in the public API

import com.mirego.trikot.viewmodels.declarative.compose.extensions.vmdModifier
import com.mirego.trikot.viewmodels.declarative.compose.viewmodel.internal.FormattedVisualTransformation

@OptIn(ExperimentalMaterial3Api::class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of Opt-in, we should propagate ExperimentalMaterial3Api annotation
i.e.
@ExperimentalMaterial3Api

same for the others

after that, the sample can opt-in at the gradle level.

@@ -9,4 +9,6 @@ import com.mirego.trikot.viewmodels.declarative.content.VMDTextContent
interface PickerShowcaseViewModel : ShowcaseViewModel {
val textPickerTitle: VMDTextViewModel
val textPicker: VMDPickerViewModel<VMDContentPickerItemViewModelImpl<VMDTextContent>>
val textPickerTitle2: VMDTextViewModel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot re-use the same viewmodel here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just weird in the sample otherwise since both picker changes each-other's value, but we could.


com.mirego.trikot.viewmodels.declarative.compose.viewmodel.material3.VMDCheckbox(
modifier = Modifier
.padding(start = 16.dp, top = 16.dp, end = 16.dp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

padding(16.dp) same for the others

@@ -35,6 +35,7 @@ dependencies {

api("androidx.compose.foundation:foundation:${Versions.JETPACK_COMPOSE_RUNTIME}")
api("androidx.compose.material:material:${Versions.JETPACK_COMPOSE_RUNTIME}")
api("androidx.compose.material3:material3:${Versions.JETPACK_COMPOSE_MATERIAL_3}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not use implementation here?

Copy link
Member Author

@js-bonin js-bonin Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already added in compose-flow as api so I added it in the same way in compose-publisher but it could probably be changed in both yeah

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouin non je confirme que ca prend bien api

@remi remi changed the title Feature/compose material 3 bindings Compose material 3 bindings Oct 18, 2023
@js-bonin js-bonin merged commit 84d2154 into master Oct 18, 2023
1 check passed
@js-bonin js-bonin deleted the feature/compose_material_3_bindings branch October 18, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants