Category : colors

Here’s my 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="white">#FFFFFFFF</color> </resources> I think this was one of the new features in the new Android Studio Version (because I updated Android Studio recently). Can someone please tell me where colorAccent went? Source: Android..

Read more

I dynamically create textInputlayout and add it to my lienarlayot using the code below: LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); params.setMargins(10,10,10,10); til.setLayoutParams(params); til.setHint("Label"); til.setId(i+1); TextInputEditText et = new TextInputEditText(til.getContext()); et.setSingleLine(true); til.addView(et); til.setBoxCornerRadii(R.dimen.CornerRadious,R.dimen.CornerRadious,R.dimen.CornerRadious, R.dimen.CornerRadious); information.addView(til); I want to change boxStrokeColor , CursorColor and HintTextColor. I use the following code block to change boxStrokeColor til.setBoxStrokeColor(getResources().getColor(R.color.white)); But that ..

Read more

i tried to design butten by drawable xml file corner are working properly but color is not working properly <Button android:layout_width="180dp" android:layout_height="wrap_content" android:background="@drawable/but_draw" android:text="Login" android:textSize="14dp" android:layout_gravity="center" android:layout_marginTop="20dp"/> <?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> <color name="purple">#564999</color> <color name="blue">#59b7e0</color> </resources> <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> ..

Read more

I am creating a simple quiz app. And want to change the color of button to green if answer is correct, and to red if answer is incorrect.If i change color through xml of layout it is normally changed, but when I write if (option1.getText().equals(correctAnswer)){ option1.setBackgroundColor(R.color.green); Toast.makeText(this, "Answer is correct", Toast.LENGTH_SHORT).show(); } color changes but ..

Read more

i have created a signup page and i select the hint color blue now i want to change the color of text which is entered in the edit text please tell me how can i change the color of text here is the code of my xml file <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" ..

Read more