https://kotlinlang.org
Join Slack
Hey guys, what do you think is better for sharing viewmodels in KMM and why, <moko-mvvm> or <kmm-vie...
d

Djuro

over 2 years ago
Hey guys, what do you think is better for sharing viewmodels in KMM and why, moko-mvvm or kmm-viewmodel?
d
s
+5
  • 7
  • 9
  • 609
Can you use shared resources for tests in a Kotlin Multiplatform Mobile project? I tried to include ...
j

José González Gómez

over 4 years ago
Can you use shared resources for tests in a Kotlin Multiplatform Mobile project? I tried to include some JSON files under
src/commonTest/resources
but they don't seem to get copied to the output directory when running Android tests. Putting them under
src/androidTest/resources
did the trick for Android tests, but I don't want to have two copies of these files, as they are common for both Android and iOS tests.
👀 2
j
d
+3
  • 5
  • 10
  • 609
how can i mockk bitmap?
s

Sergio Crespo Toubes

over 6 years ago
how can i mockk bitmap?
s
l
  • 2
  • 22
  • 609
Hello :wave: Is there a way to use HorizontalPager without the lazy loading? Basicly i have a use c...
k

Karlo Vuljanko

over 2 years ago
Hello 👋 Is there a way to use HorizontalPager without the lazy loading? Basicly i have a use case where all my items have to have the height of the tallest item in pager (height of items is dynamic, depends on data i provide to the item), but compose prohibits the use of
IntrinsicSize.Max()
in lazy components. (Understandably) is there an easy way to work around this or do i have to do some magic with SubcomposeLayout / Create quasi non lazy pager with Row composable?
k
s
+4
  • 6
  • 25
  • 608
Hello everyone, Is it a way to mock only one static method using mockk? MockkStatic is mocking the ...
d

Daniel Branco

about 4 years ago
Hello everyone, Is it a way to mock only one static method using mockk? MockkStatic is mocking the whole LocalDateTime and we just want to mock the now
d
m
+2
  • 4
  • 12
  • 608
Hi everyone, when handling a pagination query, to get both the query result and the total number of ...
v

Viet Hoang

over 5 years ago
Hi everyone, when handling a pagination query, to get both the query result and the total number of results before
limit
and
offset
is applied in 1 query, you have to use a window function:
SELECT foo
     , count(*) OVER() AS full_count
FROM   bar
WHERE  <some condition>
ORDER  BY <some col>
LIMIT  <pagesize>
OFFSET <offset>;
or in case of MySQL, the FOUND_ROWS feature:
SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100 LIMIT 10;
SELECT FOUND_ROWS();
Is there a way to achieve the same thing with Exposed ?
v
s
d
  • 3
  • 4
  • 608
Hello, I am having a problem with Ime paddings and `BottomSheetDialogFragment` . It looks like ime p...
t

Tomas Gordian

over 3 years ago
Hello, I am having a problem with Ime paddings and
BottomSheetDialogFragment
. It looks like ime padding is not applying on APIs 29 and lower.
➕ 1
t
z
a
  • 3
  • 9
  • 607
How can update one element of a list that is a val of a data class? If the data is something else, s...
u

アウスジョン(アウス)

almost 2 years ago
How can update one element of a list that is a val of a data class? If the data is something else, say and integer, you'd do
myDataClass = myDataClass.copy(myInt = newIntValue)
But say I have
MyDataClass(
val listOfInt: List<Int>
)
and I want to update
myDataClass.listOfInt[5]
?
u
d
+2
  • 4
  • 18
  • 606
Hello everyone! Does `@Parcelize` works on Pair type as well? Or in the other hand, does it work on...
d

Dr.jacky

almost 6 years ago
Hello everyone! Does
@Parcelize
works on Pair type as well? Or in the other hand, does it work on classes that implement
Serializable
. ? I tried on a sample app and it worked. But I have a crash in Crashlytics:
Fatal Exception: java.lang.RuntimeException
Parcelable encountered IOException writing serializable object (name = kotlin.Pair)
keyboard_arrow_up
🤔 1
d
f
b
  • 3
  • 8
  • 606
How can I exclude value from `@Parcelize`? I have a class where `Bar` is 3rd party library class. ``...
m

martynas

over 7 years ago
How can I exclude value from
@Parcelize
? I have a class where
Bar
is 3rd party library class.
data class Foo(
  val id : Int = 0,
  val bar : Bar? = null
)
At compile time I get
Type is not directly supported by 'Parcelize'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'
on
Bar
. That is fine by me. I’m happy to lose that value. But no combination of
@IgnoredOnParcel
and
@RawValue
did not worked for me yet - runtime error when serializing value.
m
l
k
  • 3
  • 13
  • 605
Previous99100101Next

kotlinlang

A modern programming language that makes developers happier.

Powered by