chrisbanes / tivi Goto Github PK
View Code? Open in Web Editor NEWTivi is a TV show tracking Android app, which connects to trakt.tv
License: Apache License 2.0
Tivi is a TV show tracking Android app, which connects to trakt.tv
License: Apache License 2.0
The code line is here: line
The whole fragment is this:
repeat(maxAttempts - 1) { attempt ->
try {
// Clone a new ready call if needed
val call = if (isExecuted) clone() else this
return call.execute()
} catch (e: Exception) {
// The response failed, so lets see if we should retry again
if (attempt == (maxAttempts - 1) || !shouldRetry(e)) {
throw e
}
}
// Delay to implement exp. backoff
delay(nextDelay)
// Increase the next delay
nextDelay *= 2
}
// We should never hit here
throw IllegalStateException("Unknown exception from executeWithRetry")
For example, when the server is not responding, attempt == (maxAttempts - 1)
will never be true and this code always hits the last line.
When it is changed to repeat maxAttempts
times, it throws the timeout exception after the 3rd time as it should.
For instance it should prefer larger cached images over optimal sized non-cached images
Waiting on Triple-T/gradle-play-publisher#262 and then we can ship them automatically
On a clean install, getting an NPE where preview!!
is used in TmdbImageUrlProvider#selectSize()
. May be fixed via #94.
01-13 11:56:50.508 5447-5534/me.banes.chris.tivi D/TiviShowDao: Inserting show: TiviShow(id=null, title=The Grand Tour, originalTitle=null, traktId=108999, tmdbId=67557, tmdbPosterPath=null, tmdbBackdropPath=null, lastTraktUpdate=2018-01-13T11:56:50.507Z, lastTmdbUpdate=null, summary=null, homepage=null, rating=null, certification=null, country=null, network=null, runtime=null, _genres=null)
01-13 11:52:39.230 5060-5060/me.banes.chris.tivi E/AndroidRuntime: FATAL EXCEPTION: main
Process: me.banes.chris.tivi, PID: 5060
kotlin.KotlinNullPointerException
at me.banes.chris.tivi.tmdb.TmdbImageUrlProvider.selectSize(TmdbImageUrlProvider.kt:50)
at me.banes.chris.tivi.tmdb.TmdbImageUrlProvider.selectSize$default(TmdbImageUrlProvider.kt:31)
at me.banes.chris.tivi.tmdb.TmdbImageUrlProvider.getPosterUrl(TmdbImageUrlProvider.kt:26)
at me.banes.chris.tivi.ui.databinding.TiviBindingAdaptersKt$loadPoster$1.invoke(TiviBindingAdapters.kt:34)
at me.banes.chris.tivi.ui.databinding.TiviBindingAdaptersKt$loadPoster$1.invoke(Unknown Source:2)
at me.banes.chris.tivi.extensions.ViewExtensionsKt.doWhenLaidOut(ViewExtensions.kt:45)
at me.banes.chris.tivi.ui.databinding.TiviBindingAdaptersKt.loadPoster(TiviBindingAdapters.kt:33)
at me.banes.chris.tivi.databinding.ViewHolderPosterGridItemBinding.executeBindings(ViewHolderPosterGridItemBinding.java:284)
at android.databinding.ViewDataBinding.executeBindingsInternal(ViewDataBinding.java:379)
at android.databinding.ViewDataBinding.executePendingBindings(ViewDataBinding.java:351)
at com.airbnb.epoxy.DataBindingEpoxyModel.bind(DataBindingEpoxyModel.java:54)
at com.airbnb.epoxy.DataBindingEpoxyModel.bind(DataBindingEpoxyModel.java:34)
at com.airbnb.epoxy.EpoxyViewHolder.bind(EpoxyViewHolder.java:54)
at com.airbnb.epoxy.BaseEpoxyAdapter.onBindViewHolder(BaseEpoxyAdapter.java:96)
at com.airbnb.epoxy.EpoxyControllerAdapter.onBindViewHolder(EpoxyControllerAdapter.java:10)
at com.airbnb.epoxy.BaseEpoxyAdapter.onBindViewHolder(BaseEpoxyAdapter.java:14)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231)
at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:556)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610)
at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3436)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3988)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:132)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1361)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:874)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1514)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
01-13 11:52:39.231 5060-5060/me.banes.chris.tivi E/AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:758)
at android.view.View.layout(View.java:19590)
at android.view.ViewGroup.layout(ViewGroup.java:6053)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2484)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2200)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Similar to what @nickbutcher did in Plaid. He used -20% lightness, which is a good first step.
First of, I want to thank you for this awesome repo.
I am trying to grasp error handling around coroutines (still new to coroutines in general), specially when making API calls. When I launched the app with no network connectivity for the first time the app crashes:
FATAL EXCEPTION: ForkJoinPool.commonPool-worker-2
Process: me.banes.chris.tivi, PID: 11029
java.lang.IllegalStateException: Unknown exception from fetchBodyWithRetry
at me.banes.chris.tivi.trakt.calls.PopularCall.networkCall(PopularCall.kt:99)
at me.banes.chris.tivi.trakt.calls.PopularCall$networkCall$1.doResume(Unknown Source:14)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:54)
at kotlinx.coroutines.experimental.ResumeModeKt.resumeMode(ResumeMode.kt:56)
at kotlinx.coroutines.experimental.DispatchedKt.dispatch(Dispatched.kt:193)
at kotlinx.coroutines.experimental.AbstractContinuation.onCompletionInternal$kotlinx_coroutines_core(AbstractContinuation.kt:86)
at kotlinx.coroutines.experimental.JobSupport.completeUpdateState$kotlinx_coroutines_core(Job.kt:704)
at kotlinx.coroutines.experimental.JobSupport.updateState$kotlinx_coroutines_core(Job.kt:655)
at kotlinx.coroutines.experimental.AbstractContinuation.resumeImpl(AbstractContinuation.kt:99)
at kotlinx.coroutines.experimental.CancellableContinuationImpl.resumeUndispatched(CancellableContinuation.kt:272)
at kotlinx.coroutines.experimental.rx2.SchedulerCoroutineDispatcher$scheduleResumeAfterDelay$disposable$1.run(RxScheduler.kt:44)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:571)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
When dealing with coroutines, is the correct approach to just use try{}
catch{}
? Also, this is more of a general question, coroutines are meant to be a "replacement" for Rx, right? Meaning, if you had something that returned Flowable<T>
, Maybe<T>
, SIngle<T>
, Observable<T>
, etc and you want to use coroutines, you can just deal with the underlying T
( as you did when you switched from Rx to coroutines)
Hi, I love your app, it has helped me a lot, but I am lazy to get the keys and test it on my phone. Most of DataBinding I learned by copying and modifying things from your app. Today, I implemented some new things and had a very weird issue: Glide displaying wrong images. After a lot of debugging, I found the doOnLayout wasn't being called when recycling. It works on some cases for me, but not on all of them, and my setup is similar to yours (mvrx, epoxy, databinding, etc). I removed it, and everything got fine.
So... It is not an "issue", but I also have nowhere else to ask and you are a bigger expert on databinding than me: why do you use the doOnLayout? Is it safe to remove it? Most tutorials don't include it, but you are a bigger expert than most people.
Why was the ktlint chosen as the static code analyzer? What's about another more powerful tool like detekt?
Hello @chrisbanes
There is a problem with loading posters (especially when scrolling down and go up again, the poster images get changes to different one than the movie).
The sorting option is not persisted currently, it should be:
Please take a look at this gif first and focus on the top notch where the Toolbar is drawn, before and after the animation:
As you can see, right after opening the detail for Bigbang Theory, the inset top is correctly set (details_status_bar_anchor height is equal to the height of top notch in this device),
After I scroll it, somehow this height is reset to default (24dp) and it results in that the toolbar is cut by the top notch.
Device detail: LG G7 (Android 8.0, so no DisplayCutout yet, but windows insets are correctly set).
Below are some (hopefully) useful log screenshot
ShowDetailsFragment#onViewCreated
Scroll up and observe the onLayout in TintingToolbar (I override this method for debugging only)
HomeFragmentViewModel
is retained after screen rotated and HomeActivity
recreated.
But HomeFragmentViewModel
still hold old HomeNavigator
(alsoHomeActivity
) instance.
Animation on home screen when pressing "MORE" don't like your video which you showed ?
This project should take advantage of the Kotlin + buildSrc for better gradle dependency management
Decided to try out your app and try to learn some of the things you've been building here. The app crashes when scrolling a long list:
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: io.reactivex.exceptions.CompositeException: 2 exceptions occurred.
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeCallbackObserver.onError(MaybeCallbackObserver.java:86)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.flowable.FlowableElementAtMaybe$ElementAtSubscriber.onError(FlowableElementAtMaybe.java:94)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.onError(MaybeConcatArray.java:100)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeFromSingle$FromSingleObserver.onError(MaybeFromSingle.java:82)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onError(SingleFlatMap.java:90)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.lang.Thread.run(Thread.java:764)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: ComposedException 1 :
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: java.lang.IllegalStateException: closed
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at okhttp3.internal.http1.Http1Codec$FixedLengthSource.read(Http1Codec.java:393)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at okio.RealBufferedSource.readAll(RealBufferedSource.java:163)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at retrofit2.Utils.buffer(Utils.java:304)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:204)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:91)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.extensions.RetrofitCallObservable.subscribeActual(RetrofitExtensions.kt:47)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.Observable.subscribe(Observable.java:10910)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.extensions.BodyObservable.subscribeActual(RetrofitExtensions.kt:83)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.Observable.subscribe(Observable.java:10910)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.Single.subscribe(Single.java:2779)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at java.lang.Thread.run(Thread.java:764)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: ComposedException 2 :
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: java.lang.IllegalStateException: Cannot invoke setValue on a background thread
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at android.arch.lifecycle.LiveData.assertMainThread(LiveData.java:404)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at android.arch.lifecycle.LiveData.setValue(LiveData.java:289)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel.onError(EntryViewModel.kt:74)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel.access$onError(EntryViewModel.kt:30)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel$data$2$updateCall$1$1$1$1$2.invoke(EntryViewModel.kt:46)
10-13 11:57:33.856 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel$data$2$updateCall$1$1$1$1$2.invoke(EntryViewModel.kt:30)
10-13 11:57:33.857 4764-5072/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModelKt$sam$Consumer$c58a7660.accept(EntryViewModel.kt:0)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeCallbackObserver.onError(MaybeCallbackObserver.java:83)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.flowable.FlowableElementAtMaybe$ElementAtSubscriber.onError(FlowableElementAtMaybe.java:94)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.onError(MaybeConcatArray.java:100)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeFromSingle$FromSingleObserver.onError(MaybeFromSingle.java:82)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onError(SingleFlatMap.java:90)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
10-13 11:57:33.858 4764-5072/me.banes.chris.tivi W/System.err: at java.lang.Thread.run(Thread.java:764)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: io.reactivex.exceptions.CompositeException: 2 exceptions occurred.
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeCallbackObserver.onError(MaybeCallbackObserver.java:86)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.flowable.FlowableElementAtMaybe$ElementAtSubscriber.onError(FlowableElementAtMaybe.java:94)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.onError(MaybeConcatArray.java:100)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.maybe.MaybeFromSingle$FromSingleObserver.onError(MaybeFromSingle.java:82)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onError(SingleFlatMap.java:90)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: at java.lang.Thread.run(Thread.java:764)
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: ComposedException 1 :
10-13 11:57:33.858 4764-4803/me.banes.chris.tivi W/System.err: java.lang.IllegalStateException: closed
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at okhttp3.internal.http1.Http1Codec$FixedLengthSource.read(Http1Codec.java:393)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at okio.RealBufferedSource.readAll(RealBufferedSource.java:163)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at retrofit2.Utils.buffer(Utils.java:304)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:204)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:91)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.extensions.RetrofitCallObservable.subscribeActual(RetrofitExtensions.kt:47)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.Observable.subscribe(Observable.java:10910)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.extensions.BodyObservable.subscribeActual(RetrofitExtensions.kt:83)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.Observable.subscribe(Observable.java:10910)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.Single.subscribe(Single.java:2779)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at java.lang.Thread.run(Thread.java:764)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: ComposedException 2 :
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: java.lang.IllegalStateException: Cannot invoke setValue on a background thread
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at android.arch.lifecycle.LiveData.assertMainThread(LiveData.java:404)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at android.arch.lifecycle.LiveData.setValue(LiveData.java:289)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel.onError(EntryViewModel.kt:74)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel.access$onError(EntryViewModel.kt:30)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel$data$2$updateCall$1$1$1$1$2.invoke(EntryViewModel.kt:46)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModel$data$2$updateCall$1$1$1$1$2.invoke(EntryViewModel.kt:30)
10-13 11:57:33.859 4764-4803/me.banes.chris.tivi W/System.err: at me.banes.chris.tivi.util.EntryViewModelKt$sam$Consumer$c58a7660.accept(EntryViewModel.kt:0)
There are places where tivi uses Fragment
instance as a databinding lifecycle owner.
It's recommended to use viewLifecycleOwner
instead of this
because right now the observer outlives the view.
First of all, thanks for this project and I am a great admirer of your work.
I am making my effort to go through the code by putting the debugger at every line of project but hadn't achieved any success so far but certainly, I will.
It would be great if you can provide some description or diagram how the app is working or to whom it is interacting, it will be a great benefit for others like me like this buffer app(https://github.com/bufferapp/android-clean-architecture-boilerplate)
I had gone through the same issue #151 but still I was unable to understand the app interaction.
I hope I will listen very shortly, from you guys.
Hello
I came across your awesome project and I wanted to help contribute by creating a new logo Proposal for your amazing project based on your already existing logo...
I wanted to create a logo that is CLEAN and feels UNIQUE and also has an IDENTITY to it...
If you find the logo good enough and you like it, please do let me know and i will send you all the files you need both the vector files all for free...
Gradle sync fails in Android Studio with below error.
This version of Android Studio cannot open this project, please retry with Android Studio 3.5 or newer.
Steps to produce
Version
Android Studio 3.4
Build #AI-183.5429.30.34.5452501, built on April 10, 2019
JRE: 1.8.0_152-release-1343-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.4
I would request you to please add a documentation/write a blog so that developers can understand and learn from your advance code.
It would be really helpful.
There's a race condition somewhere in first load. It's something to do with Trending and Popular having the same show, therefore the data is loaded twice.
io.reactivex.exceptions.OnErrorNotImplementedException: FOREIGN KEY constraint failed (code 787)
at io.reactivex.internal.observers.EmptyCompletableObserver.onError(EmptyCompletableObserver.java:50)
at io.reactivex.internal.operators.completable.CompletableFromSingle$CompletableFromSingleObserver.onError(CompletableFromSingle.java:41)
at io.reactivex.internal.operators.single.SingleDoOnSuccess$DoOnSuccess.onSuccess(SingleDoOnSuccess.java:56)
at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:782)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.arch.persistence.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.java:80)
at android.arch.persistence.room.EntityInsertionAdapter.insertAndReturnId(EntityInsertionAdapter.java:114)
at me.banes.chris.tivi.data.TiviShowDao_Impl.insertPopularShows(TiviShowDao_Impl.java:309)
at me.banes.chris.tivi.calls.PopularCall.saveEntry(PopularCall.kt:67)
at me.banes.chris.tivi.calls.PaginatedTraktCall$savePage$1.invoke(PaginatedTraktCall.kt:90)
at me.banes.chris.tivi.calls.PaginatedTraktCall$savePage$1.invoke(PaginatedTraktCall.kt:34)
at me.banes.chris.tivi.util.DatabaseTxRunnerKt$sam$Runnable$e5ac0046.run(DatabaseTxRunner.kt:0)
at android.arch.persistence.room.RoomDatabase.runInTransaction(RoomDatabase.java:238)
at me.banes.chris.tivi.util.DatabaseTxRunner.runInTransaction(DatabaseTxRunner.kt:25)
at me.banes.chris.tivi.calls.PaginatedTraktCall.savePage(PaginatedTraktCall.kt:87)
at me.banes.chris.tivi.calls.PaginatedTraktCall$loadPage$4.accept(PaginatedTraktCall.kt:60)
at me.banes.chris.tivi.calls.PaginatedTraktCall$loadPage$4.accept(PaginatedTraktCall.kt:34)
at io.reactivex.internal.operators.single.SingleDoOnSuccess$DoOnSuccess.onSuccess(SingleDoOnSuccess.java:53)
... 8 more
See google/dagger#1183 for issues injecting workers.
Hello
I have been following this project for a while.
Just minor thing is not implemented.
On ShowDetailsFragment, the toolbar's navigationOnClick is missing.
Just wanted to let you know.
Using the RoomTransactionRunner in tests is somehow causing issues. Test 'testEpisodeWatches_sameEntries' for example, it will keep running forever without throwing any error. Removing the RoomTransactionRunners used in that test 'solves' the problem.
Environment
Android Studio: 2.3.3
OS version: MacOS 10.12.6
Problem:
Steps to reproduce:
Install the current stable release of Android Studio.
Open a quickstart-android project.
Try to build the project.
Observed Results:
Gradle 'tivi' project refresh failed
Error:This Gradle plugin requires Studio 3.0 minimum
Trakt has a nice and easy API for this
The point where the card snaps elevation is wrong. Caused by the top inset being larger than 24dp, thus the snap point is incorrect.
I've spotted some places like the HomeActivity
having variables defined as nullable, f.e
private var viewModel: HomeActivityViewModel? = null
Is there a reason behind it? I think they could be made lateinit
vars and avoid the nullability.
I'd be glad to give a hand in the project, so I'd be glad if you could give some insight about this approach. Cheers!
Places for it to be displayed (there may be others):
Glide won't load images from TMDB due to the SSLHandshakeException.
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Hi!
I got this crash belowe at TraktManager startAuth(). I think the problem, that the context provided by dagger is not an Activity, as this openid isssue suggests.
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? at android.app.ContextImpl.startActivity(ContextImpl.java:672) at android.app.ContextImpl.startActivity(ContextImpl.java:659) at android.content.ContextWrapper.startActivity(ContextWrapper.java:331) at net.openid.appauth.AuthorizationService.performAuthorizationRequest(AuthorizationService.java:222) at net.openid.appauth.AuthorizationService.performAuthorizationRequest(AuthorizationService.java:142) at me.banes.chris.tivi.trakt.TraktManager.startAuth(TraktManager.kt:85) at me.banes.chris.tivi.home.HomeFragmentViewModel.startAuthProcess(HomeFragmentViewModel.kt:65) at me.banes.chris.tivi.home.HomeFragmentViewModel.onLoginItemClicked(HomeFragmentViewModel.kt:61) at me.banes.chris.tivi.home.HomeFragment.onMenuItemClicked(HomeFragment.kt:71) at me.banes.chris.tivi.home.discover.DiscoverFragment$onViewCreated$$inlined$apply$lambda$1.onMenuItemClick(DiscoverFragment.kt:115)
When I was reading the code I noticed that you are handling errors in RxJava streams using doOnError
like here:
The problem is that doOnError()
allows for side effects, but it passes the exception through downstream. So in this case I think that you'll get an OnErrorNotImplementedException
when loadNextPage()
emits an error.
I am facing this error :
Error:Execution failed for task ':app:fabricGenerateResourcesDebug'.
> Crashlytics Developer Tools error.
due to missing Fabric API Key
. Readme should be updated regarding this.
After screen rotation a new ViewModel is always provided for fragments. Moving the creation of the model from onAttach to onCreate solves the problem.
If the fragment is already in place, we do not need to replace (and lose the VM).
Once https://issuetracker.google.com/issues/76490033 is fixed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.