1

I am the newly in android studio. Just reading and studying in regards to the gradient usage. Is it possible to use gradient colour for the floating button for it to fill the whole shape? As well, is it possible to create the text view style using gradient colour?

Nsem
  • 21
  • 2
  • yes you can apply gradients on every where. So which type of gradient you want and where?. – BlackBlind May 10 '20 at 09:40
  • One of the places I would like to have as a background colour for floating action button as per answer below, copied my code. – Nsem May 10 '20 at 09:52
  • do you have any idea which type of gradient you want in FAB. Any resource – BlackBlind May 10 '20 at 09:57
  • Basically, i want to have the button with the gradient color ( that would be either like button with the plus inside, or with arrows to go back and forward) – Nsem May 10 '20 at 10:05
  • I describe by background colour like this: Then from floating action buttons, I selected the icon ic_menu_add Actual floating action button is described like this – Nsem May 10 '20 at 10:06
  • Then from floating action buttons, I selected the icon ic_menu_add Actual floating action button is described like this – Nsem May 10 '20 at 10:06
  • For style I have – Nsem May 10 '20 at 10:07
  • post all of these in question then show me your output with screen shot and then specify what should you cange in that output – BlackBlind May 11 '20 at 18:39

1 Answers1

0

of course create a background.xml drawable folder and write the code below

<?xml version="1.0" encoding="utf-8"?>
   <shape>
           <gradient android:startColor="@color/colorAccent"
               android:centerColor="@color/colorAccent"
               android:endColor="@color/black"
                android:angle="90"/>
            <corners android:radius="10dp"></corners>
        </shape>
Firat
  • 43
  • 8