Category : android-styles

I am creating a widget, but when I add app:tint="@color/white" it’s showing tint in the Design Preview but when the widget loads the tint is not applied, the icon is still black, i need to add white tint to the imageview. <ImageView android:id="@+id/imageView1" android:layout_width="30dp" android:layout_height="30dp" android:layout_alignParentEnd="true" android:elevation="10dp" android:src="@drawable/ic_explore_01" app:tint="@color/white" /> Source: Android..

Read more

TextView with custom color attribute not renders in Layout preview. I have defined attributes attr.xml inside values folder. <attr name="secondary_text_color" format="color"/> And override this color in style xml for dark and light themes. Inside TextView: android:textColor="?attr/secondary_text_color" Layout preview show error, however the app work as expected. java.lang.NullPointerException at android.widget.TextView.updateTextColors(TextView.java:5773) at android.widget.TextView.setHintTextColor(TextView.java:5047) at android.widget.TextView.applyTextAppearance(TextView.java:4053) at android.widget.TextView.(TextView.java:1604) ..

Read more

I have com.google.android.material.textfield.MaterialAutoCompleteTextView wrapped by a com.google.android.material.textfield.TextInputLayout and I managed to get it to the point where is almost looks like a Material Outlined Dropdown Menu. Right now I see a weird background on the top right label and extra black space on the top and bottom of the drop down and I can’t seem ..

Read more

I am trying to automatic set up TextView style. I managed to set text appearance but somehow only margin top and margin bottom is ignored. <style name="TextViewStyle" parent="@android:style/Widget.TextView"> <item name="android:textColor">?android:textColorPrimary</item> <item name="android:textColorLink">?colorPrimary</item> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> </style> <style name="TextViewStyle.Medium"> <item name="android:textSize">@dimen/text_medium</item> </style> <style name="TextViewStyle.Medium.Normal"> <item name="android:fontFamily">@font/open_sans</item> </style> <style name="main_steps_with_icon" parent="TextViewStyle.Medium.Normal"> <item name="android:layout_marginStart">@dimen/margin_big</item> // 24dp <item ..

Read more

How can I use different colors for hint and error text in error state? I used material components and I can’t understand how it can be done. I expect this result But i have My styles <style name="StyleTextInput" parent="Widget.MaterialComponents.TextInputLayout.FilledBox"> <item name="android:textCursorDrawable">@null</item> <item name="boxBackgroundColor">@color/window_background</item> <item name="boxBackgroundMode">filled</item> <item name="background">@color/window_background</item> <item name="android:background">@color/window_background</item> <item name="hintTextColor">@color/grey_alpha_color_50</item> <item name="android:textColorHint">@color/grey_alpha_color_50</item> <item name="hintTextAppearance">@style/Hint.TextAppearance</item> ..

Read more