Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

devStudGH/ButtonCustomShadow

Open more actions menu
 
 

Repository files navigation

Beauty Shadow Button

Latest Version: 1.0.0

Usage

Add dependency into app build.gradle

compile "com.subsub.libs:buttoncustomshadow:{latestVersion}"

If gradle failed to sync, try adding maven repository into project build.gradle

buildscript{
    repositories {
        maven {
            url  "https://dl.bintray.com/subsub/maven" 
        }
    }
}

Sample

See app module

Add BeautyButton into layout

<com.subsub.library.BeautyButton
    android:id="@+id/button1"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_margin="20dp"
    android:background="@drawable/bg_round_30dp_primary"
    android:elevation="10dp"
    android:padding="10dp"
    android:text="Button1"
    android:textColor="@color/colorWhite"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:shadowColor="@color/colorPrimary"
    app:shadowPercentHeight="0.7"
    app:shadowPercentWidth="0.6"
    app:shadowRadius="30dp"
    app:shadowYOffset="10" />

Attributes

Name Type Description
shadowRadius Dimension This attribute (combined with elevation) determines how spread apart the shadow should be. ShadowRadius also determines the amount of corner radius (roundness) of the shadow. The bigger the shadowRadius is, the bigger the corner radius. ShadowRadius should be equal or bigger than elevation.
shadowColor Color The color of the shadow
shadowXOffset Float Sets shadow horizontal (x) position relative to the view.
shadowYOffset Float Sets shadow vertical (y) position relative to the view.
shadowPercentWidth Float Sets the percentage of shadow's width relative to the button width. Value is between 0 and 1, with 0 being 0% and 1 being 100% (shadow width = button width)
shadowPercentHeight Float Sets the percentage of shadow's height relative to the button height. Value is between 0 and 1, with 0 being 0% and 1 being 100% (shadow height = button height)

About

A beautiful button with beautiful shadow that is completely customisable

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 93.0%
  • Java 7.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.