Updated action bar (created custom one) for main activity.
This commit is contained in:
@@ -48,9 +48,9 @@
|
||||
<!-- android:resource="@xml/device_filter" />-->
|
||||
</activity>
|
||||
|
||||
<!-- android:theme="@style/Theme.HPOS.ActionBar"-->
|
||||
<activity
|
||||
android:name="com.example.hpos.presentation.MainActivity"
|
||||
android:theme="@style/Theme.HPOS.ActionBar"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
||||
|
||||
@@ -28,7 +28,9 @@ class MainActivity : AppCompatActivity()
|
||||
MyViewModelFactory(applicationContext)
|
||||
)[MainViewModel::class.java]
|
||||
|
||||
// setupObservers()
|
||||
setSupportActionBar(binding.myToolbar)
|
||||
// supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
||||
setupListeners()
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/my_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
app:menu="@menu/my_menu"
|
||||
android:theme="@style/ToolbarTheme"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
style="@style/title1"
|
||||
@@ -16,7 +29,7 @@
|
||||
android:layout_margin="24dp"
|
||||
android:text="@string/select_the_test"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/my_toolbar" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cv_item1"
|
||||
|
||||
Reference in New Issue
Block a user