title: How to change button background in Android in Neumorphism design concept?
body: <p>I am working in Neumorphism based designs in my project. I am using this library <a href="https://github.com/fornewid/neumorphism" rel="nofollow noreferrer">https://github.com/fornewid/neumorphism</a> for Neumorphism effect. My issue is I can't able to change the background of the button or any other views.</p>
  <p>This is my layout file</p>
  <p><strong>activity_neumorphism.xml</strong></p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout 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;
      android:background=&quot;@drawable/screen_background_gradient&quot;
      tools:context=&quot;.NeumorphismActivity&quot;&gt;
  
  
      &lt;soup.neumorphism.NeumorphButton
          android:id=&quot;@+id/button&quot;
          style=&quot;@style/Widget.Neumorph.Button&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginBottom=&quot;36dp&quot;
          android:drawablePadding=&quot;8dp&quot;
          android:background=&quot;@drawable/res_transparent_yellow_roundedfilled_corner&quot;
          android:text=&quot;Button&quot;
          android:textColor=&quot;#FFFFFF&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;
  
      &lt;Button
          android:id=&quot;@+id/normal_button&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;button&quot;
          android:layout_marginTop=&quot;50dp&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          android:background=&quot;@drawable/res_transparent_yellow_roundedfilled_corner&quot;/&gt;
  
      &lt;TextView
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          app:layout_constraintTop_toBottomOf=&quot;@+id/normal_button&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          android:text=&quot;THIS IS NORMAL BUTTON&quot;
          android:textColor=&quot;#FFFFFF&quot;
          android:layout_marginTop=&quot;30dp&quot;
          /&gt;
  
      &lt;TextView
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          app:layout_constraintTop_toBottomOf=&quot;@+id/button&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          android:text=&quot;THIS IS Neumorphism effect BUTTON&quot;
          android:textColor=&quot;#FFFFFF&quot;
          android:layout_marginTop=&quot;30dp&quot;
          /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p>I have two buttons in this xml. One is normal button and another is neumorphism. I have set background for both but it's only applies for normal button.</p>
  <p>Below given is drawable file for background</p>
  <p><strong>res_transparent_yellow_roundedfilled_corner.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:shape=&quot;rectangle&quot;&gt;
      &lt;corners
          android:radius=&quot;10dp&quot;
          /&gt;
  
  
      &lt;gradient
          android:startColor=&quot;#C8A800&quot;
          android:endColor=&quot;#FFD80A&quot;/&gt;
  &lt;/shape&gt;
  </code></pre>
  <p>Below given is styles.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;resources&gt;
      &lt;style name=&quot;Widget.Neumorph.Button&quot; parent=&quot;Widget.AppCompat.Button&quot;&gt;
          &lt;item name=&quot;android:textAppearance&quot;&gt;?android:attr/textAppearanceButton&lt;/item&gt;
          &lt;item name=&quot;android:minHeight&quot;&gt;72dip&lt;/item&gt;
          &lt;item name=&quot;android:minWidth&quot;&gt;112dip&lt;/item&gt;
          &lt;item name=&quot;android:background&quot;&gt;@drawable/res_transparent_yellow_roundedfilled_corner&lt;/item&gt;
          &lt;item name=&quot;android:paddingLeft&quot;&gt;@dimen/design_btn_padding_left&lt;/item&gt;
          &lt;item name=&quot;android:paddingRight&quot;&gt;@dimen/design_btn_padding_right&lt;/item&gt;
          &lt;item name=&quot;android:paddingTop&quot;&gt;@dimen/design_btn_padding_top&lt;/item&gt;
          &lt;item name=&quot;android:paddingBottom&quot;&gt;@dimen/design_btn_padding_bottom&lt;/item&gt;
          &lt;item name=&quot;android:stateListAnimator&quot;&gt;@animator/button_state_list_anim_neumorph&lt;/item&gt;
          &lt;item name=&quot;android:focusable&quot;&gt;true&lt;/item&gt;
          &lt;item name=&quot;android:clickable&quot;&gt;true&lt;/item&gt;
          &lt;item name=&quot;android:gravity&quot;&gt;center_vertical|center_horizontal&lt;/item&gt;
          &lt;item name=&quot;neumorph_inset&quot;&gt;@dimen/design_default_inset&lt;/item&gt;
          &lt;item name=&quot;neumorph_shadowElevation&quot;&gt;6dp&lt;/item&gt;
          &lt;item name=&quot;neumorph_shadowColorLight&quot;&gt;#FFFFFF&lt;/item&gt;
          &lt;item name=&quot;neumorph_shadowColorDark&quot;&gt;#000000&lt;/item&gt;
          &lt;item name=&quot;neumorph_shapeType&quot;&gt;flat&lt;/item&gt;
          &lt;item name=&quot;neumorph_shapeAppearance&quot;&gt;@style/ShapeAppearance.Neumorph.Button&lt;/item&gt;
  
      &lt;/style&gt;
  
      &lt;style name=&quot;ShapeAppearance.Neumorph.Button&quot; parent=&quot;&quot;&gt;
  
          &lt;item name=&quot;background&quot;&gt; @drawable/res_transparent_yellow_roundedfilled_corner&lt;/item&gt;
  
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/1uhVX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1uhVX.jpg" alt="enter image description here" /></a></p>