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

Support the Emoji Search sample on desktop. #1755

Merged
merged 11 commits into from
Feb 22, 2024

Conversation

colinrtwhite
Copy link
Member

It's hooked up directly the presenter on desktop similar to the counter sample.

Screen.Recording.2024-01-02.at.2.07.07.AM.mov

override fun newImageLoader(context: Context): ImageLoader {
return ImageLoader.Builder(context)
.components {
add(NetworkFetcher.Factory())
Copy link
Member Author

Choose a reason for hiding this comment

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

Network URL support currently has to be added manually as it was pulled out of coil-core. Ktor finds imported engines at runtime, which could also be done by Coil, but I'm not sure it's a good idea.

@JakeWharton
Copy link
Collaborator

It's hooked up directly the presenter on desktop similar to the counter sample.

I'll look more into the PR later, but why was this done? The emoji sample is meant to be the Treehouse one. Is there something we can refactor towards to ensure it remains so that isn't available today?

Copy link
Collaborator

@JakeWharton JakeWharton left a comment

Choose a reason for hiding this comment

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

Excited for this

gradle/libs.versions.toml Outdated Show resolved Hide resolved
samples/emoji-search/composeui/build.gradle Outdated Show resolved Hide resolved
@colinrtwhite
Copy link
Member Author

It's hooked up directly the presenter on desktop similar to the counter sample.

I'll look more into the PR later, but why was this done? The emoji sample is meant to be the Treehouse one. Is there something we can refactor towards to ensure it remains so that isn't available today?

@JakeWharton I think we need a JVM instance of FrameClock to support Zipline + Treehouse. Do you think it's possible to write a common implementation that wraps Compose Multiplatform's MonotonicFrameClock? Or should I go another route?

@JakeWharton
Copy link
Collaborator

@JakeWharton I think we need a JVM instance of FrameClock to support Zipline + Treehouse. Do you think it's possible to write a common implementation that wraps Compose Multiplatform's MonotonicFrameClock? Or should I go another route?

Almost certainly. It would go in a 'treehouse-host-composeui' module (if we don't already have one). It should really happen automatically as part of using TreehouseContent, although I honestly can't remember if we built that yet or not.

If you refactor to keep the Android and JVM Desktop frontends in separate modules, I'd be okay with merging the direct usage and working towards getting it working on Treehouse over the coming weeks (or after I get back).

@colinrtwhite colinrtwhite force-pushed the colin/emojisearch_desktop branch from f3556bb to 00bc31a Compare January 2, 2024 21:49
val intent = Intent(Intent.ACTION_VIEW)
intent.setData(Uri.parse(url))
startActivity(context, intent, null)
openUrl.invoke(url)

Choose a reason for hiding this comment

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

👍

Copy link

@jingwei99 jingwei99 left a comment

Choose a reason for hiding this comment

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

this is really cool!

(and I saw the pending comment 👍 )

@JakeWharton
Copy link
Collaborator

Screenshot 2024-02-22 at 2 48 47 PM

@JakeWharton JakeWharton enabled auto-merge (squash) February 22, 2024 21:54
@JakeWharton JakeWharton merged commit ff1e475 into trunk Feb 22, 2024
9 checks passed
@JakeWharton JakeWharton deleted the colin/emojisearch_desktop branch February 22, 2024 22:37
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.

3 participants