Skip to content

Instantly share code, notes, and snippets.

View nmhung's full-sized avatar
👨‍💻

Ken nmhung

👨‍💻
View GitHub Profile
@zach-klippenstein
zach-klippenstein / DrawLayerDemo.kt
Last active October 21, 2021 10:59
Interactive demo of the drawLayer composable function. (screencap in comments)
import androidx.animation.PhysicsBuilder
import androidx.animation.Spring.DampingRatioHighBouncy
import androidx.animation.Spring.StiffnessLow
import androidx.compose.Composable
import androidx.compose.Model
import androidx.compose.remember
import androidx.ui.animation.animate
import androidx.ui.core.DrawClipToBounds
import androidx.ui.core.Text
import androidx.ui.core.drawLayer
@ValCanBuild
ValCanBuild / BottomNavigationBehavior.kt
Last active December 18, 2023 00:04
Full code of a BottomNavigationBehavior which hides itself on scroll and handles Snackbars, FAB and snapping. https://medium.com/@ValCanBuild/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e
/**
MIT License
Copyright (c) 2018 Valentin Hinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@jzeferino
jzeferino / DrawerMenuCustomFontHack.java
Created November 5, 2016 13:00
Hack custom font in drawer menu with calligraphy
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);