Giter Site home page Giter Site logo

developerpaul123 / starview Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 1.0 343 KB

🌟Simple custom star view for Android🌟

License: MIT License

Kotlin 100.00%
star android android-library custom-view android-view android-custom-view kotlin kotlin-android star-view starview

starview's Introduction

StarView

🌟 Simple custom view that draws an n-point star for Android.

Say Thanks Discord Jitpack android-arsenal

Features

  • Draw any n-point star
  • Configurable colors
    • Supports background color, outline color and fill color
  • Supports curved corners with controllable corner radius
  • Control fill amount and direction

Include in your project

Gradle

Add the following to your root build.gradle:

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

Then add the dependency to your module's build.gradle file:

dependencies {
    implementation 'com.github.DeveloperPaul123:StarView:<version>'
}

Usage

Add the StarView to your layout xml:

<com.developerpaul123.starview.StarView
            android:id="@+id/starView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:minHeight="350dp"
            app:fillPercentage="0.5"
            app:outlineThickness="4.0" />

Other available attributes:

Attribute Value Type(s) Description
fillDirection StarView.FillDirection Control what direction the star is filled from.
fillPercentage float, clamped to 0.0 -> 1.0 Control the fill percentage.
numberOfPoints int, minimum of 3 Control the number of points in the star.
outlineThickness float Control the outline thickness.
starColor Color The fill color of the star.
starOutlineColor Color The outline color of the star.
starBackgroundColor Color The background color of the star. Only visible when not filled.
starCornerRadius float The corner radius for the points of the star.

All of the above attributes can be controlled via XML and Kotlin. See the demo application for more options and how they affect the view.

Contributing

Contributions are very welcome. Please see contribution guidelines for more info.

License

The project is licensed under the MIT license. See LICENSE for more details.

Author


@DeveloperPaul123

starview's People

Contributors

developerpaul123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

starview's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.