Skip to content

Instantly share code, notes, and snippets.

View deckyfx's full-sized avatar

Decky Fiyemonda deckyfx

View GitHub Profile
deckyfx / CustomFragmentStateAdapter.kt
Last active January 6, 2020 11:06
package com.itp.enakpedia.view.widget
// This class is to handle intermittent error occurred in androidx.viewpager2.FragmentStateAdapter
// where mFragmentMaxLifecycleEnforcer might be null when call updateMaxLifeCycle method
// last version checked is androidx.viewpager2:viewpager2:1.0.0
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.Parcelable
deckyfx / ExtendedBottomNavigationView.kt
Last active March 13, 2020 23:22
Clear BottomNavigation item stack before navigate away
// first i extends BottomNavigationView class so it can attach multiple "setOnNavigationItemSelectedListener"
class ExtendedBottomNavigationView(
context : Context,
attrs : AttributeSet?= null,
defStyleAttr: Int = 0
) : BottomNavigationView(context, attrs, defStyleAttr) {
constructor (context : Context) : this(context, null, 0)