Skip to content

Instantly share code, notes, and snippets.

@nomisRev
Created October 30, 2016 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nomisRev/ec2262f9dc9c291270cf0ad48e47d594 to your computer and use it in GitHub Desktop.
Save nomisRev/ec2262f9dc9c291270cf0ad48e47d594 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
private var toolBar: Toolbar? = null
private var container: ViewGroup? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
coordinatorLayout {
fitsSystemWindows = true
appBarLayout {
toolBar = toolbar {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) elevation = 4f
}.lparams(width = matchParent, height = actionBarSize())
}.lparams(width = matchParent)
container = frameLayout()
.lparams(width = matchParent, height = matchParent) {
behavior = AppBarLayout.ScrollingViewBehavior()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment