Skip to content

Instantly share code, notes, and snippets.

View haroldadmin's full-sized avatar

Kshitij Chauhan haroldadmin

View GitHub Profile
@haroldadmin
haroldadmin / Run 3.txt
Created June 5, 2019 16:17
Stacktraces for SimpleRecursiveCall benchmark of RegularStateStore
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)
protected suspend fun withStateSuspend(block: suspend (state: S) -> Unit ) {
withState { state ->
viewModelScope.launch {
block(state)
}
}
}
@haroldadmin
haroldadmin / Recycler view error stacktrace
Created February 16, 2019 12:45
The stacktrace of random crashes caused in MovieDB
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 February 15, 2019 08:33
A naive progress bar manager for Android apps
data class LoadingTask(val tag: String, val lifecycleOwner: LifecycleOwner)
data class ProgressBarNotification(
val visible: Boolean
)
@haroldadmin
haroldadmin / FABAwareScrollingBehaviour
Created December 27, 2018 07:56
AppBarLayout Behaviour Extension which shows/hides FAB on content scroll
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) ||