Created
October 30, 2016 17:24
-
-
Save nomisRev/ec2262f9dc9c291270cf0ad48e47d594 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