Skip to content

Instantly share code, notes, and snippets.

Avatar

Kshitij Chauhan haroldadmin

View GitHub Profile
@haroldadmin
haroldadmin / Run 3.txt
Created Jun 5, 2019
Stacktraces for SimpleRecursiveCall benchmark of RegularStateStore
View Run 3.txt
2019-06-05 21:42:09.205 14012-14046/? E/AndroidRuntime: at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
at com.airbnb.mvrx.benchmark.RegularStateStore.flushQueues(RegularStateStore.kt:75)
View withStateSuspend.kt
protected suspend fun withStateSuspend(block: suspend (state: S) -> Unit ) {
withState { state ->
viewModelScope.launch {
block(state)
}
}
}
@haroldadmin
haroldadmin / Recycler view error stacktrace
Created Feb 16, 2019
The stacktrace of random crashes caused in MovieDB
View Recycler view error stacktrace
java.lang.IllegalArgumentException: Tmp detached view should be removed from RecyclerView before it can be recycled: EpoxyViewHolder{epoxyModel=InfoTextModel_{text=This list seems to be empty}InfoTextModel_{id=-6420196332876934318, viewType=2131558481, shown=true, addedToAdapter=false}, view=android.widget.FrameLayout{58c1263 V.E...... ......ID 0,961-1080,1308}, super=ViewHolder{d46e67f position=5 id=-6420196332876934318, oldPos=-1, pLpos:-1 removed tmpDetached no parent}} com.airbnb.epoxy.EpoxyRecyclerView{fac866f VFED..... ........ 0,852-1080,2160 #7f0a010f app:id/rvMovieDetails}, adapter:com.airbnb.epoxy.EpoxyControllerAdapter@2a8435e, layout:androidx.recyclerview.widget.GridLayoutManager@edf833f, context:com.kshitijchauhan.haroldadmin.moviedb.ui.main.MainActivity@667af76
at androidx.recyclerview.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:6165)
at androidx.recyclerview.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1451)
at androidx.recyclerv
@haroldadmin
haroldadmin / LoadingTask.kt
Created Feb 15, 2019
A naive progress bar manager for Android apps
View LoadingTask.kt
data class LoadingTask(val tag: String, val lifecycleOwner: LifecycleOwner)
data class ProgressBarNotification(
val visible: Boolean
)
@haroldadmin
haroldadmin / FABAwareScrollingBehaviour
Created Dec 27, 2018
AppBarLayout Behaviour Extension which shows/hides FAB on content scroll
View FABAwareScrollingBehaviour
public class ScrollAwareFABBehavior
extends AppBarLayout.ScrollingViewBehavior {
public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean layoutDependsOn(CoordinatorLayout parent,
View child, View dependency) {
return super.layoutDependsOn(parent, child, dependency) ||