Category : android-theme

I have created a transparent activity with following style: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:background">#00000000</item> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowIsFloating">true</item> <item name="android:windowAnimationStyle">@android:style/Animation</item> </style> </resources> But I am getting black background when I open bottomsheet in that activity. Why I am getting this issue Source: Android..

Read more

In newer version of Android Studio In values directory there is theme.xml and theme.xml(night) Can any point out differences between them? What is specific use of colorPrimary, colorPrimaryVariant, colorOnPrimary and colorSecondary, colorSecondaryVariant, colorOnSecondary in these themes. res/values/colors.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="purple_200">#FFBB86FC</color> <color name="purple_500">#FF6200EE</color> <color name="purple_700">#FF3700B3</color> <color name="teal_200">#FF03DAC5</color> <color name="teal_700">#FF018786</color> <color name="black">#FF000000</color> <color name="white">#FFFFFFFF</color> ..

Read more

In general, I implemented a style change in my application, but after onDestroy() the application style is requested, and I don’t know how to save it. How to save the selected application theme after closing the application. The theme is changed as follows, by clicking in the themes.xml file, certain attributes are applied. <resources xmlns:tools="http://schemas.android.com/tools"> ..

Read more

I have a confusion with the way inheritance work for styles in android <style name="TextAppearance.Gilroy" parent="TextAppearance.MaterialComponents.Headline1"> </style> <style name="TextAppearance.Gilroy.Extrabold" parent="TextAppearance.Gilroy"> <item name="fontFamily">@font/gilroy_bold</item> <item name="android:textStyle">bold</item> </style> in this case TextAppearance.Gilroy is inheriting from TextAppearance.MaterialComponents.Headline1 and can override the default values declared in the parent, also TextAppearance.Gilroy.Extrabold is inheriting from TexhAppearance.Gilroy but which line is possible for ..

Read more

I have a ConstraintLayout in which I have placed a ProgressBar right in the center. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <ProgressBar android:id="@+id/progress_bar" style="@style/ProgressBarStyle"/> </androidx.constraintlayout.widget.ConstraintLayout> All four constraints are located themes.XML file in ProgressBarStyle: <style name="ProgressBarStyle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="layout_constraintBottom_toBottomOf">parent</item> <item name="layout_constraintEnd_toEndOf">parent</item> <item name="layout_constraintStart_toStartOf">parent</item> <item name="layout_constraintTop_toTopOf">parent</item> </style> Even if the ProgressBar is displayed in ..

Read more