rtsketo
02/07/2024, 1:50 PMSam
02/08/2024, 4:34 PMColton Idle
02/13/2024, 5:10 AMColton Idle
02/14/2024, 5:22 PMcallback.onCalledBack {
if (noResponseHasComeBackAsSuccessfulYet) {
makeCallToThirdParty(it)
}
}
so basically, the fact that I use a boolean is kinda bad because the callback happens a bunch of times now. The solution? Flows! But I suck at flows. What should I use? StateFlow, just a regular flow? I think I want this to initially just work as a queue where I don't send anything to the third party if there is already something in flight. Long term, it wouldn't be bad to just send a bunch of calls to the thirdParty (its cheap) and the first one back wins. idk. Thinking out loud. Thoughts anyone?
I think I just want this
callback.onCalledBack {
addToQueue(it)
}
and then something just subscribes to the queue and handles things procedurallyStefan Oltmann
02/19/2024, 10:04 AMLionel Briand
02/19/2024, 10:08 AM<attr name="myCustomColor" format="color">#000</attr>
And then redefine it in a theme for other components to use.
<style name="MyCustomStyle">
<item name="myCustomColor">@color/white</item>
</style>
Do someone know of something equivalent to this in java or kotlin in general ?Sam
02/19/2024, 10:22 AMHalina
02/19/2024, 10:24 AMLeonardo Silveira
02/19/2024, 12:50 PMStefan Oltmann
02/24/2024, 7:04 PMEdoardo Luppi
02/25/2024, 3:35 PMfun example(): (String, String) {
return "one", "two"
}
That could be converted by the compiler to a Pair<String, String>
, for example.Youssef Shoaib [MOD]
02/25/2024, 9:08 PMinline
behaviour in Scala? Does something like this just work?
inline def forEach(inline block: Int => Unit): Unit
With block
getting mentioned only once insidejanvladimirmostert
02/27/2024, 8:05 AMT::class.hashCode
where T is an interface (or abstract class) that I control?
interface Foo {
}
inline fun <reified T : Foo> decode(byteArray: ByteArray) {
println(T::class.hashCode())
println(T::class.java.hashCode())
}
class INT4 : Foo {
companion object : Foo
}
itnoles
02/28/2024, 4:30 PMMd Sohail
03/01/2024, 3:13 AMprivate val uniqueWorkName = CountDownWorker::class._java_._simpleName_
@RequiresApi(Build.VERSION_CODES._O_)
fun enqueue(context: Context, force: Boolean = false) {
val manager = WorkManager.getInstance(context)
val requestBuilder = _PeriodicWorkRequestBuilder_<CountDownWorker>(30, TimeUnit._MINUTES_).build()
var workPolicy = ExistingPeriodicWorkPolicy._KEEP_
// Replace any enqueued work and expedite the request
if (force) {
workPolicy = ExistingPeriodicWorkPolicy._UPDATE_
}
manager.enqueueUniquePeriodicWork(
uniqueWorkName,
workPolicy,
requestBuilder
)
}
this is my code snippet, I want to schedule a work which updated the home widget after every 30 minutes. this works fine if the app is running in the foreground but if the app is closed for a long time, the widgets don't update, meaning the work manager doesn't work and it updates the widgets as soon as i open the app.
So, can you guys please help me out? what should I do in this case?Md Sohail
03/01/2024, 3:14 AMelect
03/01/2024, 10:43 AMEdoardo Luppi
03/01/2024, 10:10 PMJack Endorsing
03/02/2024, 8:50 AMMd Sohail
03/04/2024, 4:01 PMMd Sohail
03/05/2024, 11:20 AMStefan Oltmann
03/07/2024, 2:13 PMColton Idle
03/08/2024, 12:51 AMMd Sohail
03/08/2024, 4:21 AMeygraber
03/11/2024, 3:25 AMKClass
property in a field or access it every time (something like foo::class.simpleName
)?Rabia Anjum
03/12/2024, 3:03 PMadambrangenberg
03/15/2024, 9:20 PMitnoles
03/16/2024, 7:42 PMFergus Hewson
03/17/2024, 11:35 PM