Created
May 22, 2018 07:26
-
-
Save rajajawahar/79618da15f4e3d8e2393334c8b7e6cca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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