HOW TO MAKE GRADIENT COLOR IN ANDROID STUDIO
YOU CAN MAKE drawable resource as gradient color and you can use it as background screen or background for dialog in your app android studio
if you use android studio to make apps java or Kotlen
the first step is go to drawable directory in your project:
the second step : create new resource drawable file and name it myfirstgradient
and click save or ok
open the file that you have been created and paste those xml code into the file my_firest_gradient.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"><gradientandroid:angle="135"android:endColor="#B84F72"android:startColor="#491551" /><corners android:radius="15dp"/></shape>
NOW :
you can use the myfirstgradint.xml drawable as back ground in your project also you can copy it to another projects
this example show the steps how to use it as background in your project
in your project go to Layout Directory and open first file your activity main. xml layout
- choose one of the widget for example linear layout or any widget
- click in the mouse on the widget
- go to the right screen to the properties of the widget
- filter to background
- and choose myfirstgradient
- click enter
- and see the result
2 -
3 -
the result :