• Stars
    star
    367
  • Rank 116,257 (Top 3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GraphQL based Jetpack Compose and SwiftUI Kotlin Multiplatform project (using https://rickandmortyapi.com/graphql)

MortyCompose

kotlin-version

Kotlin Multiplatform sample that demonstrates use of GraphQL + Jetpack Compose and SwiftUI (based on https://github.com/Dimillian/MortyUI SwiftUI project). Makes use of Apollo library's Kotlin Multiplatform support and is also included as one of the samples for that project.

Related Posts:

Characters Android Screenshot

The project also makes use of Jetpack Compose's Paging library that allows setting up LazyColumn for example that's driven from PagingSource as shown below (that source in our case invokes Apollo GraphQL queries). (UPDATE: have started to use multiplatform-paging library for managing paging within the Kotlin Multiplatform shared code).

class CharacterListsViewModel(private val repository: MortyRepository): ViewModel() {
    
    val characters: Flow<PagingData<CharacterDetail>> = Pager(PagingConfig(pageSize = 20)) {
        CharactersDataSource(repository)
    }.flow

}

@Composable
fun CharactersListView() {
    val characterListsViewModel = getViewModel<CharacterListsViewModel>()
    val lazyCharacterList = characterListsViewModel.characters.collectAsLazyPagingItems()

    LazyColumn {
        items(lazyCharacterList) { character ->
            character?.let {
                CharactersListRowView(character)
            }
        }
    }
}

iOS App

A small SwiftUI iOS app that uses same shared Kotlin Multiplatform code is in the iosApp folder (shows Characters screen using more or less same SwiftUI code that's in https://github.com/Dimillian/MortyUI)

Characters iOS Screenshot

More Repositories

1

PeopleInSpace

Kotlin Multiplatform sample with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.
Kotlin
2,899
star
2

Confetti

KMP GraphQL based conference project with Jetpack Compose Android, Compose for Wear, Compose Multiplatform and SwiftUI iOS clients along with GraphQL backend.
Kotlin
763
star
3

BikeShare

SwiftUI, Jetpack Compose, and Compose for Desktop based Kotlin Multiplatform project (using CityBikes API http://api.citybik.es/v2/). Uses Realm for local persistence
Kotlin
665
star
4

GalwayBus

Galway Bus Kotlin Multiplatform project using Jetpack Compose and SwiftUI
Kotlin
524
star
5

FantasyPremierLeague

Fantasy Premier League Kotlin Multiplatform sample using Jetpack Compose, Compose for Desktop and SwiftUI (and Room for local persistence)
Kotlin
468
star
6

StarWars

Minimal GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample (using StarWars endpoint - https://graphql.org/swapi-graphql)
Kotlin
202
star
7

GeminiKMP

Kotlin Multiplatform sample that uses Gemini Generative AI APIs. Runs on Android, iOS, Desktop and Wasm based Compose for Web.
Kotlin
189
star
8

ClimateTraceKMP

Kotlin/Compose Multiplatform project to show climate related emission data from https://climatetrace.org/data.
Kotlin
156
star
9

WordMasterKMP

Kotlin Multiplatform sample with SwiftUI and Compose (Desktop and Android) clients. Heavily inspired by Wordle game.
Kotlin
63
star
10

peopleinspace-lib

Example Kotlin Multiplatform library that provides API to retrieve list of people in space and current position of International Space Station.
Kotlin
10
star
11

ConfettiSwiftUISPM

Minimal version of Confetti i0S clients that consumes shared KMM code as Swift Package
Swift
7
star
12

PeopleInSpaceGraphQLServer

Cloud Run based GraphQL backend for PeopleInSpace supporting queries and subscriptions
Kotlin
5
star
13

PeopleInSpacePackage

Swift Package for https://github.com/joreilly/PeopleInSpace.
Objective-C
5
star
14

GalwayBusAndroid

Android Client that shows Galway Bus Info (deprecated!)
Java
4
star
15

BikeShareSwiftPackage

Objective-C
4
star
16

joreilly

3
star
17

ZeoRawTest

Ruby code to test out Zeo Raw Data Library
2
star
18

google-actions-galway-bus

JavaScript
1
star