It's quite easy to miss, but we should be using Gradle smaller "bin" distribution not "all" distribution.
👉 Check your Android project now.
#AndroidDev
I'm so happy to see the Kotlin 1.4.30 release!
Not only does it come with sealed interfaces, but it also fixes some performance problems you could run into with type inference.
I expect this to greatly increase IDE responsivity! Update your IDE plugin 🔥
https://t.co/3l3K6pcSR7
Use trailing commas to keep the version control history clear. When you add a new function or class parameter, the previous line remains unchanged since it already contains the comma.
#KotlinTips
PX - Pixel on the Screen
DP - Density Pixel (A way on Android to adapt to lower/higher resolution screens)
To convert between PX to DP in Jetpack Compose:
CORRECT:
with(AmbientDensity.current) { pxVal.toDp() }
INCORRECT:
pxVal.dp
(This Doesn't convert based on screen size)
Compose Animations are SO EASY. I knew it was.... just had to figure out how to do it. Referred back to a video from @intelligibabble where he said "just wrap it with a call to animate()". That's all it took. Here was his livestream: https://t.co/gfm8g1EU1Q
If you want to iterate over all the entries of a known enum class, you can use the ‘.values()’ function. If you are working with generic enums, you can use the ‘enumValues()’ function instead.
#KotlinTips
Use the partition function to split a collection into two lists based on a predicate. The function returns a pair of lists:
the first contains all elements for which the predicate evaluates to true;
the second contains all the other elements. https://t.co/lY57Sq802L
#KotlinTips
📖📚Kotlin:
Have you ever wondered how kotlin allows you to invoke scope functions on Nullable types without safe call?
The reason is because inside an extension function for a `nullable` type, `this` can be null.
#100DaysOfCode#Kotlin#KotlinTips#CodeNewbie#AndroidDev
Kotlin Collection Functions are useful, take advantage of it while coding. Use them based on your use-cases.
Check the example
Share it if you learned something new.
#AndroidDev#Kotlin#KotlinTips