There is a certain problem: when changing the background in the toolbar to black or dark using the button (that is, changing the theme), a white rectangle appears against the text and the font is reduced (see photo). Here is the styles.xml code

<style name="LightTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">#4d5056</item> <!-- colorPrimaryDark is used for the status bar --> <item name="colorPrimaryDark">#4d5056</item> <item name="colorAccent">#009688</item> </style> <style name="AMOLEDTheme" parent="Theme.AppCompat.NoActionBar"> <item name="colorPrimaryDark">#000000</item> <item name="colorPrimary">#000000</item> <item name="toolbarStyle">@style/ToolBarAMOLED</item> </style> <style name="DarkTheme" parent="Theme.AppCompat.NoActionBar"> <item name="android:background">#2b2e30</item> <item name="colorPrimaryDark">#2b2e30</item> <item name="toolbarStyle">@style/ToolBarDark</item> </style> <style name="ToolBarLight"> <item name="android:background">#ffffff</item> </style> <style name="ToolBarAMOLED"> <item name="android:background">#000000</item> </style> <style name="ToolBarDark"> <item name="android:background">#2b2e30</item> </style> 

toolbar.xml

 <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/my_toolbar" app:titleTextColor="#616266" android:minHeight="?attr/actionBarSize" android:theme="@style/ToolBarLight" android:elevation="0.5dp"> </android.support.v7.widget.Toolbar> 

This is what happens when you change the topic.

  • Question about the word theme? Then why not crop the screenshot, leaving only the necessary, so as not to force other users to search for which text we are talking about? I will not even talk about the code of the mystical button, which does not understand what it is doing. - Enikeyschik
  • I seem to have made it clear what my request for help is about, and still in question. What else is the code of the mystical button? There is nothing mystical, everything is simple and clear - SHuRik

0