Skip to content

Instantly share code, notes, and snippets.

@fonix232
fonix232 / BNVRouterPagerAdapter.kt
Created September 27, 2019 11:06
BottomNavigationView Conductor Adapter
import android.os.Bundle
import android.os.Parcelable
import android.util.SparseArray
import android.view.Menu
import android.view.View
import android.view.ViewGroup
import androidx.annotation.NonNull
import androidx.core.view.contains
import androidx.core.view.get
import androidx.viewpager.widget.PagerAdapter
class NavigationManager {
lateinit var router: Router
var childRouter: Router? = null
//region Generic
fun init(router: Router) {
this.router = router
if (!router.hasRootController()) {
router.setRoot(RouterTransaction.with(SplashController()))
@fonix232
fonix232 / cursor.xml
Created May 9, 2019 09:57
Material library 1.1.0-alpha06 editTextStyle demo
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:width="1dp" />
<solid android:color="?attr/colorAccent" />
</shape>
@fonix232
fonix232 / BindingAdapters.kt
Last active August 16, 2021 07:43
AutoCompleteTextView databinding
@BindingAdapter("valueAttrChanged")
fun AutoCompleteTextView.setListener(listener: InverseBindingListener?) {
this.onItemSelectedListener = if (listener != null) {
object : AdapterView.OnItemSelectedListener {
override fun onNothingSelected(parent: AdapterView<*>?) {
listener.onChange()
}
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
listener.onChange()
@fonix232
fonix232 / keybase.md
Created April 13, 2019 14:50
Keybase

Keybase proof

I hereby claim:

  • I am fonix232 on github.
  • I am fonix232 (https://keybase.io/fonix232) on keybase.
  • I have a public key ASDhgI3s99zDXBT3UWJ72nvIqrA9WDGRVbrEoGpSRTIszgo

To claim this, I am signing this object: