Maya Gorel
08/02/2020, 4:39 AMKulwinder Singh
08/02/2020, 10:45 AMsealed class
and pass it using safeArgs or Bundle ??Sergio C.
08/02/2020, 3:48 PMUnresolved reference: getKotlinPluginVersion
Petar Marijanovic
08/03/2020, 11:52 AMSouhail Marghabi
08/03/2020, 12:36 PMRooparsh
08/03/2020, 2:10 PM@Serializable
data class ApiError(
@SerialName("error") val error: Error
)
@Serializable
data class Error(
@SerialName("code") val code: Int,
@SerialName("timestamp") val timestamp: String,
@SerialName("path") val path: String,
@SerialName("method") val method: String,
@SerialName("message") val message: List<String>
)
And this is the parsing logic:
private fun ResponseBody?.toApiError(): ApiException {
return ApiException(
Json(
JsonConfiguration(
ignoreUnknownKeys = true,
isLenient = true
)
).parse(
ApiError.serializer(), this?.charStream()
?.readText()
.orEmpty()
)
)
}
But when I print the key message
all I get is "[User not found.]"
Am I missing here something ? I am using this dependency com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.5.0
jurajsolarml
08/03/2020, 2:13 PMMichael Friend
08/03/2020, 6:24 PMliveData
coroutine builder suited for retrying/refreshing data loads or does everyone typically avoid it when you need that functionality? I’ve started using it recently to lazily load data when needed by the UI, but i cant come up with a clean way of using liveData
while also being able to refresh the data (i.e. when coming back to the screen) or retry failed operations. Typically my ViewModels look something like:
val data: LiveData<State<MyData>> = liveData {
emit(Loading)
try {
emit(getData())
catch (e: SomeEx) {
emit(Error(e))
}
}
suspend fun getData(): MyData {...}
But with this i have no way of actually retrying the operation and emitting to the LiveData again if it fails. And in the cases i need to update the data on user events like a refresh button or returning to the screen I’m stuck with the stale data.Will Nixon
08/04/2020, 12:38 PMamar_1995
08/04/2020, 1:16 PMKoya Sivaji
08/04/2020, 3:42 PM@Serializable
data class Attributes(
val home: String? = null,
val room: String? = null,
val announcement: Int? = null,
val push_notification_enabled: Int? = null
)
when I called Attributes().serialize() , the resulting json as below
"attributes":{
"home":null,
"room":"null",
"announcement":null,
"push_notification_enabled":null
}
what is expected is
"attributes":{}
Note: serialize() is an extension function as below
inline fun <reified T: Any> T.serialize(): String {
return Json.stringify(T::class.serializer(), this)
}
Basically I want to exclude all null params from serialization. I tried with by setting JsonConfiguration( encodeDefaults = false)
, but still resulting json includes null
fields from data class. Anyone has idea of how to do thatAntoine Gagnon
08/05/2020, 4:35 PMFragment
implementation both in the “normal” way (embedding it in an activity for instance) and also be able to display it as a modal.
I know it’s pretty easy with a DialogFragment
implementation to display it as a modal, but I wanted to know if it’s possible to also display a Fragment
as a modal, or maybe wrap it in a DialogFragment
?Jonathan Padilla
08/06/2020, 12:46 AMJoey
08/06/2020, 1:28 AMgeorge
08/06/2020, 6:05 AMamar_1995
08/06/2020, 12:39 PMWorkManager
with constraint Network.Connected
but it only check if device is connected to wifi or any mobile data, it won't check if there is internet connection is present or not. So is there any way to add internet connection constraint ?electrolobzik
08/06/2020, 2:27 PM@Parcelize
on a nested data class. Why this restriction is present?electrolobzik
08/06/2020, 4:57 PMpackage com.test_parcelize
import com.test_parcelize.TestNestedParcelize.*
interface TestI<T : Any>
class TestNestedParcelize : TestI<State> {
@Parcelize
data class State(
val isLoading: Boolean = false
)
}
In this example `@Parcelize`doesn’t work. I can’t import it, the code analyser breaks. if I replace TestNestedParcelize.*
to TestNestedParcelize.State
everything works. Looks like a bug in the kotlin plugin.Mehdi Haghgoo
08/07/2020, 8:21 AMSlackbot
08/07/2020, 9:49 AMArpan Sarkar
08/08/2020, 7:01 PMMergeAdapter
and the ConcatAdapter
(which is a new class available in recyclerview:1.2.0-alpha02
) ?Joshua
08/09/2020, 11:47 AM<TextView
android:id="@+id/textView6"
android:layout_width="273dp"
android:layout_height="45dp"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="32dp"
android:autoLink="web"
android:fontFamily="@font/avenir_next_regular"
android:text="@string/terms_and_conditions"
android:textAlignment="center"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3" />
<string name="terms_and_conditions">By tapping Sign in, you agree to our <a href="<http://www.google.com>" target="_top">Terms</a>. Learn how we process your data in our Privacy Policy and Cookies Policy.</string>
ZariApps
08/10/2020, 6:23 PMStavFX
08/10/2020, 6:46 PMpollux-
08/10/2020, 7:35 PMCaio Costa
08/11/2020, 12:58 AMYashovardhan
08/11/2020, 4:08 AMHalil Ozercan
08/11/2020, 8:58 AMRăzvan Roșu
08/11/2020, 9:43 AMMaurice Jouvet
08/11/2020, 3:02 PM