![]() |
VOOZH | about |
Neumorphic theme is one of the beautiful which is seen used in many of the apps. It is a beautiful theme in which we can add a little elevation to the views of our layout components to make it look beautiful. Below is the screenshot in which you can get to see the sample layout which is made with the help of Neumorphic Theme.
👁 ImageAttributes | Usage |
|---|---|
| background_color | this is used to add background color to our view. |
| corner_radius | this is used to add corner radius to our view. |
| shape | this is used to provide shape to our view. |
| state | this is used to change the state of view such as flat, pressed, concave and convex. |
Step 1: Create 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 select Java as the programming language.
Step 2: 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.Borutsky:neumorphism-android:1.0.0-alpha01'
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 3: Working with the activity_main.xml file
Navigate to the app > res > layout > activity_main.xml and add the below code to that file. Below is the code for the activity_main.xml file.
As we are working with the layout file only so we don't have to add any code in our MainActivity.java file. Now run your app and see the output of the app.
Output:
👁 Image