Skip to content

Releases: raamcosta/compose-destinations

1.5.34-beta

26 Feb 20:46
56f2747
Compare
Choose a tag to compare

Changes

- #352 : Adds support for navigation extras when navigating to an ActivityDestination

- Fixed issue with launchSingleTop destinations not receiving the result from a ResultBackNavigator in certain scenarios

Full Changelog: 1.5.33-beta...1.5.34-beta

1.8.33-beta

22 Jan 21:25
3d26bd8
Compare
Choose a tag to compare

- Feature - Destination Wrappers

With this feature, you can set a number of wrapper composables to your screens, extracting common logic or UI you need in multiple screens.
Imagine you have a number of screens that should be behind a PIN. How would you implement that so that you don't repeat yourself and you avoid adding complexity to each of these screens?

Well, after this update you can do this:

@Destination(
    wrappers = [PinEntryWrapper::class] // 👈 
)
@Composable
fun YourScreen() { //...

And define what your wrapper does like:

object PinEntryWrapper : DestinationWrapper {

    @Composable
    override fun <T> DestinationScope<T>.Wrap(
        screenContent: @Composable () -> Unit
    ) {
        val vm = viewModel<PinEntryWrapperViewModel>()
        val correctPinEntered by vm.correctPinEntered.collectAsState()

        if (pinEnteredCorrectly) {
            screenContent()
        } else {
            // SHOW YOUR PIN ENTRY HERE
        }
    }
}

And now you have a reusable piece of logic and UI which can be easily reused in how many screens you need and with very little intrusion to the screen itself! 🙌
The DestinationScope receiver of the Wrap function will give you anything you might need here including the destination
being wrapped at the moment (since you can Wrap multiple ones), its arguments, dependencies (provided via dependencyContainerBuilder etc.

- Fixed #339

Full Changelog: 1.7.33-beta...1.8.33-beta

1.7.33-beta

22 Jan 21:25
f1c1b8f
Compare
Choose a tag to compare

- Feature - Destination Wrappers

With this feature, you can set a number of wrapper composables to your screens, extracting common logic or UI you need in multiple screens.
Imagine you have a number of screens that should be behind a PIN. How would you implement that so that you don't repeat yourself and you avoid adding complexity to each of these screens?

Well, after this update you can do this:

@Destination(
    wrappers = [PinEntryWrapper::class] // 👈 
)
@Composable
fun YourScreen() { //...

And define what your wrapper does like:

object PinEntryWrapper : DestinationWrapper {

    @Composable
    override fun <T> DestinationScope<T>.Wrap(
        screenContent: @Composable () -> Unit
    ) {
        val vm = viewModel<PinEntryWrapperViewModel>()
        val correctPinEntered by vm.correctPinEntered.collectAsState()

        if (pinEnteredCorrectly) {
            screenContent()
        } else {
            // SHOW YOUR PIN ENTRY HERE
        }
    }
}

And now you have a reusable piece of logic and UI which can be easily reused in how many screens you need and with very little intrusion to the screen itself! 🙌
The DestinationScope receiver of the Wrap function will give you anything you might need here including the destination
being wrapped at the moment (since you can Wrap multiple ones), its arguments, dependencies (provided via dependencyContainerBuilder etc.

- Fixed #339

Full Changelog: 1.7.32-beta...1.7.33-beta

1.6.33-beta

22 Jan 21:24
39b2b09
Compare
Choose a tag to compare

- Feature - Destination Wrappers

With this feature, you can set a number of wrapper composables to your screens, extracting common logic or UI you need in multiple screens.
Imagine you have a number of screens that should be behind a PIN. How would you implement that so that you don't repeat yourself and you avoid adding complexity to each of these screens?

Well, after this update you can do this:

@Destination(
    wrappers = [PinEntryWrapper::class] // 👈 
)
@Composable
fun YourScreen() { //...

And define what your wrapper does like:

object PinEntryWrapper : DestinationWrapper {

    @Composable
    override fun <T> DestinationScope<T>.Wrap(
        screenContent: @Composable () -> Unit
    ) {
        val vm = viewModel<PinEntryWrapperViewModel>()
        val correctPinEntered by vm.correctPinEntered.collectAsState()

        if (pinEnteredCorrectly) {
            screenContent()
        } else {
            // SHOW YOUR PIN ENTRY HERE
        }
    }
}

And now you have a reusable piece of logic and UI which can be easily reused in how many screens you need and with very little intrusion to the screen itself! 🙌
The DestinationScope receiver of the Wrap function will give you anything you might need here including the destination
being wrapped at the moment (since you can Wrap multiple ones), its arguments, dependencies (provided via dependencyContainerBuilder etc.

- Fixed #339

Full Changelog: 1.6.32-beta...1.6.33-beta

1.5.33-beta

22 Jan 21:24
10a6b5e
Compare
Choose a tag to compare

- Feature - Destination Wrappers

With this feature, you can set a number of wrapper composables to your screens, extracting common logic or UI you need in multiple screens.
Imagine you have a number of screens that should be behind a PIN. How would you implement that so that you don't repeat yourself and you avoid adding complexity to each of these screens?

Well, after this update you can do this:

@Destination(
    wrappers = [PinEntryWrapper::class] // 👈 
)
@Composable
fun YourScreen() { //...

And define what your wrapper does like:

object PinEntryWrapper : DestinationWrapper {

    @Composable
    override fun <T> DestinationScope<T>.Wrap(
        screenContent: @Composable () -> Unit
    ) {
        val vm = viewModel<PinEntryWrapperViewModel>()
        val correctPinEntered by vm.correctPinEntered.collectAsState()

        if (pinEnteredCorrectly) {
            screenContent()
        } else {
            // SHOW YOUR PIN ENTRY HERE
        }
    }
}

And now you have a reusable piece of logic and UI which can be easily reused in how many screens you need and with very little intrusion to the screen itself! 🙌
The DestinationScope receiver of the Wrap function will give you anything you might need here including the destination
being wrapped at the moment (since you can Wrap multiple ones), its arguments, dependencies (provided via dependencyContainerBuilder etc.

- Fixed #339

Full Changelog: 1.5.32-beta...1.5.33-beta

1.8.32-beta

16 Jan 22:02
6b445c7
Compare
Choose a tag to compare

#104 - Added value class navigation argument support.

You can now use value classes as navigation arguments 🙌
Some limitations: (checked at compile time)

  • Value class has to have a public constructor
  • Value class has a public non nullable field
  • Value class "inner type" needs to be a "non value class" navigation argument type.

Updated dependencies for compose 1.4

Full Changelog: 1.7.30-beta...1.8.32-beta

1.7.32-beta

16 Jan 22:03
9eee3c0
Compare
Choose a tag to compare

#104 - Added value class navigation argument support.

You can now use value classes as navigation arguments 🙌
Some limitations: (checked at compile time)

  • Value class has to have a public constructor
  • Value class has a public non nullable field
  • Value class "inner type" needs to be a "non value class" navigation argument type.

Full Changelog: 1.7.30-beta...1.7.32-beta

1.6.32-beta

16 Jan 22:04
9a79c7e
Compare
Choose a tag to compare

#104 - Added value class navigation argument support.

You can now use value classes as navigation arguments 🙌
Some limitations: (checked at compile time)

  • Value class has to have a public constructor
  • Value class has a public non nullable field
  • Value class "inner type" needs to be a "non value class" navigation argument type.

Full Changelog: 1.6.30-beta...1.6.32-beta

1.5.32-beta

16 Jan 22:04
c6db918
Compare
Choose a tag to compare

#104 - Added value class navigation argument support.

You can now use value classes as navigation arguments 🙌
Some limitations: (checked at compile time)

  • Value class has to have a public constructor
  • Value class has a public non nullable field
  • Value class "inner type" needs to be a "non value class" navigation argument type.

Full Changelog: 1.5.30-beta...1.5.32-beta

1.7.30 - Wear OS support! 🙌

30 Dec 11:37
086b641
Compare
Choose a tag to compare

What's Changed

To use it, import the corresponding core dependency:

implementation 'io.github.raamcosta.compose-destinations:wear-core:1.7.30-beta'

Then create a wear os NavHostEngine and pass it to the DestinationsNavHost composable:

val engine = rememberWearNavHostEngine()

DestinationsNavHost(
    engine = engine,
    //... same thing as with normal lib usage
)

New Contributors

Full Changelog: 1.7.27-beta...1.7.30-beta