Issue
I've used MaterialButton but my expected design not came. Below my xml code and style.
I've need white color of the background instead of the orange color, what I can do to achieve this. Please provide your suggestion.
// Material Design version I've used
implementation 'com.google.android.material:material:1.2.1'
**Color primary** means orange color.
<com.google.android.material.button.MaterialButton
android:id="@+id/btnWatchVideo"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/watch_video"
android:textColor="@color/colorBlack"
android:visibility="visible"
app:strokeColor="@color/colorBlack"
app:strokeWidth="2dp" />
<style name="SliderThemeBlack" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorBlack</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:screenOrientation">portrait</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
Manifest:
<activity android:name="xxx"
android:theme="@style/SliderThemeBlack" android:windowSoftInputMode="stateHidden" />
Solution
use app:backgroundTint="@color/white"
to your MaterialButton
Answered By - Priyanka
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.