Skip to content

Instantly share code, notes, and snippets.

@Sup3r-Us3r
Created February 17, 2021 20:58
Show Gist options
  • Save Sup3r-Us3r/ca5d5b57cf77981faf779aedbdd880b3 to your computer and use it in GitHub Desktop.
Save Sup3r-Us3r/ca5d5b57cf77981faf779aedbdd880b3 to your computer and use it in GitHub Desktop.

Change: launch_background

Path: android/app/src/main/res/drawable/launch_background.xml

Change this:

<item android:drawable="@android:color/white" />

To:

<item android:drawable="@drawable/gradient_background" />

Create: color.xml

Path: android/app/src/main/res/values/colors.xml

Content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="gradientstart">#000000</color>
    <color name="gradientend">#FFFFFF</color>
</resources>

Change #000000 and #FFFFFF to your favorite colors


Create: gradient_background.xml

Path: android/app/src/main/res/drawable/gradient_background.xml

Content:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:startColor="@color/gradientstart"
        android:endColor="@color/gradientend"
        android:angle="90"/>    
</shape>

Change angle="90" to your preferred angle

@stanleyugwu
Copy link

Hey, I followed this but my app kept failing to build successfully.
When I remove xmlns:android="http://schemas.android.com/apk/res/android" from <shape> it works fine.

@Sup3r-Us3r
Copy link
Author

Hey, I followed this but my app kept failing to build successfully. When I remove xmlns:android="http://schemas.android.com/apk/res/android" from <shape> it works fine.

Hi @stanleyugwu, I remember when I made this change I used Flutter at the time, there may be some difference for Android Native or React Native, but thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment