title: Custom button with gradient outline and icon with transparent background
body: <p>I am trying to create custom buttons for my android application. These buttons are simply to add/edit/delete data on the screen. However, I would like to do some nice styling to the buttons but I am having some difficulties with the way android programming works.</p>
  <p>The idea is to have a border of a given thickness (let's say 2dp) whose color is a gradient. This implies the center being transparent however and I consider this to be one of the main difficulties. Along with this, I would like the inside of the button to have an icon representing its function.</p>
  <p>Currently, I have the gradient and its rounded edges like this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;item android:gravity=&quot;top&quot;&gt;
          &lt;shape android:shape=&quot;rectangle&quot;&gt;
              &lt;gradient
                  android:startColor=&quot;@color/colorPrimaryDark&quot;
                  android:centerColor=&quot;@color/colorAccent&quot;
                  android:endColor=&quot;@android:color/white&quot;
                  android:angle=&quot;270&quot; /&gt;
              &lt;corners android:radius=&quot;20dp&quot;/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  <p>This corresponds to what I want color-wise. However, having a transparent center seems impossible to do in a drawable resource file.</p>
  <p>Along with this issue, in my code, I have a <code>ListView</code> above a <code>LinearLayout</code> containing three buttons which this styling should eventually be applied to. However, I am unable to even change the background color of the buttons.</p>
  <p>Here is the code representing the activity:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.AddPlayersActivity&quot;
      android:orientation=&quot;vertical&quot;
      android:paddingRight=&quot;10dp&quot;
      android:paddingLeft=&quot;10dp&quot;
      android:background=&quot;@drawable/background_gradient&quot;&gt;
  
      &lt;TextView
          android:id=&quot;@+id/add_players_activity_title&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginBottom=&quot;20dp&quot;
          android:fontFamily=&quot;@font/lato_bold&quot;
          android:text=&quot;@string/app_name&quot;
          android:textAlignment=&quot;center&quot;
          android:textColor=&quot;@android:color/white&quot;
          android:textSize=&quot;36sp&quot; /&gt;
  
      &lt;TextView
          android:layout_below=&quot;@+id/add_players_activity_title&quot;
          android:id=&quot;@+id/add_players_activity_current_players&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:fontFamily=&quot;@font/lato&quot;
          android:text=&quot;@string/current_players&quot;
          android:textColor=&quot;@android:color/white&quot;
          android:textSize=&quot;20sp&quot; /&gt;
  
      &lt;ListView
          android:id=&quot;@+id/add_players_activity_player_list&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/add_players_activity_current_players&quot;
          android:layout_above=&quot;@id/add_players_activity_button_layout&quot; /&gt;
  
      &lt;LinearLayout
          android:id=&quot;@+id/add_players_activity_button_layout&quot;
          android:layout_alignParentBottom=&quot;true&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:gravity=&quot;center&quot;&gt;
  
          &lt;Button
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;match_parent&quot;
              android:layout_marginHorizontal=&quot;10dp&quot;
              android:text=&quot;Add&quot;/&gt;
  
          &lt;Button
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;match_parent&quot;
              android:layout_marginHorizontal=&quot;10dp&quot;
              android:text=&quot;Edit&quot;/&gt;
  
          &lt;Button
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;match_parent&quot;
              android:layout_marginHorizontal=&quot;10dp&quot;
              android:text=&quot;Delete&quot; /&gt;
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>None of the other StackOverflow questions have solved either of my issues. Even the most common &quot;Set the <code>style</code> attribute of the buttons&quot; one.</p>
  <p>I'm very open to solutions that could require external tools or other things so don't feel limited to internal functions. I do however feel that there has to be a way around this within the Android Studio.</p>
  <p>Thanks in advance to anyone that takes time to look into this!</p>
  <p>Here is an example as requested (Only difference is I will be using a drawable/image instead of text)</p>
  <p><a href="https://i.stack.imgur.com/xUSrF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xUSrF.png" alt="Example" /></a></p>