thelumiereguy / Neumorphismview Android
Licence: apache-2.0
A Neumorphism library for Android, supporting customizations for shadows/highlights to selected child views.
Stars: ✭ 121
Programming Languages
kotlin
9241 projects
Projects that are alternatives of or similar to Neumorphismview Android
Parallaxview
Parallax view for android apps written in Kotlin
Stars: ✭ 70 (-42.15%)
Mutual labels: customview
Stepbarview
Step Bar View (make your own customized StepBar)
Stars: ✭ 97 (-19.83%)
Mutual labels: customview
Ticketview
An Android library to implement TicketView in android with normal, rounded and scallop corners
Stars: ✭ 1,180 (+875.21%)
Mutual labels: customview
Statelayout
StateLayout is a simple-use Android layout library which handles Loading, Content and Error states
Stars: ✭ 88 (-27.27%)
Mutual labels: customview
Headerview
Create an header for com.google.android.material.navigation.NavigationView
Stars: ✭ 107 (-11.57%)
Mutual labels: customview
Arcchartview
Arc Chart View (Draw Creative Statistic Arc Charts)
Stars: ✭ 96 (-20.66%)
Mutual labels: customview
Codeeditor
A cool code editor library on Android with syntax-highlighting and auto-completion.
Stars: ✭ 84 (-30.58%)
Mutual labels: customview
Crescento
Add curve at bottom of image views and relative layouts.
Stars: ✭ 1,289 (+965.29%)
Mutual labels: customview
Stickerview
[No more support] A view which can add sticker and zoom,drag,delete it
Stars: ✭ 1,155 (+854.55%)
Mutual labels: customview
Androidnote
Android基础知识、Android进阶知识、Android自定义View相关、面试相关的知识,欢迎fork,star~
Stars: ✭ 1,279 (+957.02%)
Mutual labels: customview
Circularimageview
This project allowing you to create circular and rounded corner Imageview in android through simplest way.
Stars: ✭ 90 (-25.62%)
Mutual labels: customview
🌞 NeumorphismView 🌚
A set of Custom Viewgroup - FrameLayout and Constraintlayout that allows adding shadows/highlights to each of its children. You can customise the highlights, shadows, background color and stroke.
Table of Contents
Example
Installation
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.thelumiereguy:NeumorphismView-Android:1.5'
}
Features
This comes with two custom viewgroups - Framelayout and Constraintlayout. When you just need to add the effect to a single view, use the Framelayout one and if you want to apply the effect to all children, use the Constrantlayout.
There are a few parameters to add a shadow to your view - deltaX, deltaY, color and shadow radius.
-
DeltaX - Offset accross the X-Axis
-
DeltaY - Offset accross the Y-Axis
-
Shadow color - Color for the shadow, duh
-
Shadow radius - The blur radius used to render the layer's shadow
Usage
In case of NeumorphicCardView, the params are set to itself, but in case of NeumorphicConstraintLayout, the params are set to each of the children. (Refer to the example)
Notes -
- To enable preview in the design tab, set the "enable_preview" attribute.
- To avoid the shadow being clipped by the parent view, you'll need to set the padding manually.
Background
NeumorphicCardView | NeumorphicConstraintLayout | |
---|---|---|
BackgroundColor | neu_backgroundColor | layout_neu_backgroundColor |
BackgroundVerticalPadding | verticalPadding | layout_verticalPadding |
BackgroundHorizontalPadding | horizontalPadding | layout_horizontalPadding |
BackgroundCardRadius | cardRadius | layout_cardRadius |
Note -
Background color is compulsory if you want to draw shadows/highlights as they dont work with Transparent color.
Shadows
NeumorphicCardView | NeumorphicConstraintLayout | |
---|---|---|
Enable Shadow | enableShadow | layout_enableShadow |
DeltaX | shadowDx | layout_shadowDx |
DeltaY | shadowDy | layout_shadowDy |
Shadow color | shadowColor | layout_shadowColor |
Shadow radius | shadowRadius | layout_shadowRadius |
Highlights
NeumorphicCardView | NeumorphicConstraintLayout | |
---|---|---|
Enable Highlights | enableHighlight | layout_enableHighlight |
DeltaX | highlightDx | layout_highlightDx |
DeltaY | highlightDy | layout_highlightDy |
Highlight color | highlightColor | layout_highlightColor |
Highlight radius | highlightRadius | layout_highlightRadius |
Stroke
NeumorphicCardView | NeumorphicConstraintLayout | |
---|---|---|
Enable Stroke | enableStroke | layout_enableStroke |
Stroke Color | stroke_color | stroke_color |
Stroke Width | stroke_width | stroke_width |
In case of NeumorphicConstraintLayout, the parameters are set to each of the children (Layout Params). Please use the following function on the direct children of the NeumorphicConstraintLayout like this - Modify the Parameters Programmatically
childView.updateNeumorphicLayoutParams {
highlightColor = Color.RED
highlightRadius = 107F
}
In case of NeumorphicCardView, you can directly modify the properties of the view itself.
Contribute
Feel free to fork this project, to optimise the code or to add new features.
TODO
- Reduce redraw and improve performance
License
Copyright 2020 Piyush Pradeepkumar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].