Юрий
06/01/2022, 5:20 PMGuilherme Delgado
06/01/2022, 5:29 PMHank
06/02/2022, 2:45 AMRemy Benza
06/02/2022, 7:45 AMConrad Kramer
06/02/2022, 11:34 PMJsonElement
or to my custom structure and I am seeing an OutOfMemoryError
every single time. Is this expected? Perhaps I am just close to the Android memory limit?Guido Perre
06/03/2022, 7:25 PMRE
06/04/2022, 3:21 AMShobana Velmurugan
06/06/2022, 7:32 AMVivek Sharma
06/07/2022, 8:43 PMandroid.view.InflateException: Binary XML file line #19 in com.vivek.marksapp:layout/item_question: Binary XML file line #19 in com.vivek.marksapp:layout/item_question: Error inflating class katex.hourglass.in.mathlib.MathView
Caused by: android.view.InflateException: Binary XML file line #19 in com.vivek.marksapp:layout/item_question: Error inflating class katex.hourglass.in.mathlib.MathView
Robby
06/08/2022, 5:12 AMRobby
06/08/2022, 7:01 AMRobby
06/08/2022, 7:01 AMMitch Ware
06/08/2022, 8:00 PMkotlin-parcelize
plugin and how best to use it in a modularized project setup:
In an effort to modularize a monolithic Android app module, step 1 (ideally) is to extract common model classes into standalone modules for re-use.
Based on the project setup, we want these new modules to be plain JVM modules (no com.android.library
plugin).
This becomes problematic if any of the model classes are Parcelable
and utilize the parcelize plugin - kotlin-parcelize
can't run in a module without applying the com.android.library
plugin.
Any recommendations on how to work around this? I can come up with two options myself, but neither one is necessarily ideal; I'm curious if anyone has other ideas or recommendations?
1. Make the common model not Parcelable, create a new Parcelize-specific model class local to the app module, and convert back and forth between the two.
2. Persist the data a different way, or use a different serialization strategy, and remove the @Parcelize
annotation on those common models.Mark Lurie
06/09/2022, 8:26 AMnuhkoca
06/10/2022, 3:15 PMval scale = when (Resources.getSystem().displayMetrics.densityDpi) {
DENSITY_MEDIUM -> 1
...
else -> 1
}
above works but below not
val scale = when (Resources.getSystem().displayMetrics.densityDpi) {
DENSITY_LOW..DENSITY_MEDIUM -> 1 -> // compile error
...
else -> 1
}
It gives Incompatible types: IntRange and Int
Vivek Modi
06/10/2022, 10:27 PMException in thread "main" java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
at ChipDataKt.main(ChipData.kt:72)
at ChipDataKt.main(ChipData.kt)
Natalia Chuzhmarova
06/11/2022, 11:40 PMSharingStarted.WhileSubscribed(5000L)
in stateIn
operator. Where does the 5000 come from? Why not zero and why exactly that number? Thanks in advance.Freedom
06/12/2022, 4:04 PMdata class UIState(
val itemlist = List<ItemEntity> = list of()
Val isLoading ......
)
If I update itemlist uiState with data fetched from network
How can I differentiate it from data fetch from cache because I need these distinctive data in 2 different recycler viewVivek Modi
06/13/2022, 9:35 AMviewmodel.kt
private val query = MutableStateFlow("")
var queryText: String
get() = query.value
set(value) {
query.value = value
}
val filteredTopics = MutableStateFlow<List<ConsulationsTopics>>(emptyList())
val filteredCategories = query
.debounce(200) // low debounce because we are just filtering local data
.distinctUntilChanged()
.combine(filteredTopics) { queryText, categoriesList ->
val criteria = queryText.lowercase()
if (criteria.isEmpty()) {
return@combine filteredTopics
} else {
categoriesList.filter { category -> category.title?.lowercase()?.let { criteria.contains(it) } == true }
}
}
Sergio C.
06/13/2022, 9:36 AMerror: [Hilt]
Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateException: Unsupported metadata version. Check that your Kotlin version is >= 1.0
How can I solve this?
using
implementation 'com.google.dagger:hilt-android:2.42'
kapt 'com.google.dagger:hilt-android-compiler:2.42'
kapt 'androidx.hilt:hilt-compiler:1.0.0'
classpath('com.google.dagger:hilt-android-gradle-plugin:2.40.1')
Kiki Abdullah
06/13/2022, 2:18 PMprivate var result: Result? = null
private lateinit var data: Data
override fun doWork(): Result {
val refreshToken = inputData.getString(REFRESH_TOKEN)
APIConfig.getAuthAPIService().refreshToken("refreshToken=$refreshToken")
.enqueue(object : Callback<LoginResponse> {
override fun onResponse(
call: Call<LoginResponse>,
response: Response<LoginResponse>
) {
if (response.isSuccessful) {
val token = response.body()?.loginData?.accessToken.toString()
Log.e("token from TokenWorker ", token)
data = workDataOf(NEW_TOKEN to token)
result = Result.success(data)
}
}
override fun onFailure(call: Call<LoginResponse>, t: Throwable) {
Log.e(TAG, "onFailure: ${t.message}")
result = Result.failure()
}
})
return result as Result
}
Slackbot
06/13/2022, 3:03 PMAdvitiay Anand
06/13/2022, 3:22 PMlistOfRides.map { ... }
freezes the app?
private fun initUserAndRides() {
// TODO: Fix this
viewModelScope.launch {
val userInstance = repository.getUser()
val listOfRides =
repository.getRides()
_user.postValue(userInstance)
withContext(Dispatchers.Default) {
val listOfUserRides = listOfRides.map { UserRide.createUserRide(userInstance, it) }
_rides.postValue(listOfUserRides)
}
}
}
Please know that UserRide.createUserRide(userInstance, it)
is computationally-expensive.
Also, repository.getUser()
and repository.getRides()
are suspend functions implemented by Retrofit.Orhan Tozan
06/14/2022, 8:52 AMUserScope
Mustafa Selim Özen
06/15/2022, 7:34 AMArtem Kopan
06/15/2022, 7:22 PMroot_folder:
- build.gradle - top build
- /project1/build.gradle
- /project2/build.gradle
I wanna update kotlin version only for project 1 but I faced with issues, because kotlin version is defined in top build file. Is there any workaround how to re-define kotlin version, android gradle plugin version only in /project1/build.gradle?Slackbot
06/15/2022, 11:38 PMjay shah
06/16/2022, 11:18 AM?.let
not thread safe?jay shah
06/16/2022, 11:29 AM?.let
and ?:
are thread safe? because using if
gives me smart cast errorchi
06/16/2022, 2:13 PMchi
06/16/2022, 2:13 PMephemient
06/16/2022, 2:15 PMchi
06/16/2022, 2:17 PMRobert Williams
06/16/2022, 2:40 PM=when {
) and when statement (when {
)