Mohammad Jahidul Islam
12/23/2021, 4:32 PMAndré Thiele
12/24/2021, 7:33 AMAaron Waller
12/25/2021, 5:41 PMLucca Beurmann
12/25/2021, 6:37 PMKazem Moridi
12/26/2021, 2:31 PMChetan Tuteja
12/27/2021, 7:30 AMin
check for that.
Is there any way to do the same check while ignoring case check? I am trying to fetch string array from XML. I know I can do any
check, but is there a better more elegant way?
val abc = "abc"
val random = arrayOf("ABC", "egf")
val isThere = abc in random // Prints false
app.resources.getStringArray(R.array.models).any { model -> model.equals(PrefUtils.getBuildModel(), ignoreCase = true) }
Kwangjo Lee
12/28/2021, 5:25 AMAn Tran
12/28/2021, 7:09 AMDhaval Gondaliya
12/28/2021, 11:32 AMAlex
12/28/2021, 12:44 PMAaron Waller
12/29/2021, 5:25 AMNikola Milovic
12/29/2021, 11:10 AMSergio C.
12/29/2021, 12:49 PM!is
how can we create an extension or infix function for !is
to use it like`someVar isnot String`?Chris Fillmore
12/29/2021, 4:27 PMdave08
12/30/2021, 12:35 PMeygraber
12/30/2021, 9:41 PMParcelize
for a while now. It happens very infrequently, and I've never been able to repro it.
Seems to only happen on Android 9 and Android 11 across all manufacturers (although that could be the small sample size coming into play).
The code is:
interface State : Parcelable
interface StringId {
val raw: String
}
@Parcelize
internal data class MyState(
val personId: PersonId?
) : State
@JvmInline
value class PersonId(override val raw: String) : StringId
Stacktrace in 🧵spierce7
12/31/2021, 6:48 PMplugins.withId("com.android.library") {
configure<LibraryPlugin> {
android {
}
}
}
but I can’t resolve android { }
in my build script. What do I need to configure in order to resolve this?Milan Vadhel
01/03/2022, 6:08 AMManan Kansara
01/03/2022, 9:48 AMRemon Shehata
01/03/2022, 10:01 AMfun main() {
var text: String? = "hello"
text?.let {
print(text) // option 1
print(it) // option 2
}
}
Breaker ACT
01/04/2022, 3:52 AMSanjeeviraj M
01/04/2022, 1:50 PMPanicMonster
01/04/2022, 2:38 PMfun f(){
val reportAbout = binding.createReportReportAboutTextView.text.toString()
val reportDesc = binding.createReportEditText.text.toString()
var imageURL = ""
var videoURL = ""
val timestamp = System.currentTimeMillis()/1000
var filename = UUID.randomUUID().toString()
imgref = FirebaseStorage.getInstance().getReference("/report_videos/$filename")
if(selectedVideoURI!=null)
imgref.putFile(selectedVideoURI!!).addOnSuccessListener {
imgref.downloadUrl.addOnSuccessListener {
videoURL = it.toString()
ref.setValue(ReportModel(ref.key.toString(),reportAbout ,reportDesc,imageURL,videoURL,timestamp))
}
}
// LOG.d("TAG","$videoURL")
}
whenever i print videoURL in logcat, it shows empty, but inside imgref.putFile() function it has some value. does the imgref.putFile() funciton executes last in order? how can i execute the commented line in last by order.Ihor Kviten
01/04/2022, 10:31 PMimport androidx.compose.foundation.layout.Column
package, is it correct? Because in my case I'm getting "Unresolved reference" for Row or Column
P.S. Nevermind, it fixed the issue. Strange design idea for me. What if Jetpack-Compose devs want to add new elements in the future? Isn't it better to import the whole layout package once at all?Orhan Tozan
01/05/2022, 5:39 PMritesh
01/05/2022, 6:32 PMCode With Me
plugin for Android Studio Arctic Fox
?Alderson Elliot
01/08/2022, 4:59 PMonirutlA
01/10/2022, 3:24 AMoverride fun getUsersSearch(username: String) = flow<Resource<List<UserDTO>>> {
emit(Resource.Loading())
localDataSource.getUserSearch(username).collect { fromDb ->
when (fromDb) {
is FromDb.Success -> {
val dtos = mapNullInputList(fromDb.data) { it.toDto() }
emit(Resource.Success(dtos))
}
is FromDb.Empty -> {
when (val networkState = remoteDataSource.getUserSearch(username)) {
is FromNetwork.Success -> {
val fromNetwork = networkState.body
val cache = mapNullInputList(fromNetwork) { it.toEntity() }
localDataSource.insertUsers(cache)
val dto = mapNullInputList(fromNetwork) { it.toDto() }
emit(Resource.Success(dto))
}
is FromNetwork.Error -> {
emit(Resource.Error(networkState.message))
}
}
}
}
}
}.flowOn(ioDispatcher)
Rahul Ray
01/10/2022, 7:17 AMVivek Sharma
01/10/2022, 3:46 PM@Entity
data class Note(
val title: String,
val content: String,
val timestamp: Long,
val color: Int,
@PrimaryKey val id: Int? = null
)
and when I create Note object, and passing null
to id
, what room will assign to it?
In my case it is assigning 1, 2, 3, 4...
like it is autoGenerating, is this correct what I am thinking?Vivek Sharma
01/10/2022, 3:46 PM@Entity
data class Note(
val title: String,
val content: String,
val timestamp: Long,
val color: Int,
@PrimaryKey val id: Int? = null
)
and when I create Note object, and passing null
to id
, what room will assign to it?
In my case it is assigning 1, 2, 3, 4...
like it is autoGenerating, is this correct what I am thinking?hfhbd
01/10/2022, 3:52 PMephemient
01/10/2022, 4:34 PM