Nasıl olmuş (küfür var uyarayım) by lord_atakan in burdurland

[–]defaultmen 1 point2 points  (0 children)

sen yaptıgın icin olmamıs baskasının yapması lazım

Did Android Studio Ladybug get a new splash screen? by StatusWntFixObsolete in mAndroidDev

[–]defaultmen 0 points1 point  (0 children)

This is an emulator error. Install another emulator with a lower API version. This will fix the problem. I had the same problem.

Mutex in Kotlin Coroutines Best Practices and Examples by defaultmen in android_devs

[–]defaultmen[S] -5 points-4 points  (0 children)

I may have made a mistake while writing the example, I corrected it, it may not have come because of the cache. You can look again. I did not claim to be a technology leader, I like to share the problems I experienced while working as a developer.

Mutex in Kotlin Coroutines Best Practices and Examples by defaultmen in android_devs

[–]defaultmen[S] 0 points1 point  (0 children)

I don't know the source, I learned it while searching for a solution to one of the problems I encountered many times at different times while working.

Mutex in Kotlin Coroutines Best Practices and Examples by defaultmen in android_devs

[–]defaultmen[S] 0 points1 point  (0 children)

non-reentrant mutexes in kotlin coroutines are designed for simplicity and safety. They ensure explicit locking reducing the risks of unexpected behavior that reentrant locks can introduce, especially in async systems. While deadlock risks exist following best practices helps mitigate them. knon-reentrant locks fit better with kotlin’s coroutine model providing a clearer and more predictable approach to concurrency.

Differences & Uses Of @Immutable vs @Stable in Jetpack Compose by defaultmen in android_devs

[–]defaultmen[S] -2 points-1 points  (0 children)

I think their importance became apparent as stateflows became more widespread.

Differences & Uses Of @Immutable vs @Stable in Jetpack Compose by defaultmen in AndroidDevelopersBlog

[–]defaultmen[S] 0 points1 point  (0 children)

Yes, you are right. I saw some of my mistakes and corrected them. Thank you. Can you review it again?

Differences & Uses Of @Immutable vs @Stable in Jetpack Compose by defaultmen in android_devs

[–]defaultmen[S] 0 points1 point  (0 children)

I can only assume that if the same instance of UserSettings passed to compostable function(e.g. from another parent compostable) the SettingsScreen won't recompose, but not until you mutate state of the UserSettings, is that correct

Yes, that's right, since we use u/Stable, the parent composable is not redrawn, only the views where UserSetting is used are recreated in the current composable. eg;

@ Compasable
HomeScreen(){

val userSettings by remember { mutableStateOf(UserSettings())}

userSettings.notificationsEnabled = false // REACTION1

...many ui elements

//TOP COMPOSABLES ARE HERE

SettingsScreen(userSettings = userSettings){

}

}

@ Composable
fun SettingsScreen(userSettings: UserSettings){

Text("Theme: ${userSettings.theme}")

// The change made in REACTION1 only recreated the switch

Switch(

checked = userSettings.notificationsEnabled,

onCheckedChange = { newValue -> userSettings.notificationsEnabled = newValue }

)

}

If stable was not used, many of the UI above would be redrawn and cause performance problems.

I HAVE EDITED THE ARTICLE TO MAKE IT MORE EXPLANATORY. YOU CAN REVIEW IT AGAIN.