Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- vaadin
- MSSQL
- es6
- react
- xPlatform
- table
- plugin
- Sqoop
- Eclipse
- Android
- IntelliJ
- Express
- 보조정렬
- SPC
- window
- 공정능력
- Java
- R
- mybatis
- GIT
- Kotlin
- NPM
- Python
- mapreduce
- hadoop
- SQL
- JavaScript
- SSL
- Spring
- tomcat
Archives
- Today
- Total
DBILITY
android include viewBinding 본문
반응형
보통하는 Activity에서 하는 것처럼 필요한 Activity에서 하면 된다.
toolbar Layout을 만들고 그걸 Activity에서 include
class MainActivity : AppCompatActivity() {
private val binding by lazy {
ActivityMainBinding.inflate(layoutInflater)
}
private val bindingToolbar by lazy {
ToolbarLayoutBinding.inflate(layoutInflater)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//enableEdgeToEdge()
setContentView(binding.root)
/*ViewCompat.setOnApplyWindowInsetsListener(binding.drawerLayout) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}*/
setSupportActionBar(bindingToolbar.toolbar)
}
}
반응형
'android > kotlin' 카테고리의 다른 글
android dark mode 비활성화 (0) | 2024.04.04 |
---|---|
android retrofit2 (0) | 2024.04.01 |
android room database (0) | 2024.03.29 |
android viewmodel 에서 constructor arguments (0) | 2024.03.29 |
android migration kapt to ksp (0) | 2024.03.29 |
Comments