I am building a bus ticket booking app. The action bar on top appears in my AVD, but it doesn't appear in my physical device.
The themes.xml file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.BusTicketBooking" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#FF9800</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.BusTicketBooking.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.BusTicketBooking.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.BusTicketBooking.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
CodePudding user response:
Assuming you did not use your .NoActionBar theme style and does not have line of code that may interact with your action bar, have you tried checking if you have dark mode enabled in your physical phone? it might darken your current action bar color