Jordan Dixon
08/16/2019, 1:20 PMPaul Dhaliwal
08/16/2019, 3:04 PMShalom Halbert
08/16/2019, 3:27 PMJonny
08/17/2019, 5:06 PMfal
08/17/2019, 6:53 PMprivate val _navigateToSpeakerAction = MutableLiveData<Event<SpeakerId>>()
val navigateToSpeakerAction: LiveData<Event<SpeakerId>> = _navigateToSpeakerAction
it's so goddamn ugly.. i think i even prefer just a standalone getterzokipirlo
08/19/2019, 8:10 AMparas
08/19/2019, 11:30 AMobject AppModule {
@JvmStatic
@Provides
fun provideRequestOptions() = RequestOptions.placeholderOf(R.drawable.white_background)
.error(R.drawable.white_background)
@JvmStatic
@Provides
fun provideGlideInstance(application: Application, requestOptions: RequestOptions) =
Glide.with(application).setDefaultRequestOptions(requestOptions)
@JvmStatic
@Provides
fun provideAppDrawable(application: Application) =
ContextCompat.getDrawable(application, R.drawable.logo)
}
In my Activity I am using 2 injects
@Inject
lateinit var drawableLogo: Drawable
@Inject
lateinit var requestManager: RequestManager
fun setLogo() = requestManager.load(drawableLogo).into(loginLogo)
I am getting below error:-
/app/build/tmp/kapt3/stubs/debug/com/example/di/AppComponent.java:7: error: [Dagger/Nullable] android.graphics.drawable.Drawable is not nullable, but is being provided by @org.jetbrains.annotations.Nullable @Provides android.graphics.drawable.Drawable com.example.di.AppModule.provideAppDrawable(android.app.Application)
public abstract interface AppComponent extends dagger.android.AndroidInjector<com.example.BaseApplication> {
^
android.graphics.drawable.Drawable is injected at
com.example.AuthActivity.drawableLogo
com.example.AuthActivity is injected at
dagger.android.AndroidInjector.inject(T) [com.example.di.AppComponent → com.example.di.ActivityBuildersModule_ContributeAuthActivity$app_debug.AuthActivitySubcomponent]
FAILURE: Build failed with an exception.
I think this issue is somehow related to @Nullable
annotation used by the IDE but I am not sure about the exact issue, can somebody explain about this issue?morozov
08/19/2019, 3:14 PMcucharro
08/19/2019, 3:27 PMSergio C.
08/19/2019, 10:17 PMmorozov
08/20/2019, 8:09 AMribesg
08/20/2019, 9:37 AMSergey
08/20/2019, 2:23 PMritesh
08/21/2019, 12:14 PMdewildte
08/21/2019, 7:22 PMPranjal Desai
08/21/2019, 11:52 PMEric Martori
08/22/2019, 3:43 PMBilagi
08/22/2019, 4:42 PMFatal Exception: java.lang.IllegalStateException: Already in the pool!
crash Fatal Exception: java.lang.IllegalStateException: Already in the pool!
at androidx.core.util.Pools$SimplePool.release + 117(Pools.java:117)
at androidx.recyclerview.widget.AdapterHelper.recycleUpdateOp + 743(AdapterHelper.java:743)
at androidx.recyclerview.widget.AdapterHelper.recycleUpdateOpsAndClearList + 750(AdapterHelper.java:750)
at androidx.recyclerview.widget.AdapterHelper.consumePostponedUpdates + 123(AdapterHelper.java:123)
at androidx.recyclerview.widget.AdapterHelper.consumeUpdatesInOnePass + 557(AdapterHelper.java:557)
at androidx.recyclerview.widget.RecyclerView.processAdapterUpdatesAndSetAnimationFlags + 3701(RecyclerView.java:3701)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep1 + 3945(RecyclerView.java:3945)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout + 3755(RecyclerView.java:3755)
at androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations + 1888(RecyclerView.java:1888)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run + 5163(RecyclerView.java:5163)
at android.view.Choreographer$CallbackRecord.run + 916(Choreographer.java:916)
at android.view.Choreographer.doCallbacks + 718(Choreographer.java:718)
at android.view.Choreographer.doFrame + 647(Choreographer.java:647)
at android.view.Choreographer$FrameDisplayEventReceiver.run + 902(Choreographer.java:902)
at android.os.Handler.handleCallback + 836(Handler.java:836)
at android.os.Handler.dispatchMessage + 103(Handler.java:103)
at android.os.Looper.loop + 232(Looper.java:232)
at android.app.ActivityThread.main + 6802(ActivityThread.java:6802)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 1103(ZygoteInit.java:1103)
at com.android.internal.os.ZygoteInit.main + 964(ZygoteInit.java:964)
I am facing this weird crash on production. Can any one please helpkoufa
08/22/2019, 5:21 PMsuspend
using behind the scenes Call
interface and then enqueuing it do we need to wrap a retrofit call with a withContext
IO
scheduler ? As actually the enqueue
will already do the call asynchronously and we are safe with calling it on the Android mainthreadKulwinder Singh
08/23/2019, 8:15 AMCannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
while using viewModel()
function to get fragment's viewmodel ?louiscad
08/23/2019, 9:38 AMR.sometype.stuff
) generated as inline classes.dave
08/23/2019, 9:44 AMleodeleon
08/23/2019, 11:04 AMMarc Knaup
08/23/2019, 7:28 PMjava.lang.LinkageError: Method void g.y4$b.a() [akaThe method in question is] overrides final method in class Lf/n/j0 [akaapp.SomeFragment.Model.clear()
];androidx.lifecycle.ViewModel
fun clear()
in my own ViewModel
subclasses.
clear()
in Android’s ViewModel
is final
with package-visibility so the clear()
of my own subclass should be treated as a completely different function!Eric Martori
08/23/2019, 9:05 PMandroidx.lifecycle:lifecycle-runtime-ktx:$androidLifecycle
in a library project
If I add this dependency in an Android library project there is no problem, but if I add this dependency in a normal kotlin library the extension functions cannot be found.
This import statement stops working: import androidx.lifecycle.lifecycleScope
But this doesn't: import androidx.lifecycle.LifecycleOwner
I am creating a library that have a dependency on the androidx lifecycle but I don't need resources or access to any normal android.*
dependency, that's why I'm trying to use a normal kotlin library instead of an android library
Any idea on why this is happening?tateisu
08/24/2019, 9:02 AM// (A) no warning
if(Build.VERSION.SDK_INT >= 26 ) {
// using API 26+
}else if(Build.VERSION.SDK_INT >=22) {
// using API 22+
}else{
// using old API
}
// (B) waring raised.
// "Call required API level 26 (current min is 21): ..."
when{
Build.VERSION.SDK_INT >= 26 ->{
// using API 26+
}
Build.VERSION.SDK_INT >=22 ->{
// using API 22+
}
else->{
// using old API
}
}
how to avoid warnings without extra if(Build.VERSION.SDK_INT >= ... ?Kulwinder Singh
08/24/2019, 9:05 AMSingleLiveEvent
but previously i had seen some type of Event
(don't know exactly what it was called) class. i have seen that class somewhere in google architecture samples or in I/O talk but now i'm unable to find that, can you guys please let me know if SingleLiveEvent
is best for one time event or is android team provided some other solutions ?Joan Colmenero
08/25/2019, 10:29 AMMVP
apps to MVVM
(Or even create a new ones with that architecture), so I'd like to know if there's any reference github
repo that you are looking and recommend to me, that which contains Clean Architecture
with Kotlin
as : Navigation
, Coroutines
, Multi-module
, Dagger2/Koin/Kodein
, ViewModel
, LiveData
, etc...? I'd love to learn this to increase my knowledge doing clean apps. Thank you guys 😄Gunslingor
08/25/2019, 5:30 PMjermainedilao
08/26/2019, 2:25 AMProduct
item. Now, that Product
must contain category
and subcategory
. Currently, the API only returns the guid
of the category and subcategory.
Now the question is. Should the mapping of getting the category
and subcategory
from the API and putting them inside the Product
class be inside the data
module? OR I can put it inside my GetProductUseCase
?
If I choose the latter. So my usecase would look something like this:
getProducts()
.zip(repo.getCategory(), repo.getSubCategory())
.flatMap {
product.category = category
product.subcategory = subcategory
}
What’s the best practice for this?jermainedilao
08/26/2019, 2:25 AMProduct
item. Now, that Product
must contain category
and subcategory
. Currently, the API only returns the guid
of the category and subcategory.
Now the question is. Should the mapping of getting the category
and subcategory
from the API and putting them inside the Product
class be inside the data
module? OR I can put it inside my GetProductUseCase
?
If I choose the latter. So my usecase would look something like this:
getProducts()
.zip(repo.getCategory(), repo.getSubCategory())
.flatMap {
product.category = category
product.subcategory = subcategory
}
What’s the best practice for this?wasyl
08/26/2019, 7:08 AMdata
module. My reasoning is that this is a shortcoming of the API, and ideally API would return product, category and subcategory in one call. Once the API is fixed you shouldn’t have to modify your use case to adjust to the new data layer behavior.
Conversely if it was business requirement that category and subcategory must be fetched separately (e.g. because they change more often than the Product), or it was an application requirement (we need product very early and categories later on) only then I would move fetching them to some use case.jermainedilao
08/26/2019, 10:56 AM