Category : background-color

I have created a rectangle with a border rectangle_border.XML and no solid color. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="50dp" /> <size android:width="50dp" android:height="20dp" /> <stroke android:width="2dp" android:color="@color/White_Flight" /> and I have a button in which I set the background to rectangle_border: <com.google.android.material.button.MaterialButton android:id="@+id/loginPage" android:layout_width="87dp" android:layout_height="27dp" android:layout_marginBottom="10dp" android:background="@drawable/rectangle_border" android:text="@string/login" android:textColor="@color/dark_blue" android:textSize="8sp" app:backgroundTint="@color/White_Flight" app:layout_constraintBottom_toBottomOf="@id/home_background" app:layout_constraintLeft_toLeftOf="parent" ..

Read more

I try to design a custom button for my app by using Android Studio and a problem occur! The color of the button is using the "colorPrimary" in the Theme style. It didn’t change the color after I applied a new background. Here’s my xml code of the button: <Button android:background="@drawable/my_button_style" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1" android:textColor="@color/black" ..

Read more

I try to design a custom Button for my app by using Android Studio and a problem occurs! The color of the Button is using the colorPrimary in the Theme style. It didn’t change the color after I applied a new background. Here’s my xml code of the Button: <Button android:background="@drawable/my_button_style" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1" android:textColor="@color/black" ..

Read more

My RecyclerView is having some elements in it. Every second element should be painted in a different color. This is my function. val BackgroundElemnt: LinearLayout = itemView.findViewById(R.id.container1) fun bind(currencyPost: CurrencyPost){ if (BackgroundElemnt.get(position)%2 == 0){ BackgroundElemnt.setBackgroundColor(0xB8B8B8) } else { BackgroundElemnt.setBackgroundColor(0xFFFFFF) } CName.text = currencyPost.Name CValue.text = currencyPost.Value } Source: Android..

Read more

I’m developing an android app and i need to allow user to choose via color picker the list view items’s background color. Each listview item is a LinearLayout and i set the background color inside my adapter in this way: holder.rowLayout.setBackgroundColor(this.backgroundColor!!) All works perfectly in day mode but when the app switches to night mode ..

Read more

in my app I use BackgroundColorSpan and print the result on TextView by using the Html.java. Here is a html sample string I try to print: <html><body><p><span style=”color:#000000;”><span style=”background-color:#0;”><u>Test</u></span></span></p></body></html> When I try to print, it looks so: This issue happens only when using the TRASPARENT color, other colors are printed well. It seems the Html ..

Read more