-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create Temporal Module #33
Conversation
android.useAndroidX=true | ||
|
||
# Android Build Features | ||
android.defaults.buildfeatures.buildconfig=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
I always did this in the build.gradle.kts
's android
block. Cool to know you can just blanket disable in a project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know (could be wrong though), it's relatively new. These change defaults for the "build features" block, which I am pretty sure was only added with view binding.
public static final fun assertSimilar-2yBKrUY (Lkotlinx/datetime/LocalDateTime;DLkotlinx/datetime/LocalDateTime;Lkotlinx/datetime/TimeZone;)V | ||
public static synthetic fun assertSimilar-2yBKrUY$default (Lkotlinx/datetime/LocalDateTime;DLkotlinx/datetime/LocalDateTime;Lkotlinx/datetime/TimeZone;ILjava/lang/Object;)V | ||
public static final fun assertSimilar-hN_NL7I (Lkotlinx/datetime/Instant;DLkotlinx/datetime/Instant;)V |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you aware of a ware to prevent name mangling on our public API? Or is this by design, as they're internal
so shouldn't be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are properly public
, not @PublishedApi internal
. The mangling here is because the function accepts a kotlin.time.Duration
argument (which is an inline class
wrapper around a Double
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great. Just had some probably quick concerns to address.
crossinline factory: () -> T | ||
): Flow<T> = flow { | ||
emit(factory.invoke()) | ||
emitAll(broadcastReceiverFlow(temporalEventFilter).map { factory.invoke() }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to output which Filter generated the event, as a parameter in the lambda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't be hard to add an Intent
argument to the factory
lambda, but doing that would require the API not to match other platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love all the tests.
It's great to see that one of the benefits of breaking this component out of the app layer and into an external library is that we get the luxury of allowing tests to have short delays. In the app layer I'd be worried we'd be extending the duration of our already long test suite, but this library isn't build as frequently and overall its test suite is nice and short. Adding these longer running tests isn't a big deal at all.
// If this is an application module and your minimum API version is below 26, enable core library | ||
// desugaring. See https://developer.android.com/studio/write/java8-support#library-desugaring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Super helpful documentation.
broadcastReceiverFlow
for Android in:coroutines
module:test
module.:temporal
moduleticker
flow which allows time based ticking. Implementation is similar to Kotlin's ticker channel, but a little less robust/more simple.