This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class User(val name: String) | |
| data class UserWithInterest(val user: User, val interests: List<String>) | |
| class MyRepository { | |
| private val interestsMap = mapOf( | |
| "Sarah" to listOf( | |
| "Skiing", | |
| "Bingo" | |
| ), | |
| "Tim" to listOf( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.enableEdgeToEdge | |
| import androidx.activity.SystemBarStyle | |
| import androidx.activity.viewModels | |
| import androidx.compose.animation.AnimatedContent | |
| import androidx.compose.animation.AnimatedVisibility | |
| import androidx.compose.animation.animateColorAsState | |
| import androidx.compose.animation.core.animateFloatAsState |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import android.os.Debug | |
| import android.util.Log | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.enableEdgeToEdge | |
| import androidx.activity.SystemBarStyle | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plugins { | |
| id("com.github.johnrengelman.shadow") version "8.1.1" | |
| } | |
| configurations { | |
| create("aarToRepackage") | |
| } | |
| dependencies { | |
| // Point to the original Lib-A AAR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.enableEdgeToEdge | |
| import androidx.activity.SystemBarStyle | |
| import androidx.compose.animation.Crossfade | |
| import androidx.compose.animation.animateColorAsState | |
| import androidx.compose.animation.core.animateDpAsState | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class Message( | |
| val id: Int, | |
| val text: String, | |
| val isFromMe: Boolean, | |
| var reaction: String? = null | |
| ) | |
| class MainActivity : ComponentActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.enableEdgeToEdge | |
| import androidx.compose.animation.AnimatedVisibility | |
| import androidx.compose.animation.AnimatedVisibilityScope | |
| import androidx.compose.animation.EnterTransition | |
| import androidx.compose.animation.ExitTransition | |
| import androidx.compose.animation.expandIn | |
| import androidx.compose.animation.fadeIn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.enableEdgeToEdge | |
| import androidx.compose.animation.AnimatedContent | |
| import androidx.compose.animation.AnimatedVisibilityScope | |
| import androidx.compose.animation.ExperimentalSharedTransitionApi | |
| import androidx.compose.animation.SharedTransitionLayout | |
| import androidx.compose.animation.SharedTransitionScope | |
| import androidx.compose.animation.core.tween |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Common Code | |
| interface Bootstrap { | |
| val gpsService: GPSService | |
| } | |
| class KoinBootstrap : KoinComponent { | |
| fun initDependencies(bootstrap: Bootstrap) = startKoin { | |
| configureKoin(bootstrap) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun restaurantsNearUser(): Flow<List<Restaurant>> = | |
| flow { | |
| emit(null) | |
| gpsService.currentUserLocation().also { location -> | |
| emit(location) | |
| } | |
| } | |
| .map { userLocation -> | |
| buildRestaurantList(userLocation) | |
| } |
NewerOlder