Explore tweets tagged as #KotlinTips
@kotlin
Kotlin by JetBrains
4 years
To define a property that computes lazily, use 'by lazy'. #KotlinTips
Tweet media one
2
52
337
@kotlin
Kotlin by JetBrains
4 years
You can define an extension to a companion object. #KotlinTips
Tweet media one
8
92
674
@kotlin
Kotlin by JetBrains
4 years
#KotlinTips. Null-safety is the bread and butter of Kotlin! Use the null-safe call to avoid if-null checks:
Tweet media one
4
40
306
@kotlin
Kotlin by JetBrains
3 years
If you need an array of primitives, like an array of ints, use a specific type like 'IntArray' rather then 'Array<Int>' . #KotlinTips
Tweet media one
10
48
385
@amitiitbhu
Amit Shekhar
3 years
Learn Kotlin Collection Functions: associateBy. Check the example. Learn and Share πŸš€. #AndroidDev #Kotlin #KotlinTips #Developer #Android
Tweet media one
1
19
82
@mertceyhan
mert
4 years
You can implement an interface to your companion object or extend it from a class. #Kotlin #KotlinTips #Android #AndroidDev
Tweet media one
5
17
124
@amitiitbhu
Amit Shekhar
4 years
Kotlin Collection Functions: all. Check the example. Learn and Share . #AndroidDev #Kotlin #KotlinTips #Android #Developer
Tweet media one
0
9
81
@kotlin
Kotlin by JetBrains
4 years
#KotlinTips. We prefer using default arguments instead of overloading. Default arguments in Kotlin remove nearly all use cases for method and constructor overloading.
Tweet media one
4
34
220
@igorwojda
Igor Wojda πŸ€–
5 years
Inspired by @JorgeCastilloPr tweet I decided to present & describe various ways of exposing LiveData from ViewModel to a View (usually Fragment). #AndroidDev #Kotlin #KotlinTips #LiveData
Tweet media one
10
39
121
@kotlin
Kotlin by JetBrains
4 years
In Foo::bar, bar can also be an extension to Foo. Like in Char::isLetterOrDigit. #KotlinTips
Tweet media one
1
28
139
@kotlin
Kotlin by JetBrains
4 years
To create a map from an iterable or a sequence, use β€˜associate’ function and specify how to build a map entry from each element. If an element becomes a key, use 'associateWith'. If it becomes a value, use 'associateBy' instead. #KotlinTips
Tweet media one
1
35
229
@amitiitbhu
Amit Shekhar
4 years
Kotlin filtering function - partition(): filters a collection by a predicate and keeps the elements that don't match it in a separate list. Share it if you learned something new. #Kotlin #KotlinTips #AndroidDev #Android
Tweet media one
3
36
141
@amitiitbhu
Amit Shekhar
5 years
Kotlin - Idiomatic way to remove duplicate strings from an array. - distinct().- toSet().- toMutableSet().- toHashSet(). Share it if you learned something new. #Kotlin #KotlinTips #AndroidDev
Tweet media one
1
27
104
@amitiitbhu
Amit Shekhar
3 years
Kotlin Best Practices: Advantage of using const. #AndroidDev #Kotlin #KotlinTips #Android
Tweet media one
2
9
51
@anoopmaddasseri
Anoop M Maddasseri
5 years
Checkout, plus (+) and minus (-) operators work for map -πŸ‘‡ #AndroidDev #KotlinTips
Tweet media one
0
5
15
@kotlin
Kotlin by JetBrains
3 years
If you want to reference enum constants directly in the code, not as just import them. #KotlinTips
Tweet media one
1
24
127
@sarpongTech
sarpong πŸ‘¨πŸΏβ€πŸ’»
5 years
Tweet media one
0
11
4
@amitiitbhu
Amit Shekhar
4 years
Kotlin Best Practices: Constants in Kotlin. Check the example. Learn and Share. #Kotlin #KotlinTips #AndroidDev #Developer
Tweet media one
5
11
74
@amitiitbhu
Amit Shekhar
3 years
Learn Kotlin Collection Functions: chunked. Check the example. Learn and Share πŸš€. #AndroidDev #Kotlin #KotlinTips #Android #Developer
Tweet media one
1
6
43