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

Overview

StarView

๐ŸŒŸ Simple custom view that draws an n-point star for Android.

Say Thanks Discord

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 if not there already.

allprojects {
    repositories {
        mavenCentral()
    }
}

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

dependencies {
    implementation "io.github.developerpaul123:star-view:<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
You might also like...
A curated list of great Android lint custom rules and resources

Awesome Android Lint A curated list of great Android lint custom rules and resources Contents Rules Articles Other Contribute Rules Google Sample Cust

An Android app that gives you a password generated by a given phrase with a custom algorithm, it also has password and biometric security.

An Android app that gives you a password generated by a given phrase with a custom algorithm, it also has password and biometric security.

Proof of concept of custom widgets and apps running on the Z Flip3 cover screen. Adds a widget to Z Flip3 cover screen that lets you launch a web browser-like app on the cover.

SubUI-browser Proof of concept of custom widgets and apps running on the Z Flip3 cover screen. Adds a widget to Z Flip3 cover screen that lets you lau

Azure B2C Custom Policy Designer

Azure B2C Custom Policy Designer Why has Microsoft never built a UI to deal with Custom Policy so far? I don't know, but I'll do it for free because i

Launchy - A custom launcher for our server that installs recommended mods

Launchy Our custom launcher which makes it easier to set up optional mods and in

Loco-strings-sync - A custom Gradle Plugin useful to sync loco string resources to local projects

loco-strings-sync A custom Gradle Plugin useful to sync loco string resources to

An application to create custom QR codes to specify waste types and waste disposal procedures for products.

wasteqr An application to create custom QR codes to specify waste types and waste disposal procedures for products. What is WasteQR? WasteQR is an app

AppUI Sample Application - display how you can create your own custom AppUI application within a few minutes
AppUI Sample Application - display how you can create your own custom AppUI application within a few minutes

AppUI Sample Application This is an open-source project to display how you can create your own custom AppUI application within a few minutes. I have a

Mole Analysis Use Case for HMS ML Kit Custom Model
Mole Analysis Use Case for HMS ML Kit Custom Model

Mole Analysis Mole Analysis Use Case for HMS ML Kit Custom Model Introduction What is Melanoma? Melanoma is the most serious among skin cancers becaus

Releases(1.0.2)
Owner
Paul T
Engineer/Developer
Paul T
Awesome Kid's Drawing App. It has a click and draws feature.

CanvaKids Overview It's a kid's drawing app which is build for android users. It is built in Kotlin with some very good practices involved.

null 9 Oct 30, 2021
Patter Lock using Hilt, Coroutines, Flow and Custom View Components based on MVVM architecture.

Pattern Lock App Sample project for created Pattern Lock View using custom view. Preview Usage Step 1 Add the PatterLockView in your XML layout file.

Furkan ร–zcan 5 Aug 22, 2021
Show worldwide headline. API/Glide library/recycler view/volley library/kotlin/xml/ chrome custom tabs

Show worldwide headline. API/Glide library/recycler view/volley library/kotlin/xml/ chrome custom tabs. -> you can click on headline and it will open an article of that news in the app(no need to go to chrome or any browser)

SUMIT KUMAR 5 Nov 28, 2022
Simple Android web-view-based application. The primary purpose is to show the website in Kiosk mode.

Kiosk mode app Simple Android web-view-based application. The primary purpose is to show the website in Kiosk mode. By default, the app works in Scree

Mykola Kichatov 1 Oct 25, 2022
A collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack.

slack-lints This repository contains a collection of custom Android/Kotlin lint checks we use in our Android and Kotlin code bases at Slack. This repo

Slack 119 Dec 20, 2022
A project which demonstrate how to develop a custom client on android for dribbble.com

##What is this? This is a project with custom client app on android for https://dribbble.com, which you can browse the popular icon and animation, lik

ZhangLei 599 Nov 14, 2022
Custom MediaPicker for Android. support targetSdk 30 & scoped storage. And use registerForActivityResult rather than onActivityResult.

MoongchiPicker What is MoongchiPicker? MoongchiPicker is custom media gallery base on Google's Material Design Bottom Sheets. You can fetch image or v

ํŽซํ”„๋ Œ์ฆˆ 5 Nov 26, 2022
Repository ini berguna untuk menyimpan kode yang dibutuhkan untuk membuat sebuah Aplikasi Android yang memiliki ListView yang menggunakan Custom Adapter dan Mengambil data dari Database secara CRUD.

AndroidListView Repository ini berguna untuk menyimpan kode yang dibutuhkan untuk membuat sebuah Aplikasi Android yang memiliki ListView yang mengguna

Bryan Yehuda Mannuel 1 Jan 2, 2022
This service provides first-class custom ROM integration for my Repainter app, which offers customizable dynamic theming for Android 12.

Repainter ROM integration This service provides first-class custom ROM integration for my Repainter app, which offers customizable dynamic theming for

Danny Lin 42 Jan 7, 2023
Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.

AppErrorsTracking ๅบ”็”จๅผ‚ๅธธ่ทŸ่ธช Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer. ไธบๅŽŸ็”Ÿ FC

็‹็‹ธๆดพ 83 Jan 8, 2023