<application android:theme = "@style/Theme.AppCompat.Light.NoActionBar"/>
<reosource xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name = "Theme.IntoDig" parent = "Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- chande parent -> ...DayNight.NoActionBar -->
<!-- Primary brand color. -->
<item name = "colorPrimary">@color/purple_500</item>
<item name = "colorPrimary">@color/purple_700</item>
<style name = "Themename" parent "Theme.AppCompat.NoActionBar">
<item name = "android:windowBackground">@color/white</item>
</style>
<style name = "Theme.intoDig.NoActionBar">
<item name = "windowActionBar">false</item>
<item name = "windowNoTitle">true</item>
</style>
<resources>
<style name = "AppTheme" parent = "Theme.AppCompat.Light.DarkActionBar">
<item name = "windowActionBar">false</item>
<item name = "windowNoTitme">true</item>
<item name = "android:windowFullscreen">false</item>
</style>
</resources>
<activity
android:name = ".ui.chatting.ChattingAcitivity"
android:exported = "false"
android:theme = "@style/Theme.intoDig.NoActionBar"
android:windowSoftInputMode="adjustUnspecified"/>
AppBarLayout: Toolbar를 포함하여 Toolbar이외에 액티비팉 상단을 조금 더 넓게 구성하거나 이미지를 포함하는 등 다양하게 구성할 수 있음
<com.google.android.material.appbar.AppBarLayout
android:layout_width = "match_parent"
android:layout_height="wrap_content"
android:theme = "@style/Theme.intoDig.AppBarOverlay"
app:elevation = "8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
<androidx.appcompat.widget.Toolbar
android:id = "@+id/toolbar"
android:layout_width = "match_parent"
andorid:layout_height = "?attr/actionBarSize"
android:background="?attr/colorPrimary/>
</com.google.android.material.appbar.AppBarLayout>
val toolbar = binding.Toolbar.toolbar
setSupportActionBar(toolbarBodyTemplate)
supportActionBar?.setDisplayHomeAsUpEnabled(true) // 뒤로가기 버튼 활성화
supportActionBar?.setDisplaySHowTitleEnabled(false) // 액션바에 표시되는 제목 표시여부. flase를 해야 custom한것 표시
<?xml version"1.9" encoding="utf-8"?>
<menu xmls:android="http://schemas.android.com/apk/res/android"
xmlns:app = "http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/toolbar_info"
app:showAsAction = "always"
android:icon="@drawable/ic_information_white_30"
android:title="@string/title_addchat" />
</menu>
override fun onOptionsItemSeleted(item:MenuItem): Boolean {
when(item.itemId) {
android.R.id.home ->{ // 뒤로가기 버튼
finish()
}
R.id.toolbar_info -> { // 툴팁
val view = findVIewById<R.id.toolbar_info) // 툴팁 띄우기 위해서는 view가 필요함
balloon.showAlignBottom(view)
}
}
return super.onOptionItemSeleted(item)
}