VOOZH about

URL: https://www.geeksforgeeks.org/android/glow-button-in-android/

⇱ Glow Button in Android - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Glow Button in Android

Last Updated : 23 Jul, 2025

In this article, we are going to add a glowing button to our android studio app. We can use this button just as a normal button provided by android but with more advanced features and many customizations. A sample image is given below to get an idea about what we are going to do in this article.

👁 Glow Button in Android

Approach:

Step 1: Creating a New Project

To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that choose Java as the language though we are going to implement this project in Java language.

Step 2: Before going to the coding section first do some pre-task

Go to app -> res -> values -> colors.xml file and set the colors.

Step 3: Add dependency and JitPack Repository

Navigate to the Gradle Scripts > build.gradle(Module:app) and add the below dependency in the dependencies section.   

implementation 'com.github.SanojPunchihewa:GlowButton:1.0.1'

Add the JitPack repository to your build file. Add it to your root build.gradle at the end of repositories inside the allprojects{ } section.

allprojects {
 repositories {
 ...
 maven { url "https://jitpack.io/" }
 }
}

After adding this dependency sync your project and now we will move towards its implementation.  

Step 4: Designing the UI

In the activity_main.xml remove the default Text View and change the layout to Relative layout and add the GlowButton as shown below 

Properties of the GlowButton 

Attribute

Default Value 

XML

button color#8800FFbuttonColor
glow color#885BFCglowColor
unpressed glow size10dpunpressedGlowSize
pressed glow size12dppressedGlowSize
corner radius50dpcornerRadius

Step 5: Coding Part

There is nothing to do with the MainActivity.java, leave the code as default as shown below 

Output:

Comment
Article Tags:

Explore