Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

A semicircular seekbar view for selecting angle from 0° to 180° ✨

License

NotificationsYou must be signed in to change notification settings

GoodieBag/ProtractorView

Repository files navigation

Android ArsenalReleaseAPI

ProtractorView library for android 😾

A semicircular seekbar view for selecting an angle from 0° to 180.

alt tagalt tag

Gradle Dependency

Add this in your root build.gradle file at the end of repositories:

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

Add the dependency :

dependencies {compile'com.github.GoodieBag:ProtractorView:v1.2'}

Sync the gradle and that's it! 👍

Features :

  • A semi-circular seekbar widget for selecting an angle from 0° to 180°.
  • Complete customisation facilities for changing the colors of the text, tick, progress bar and thumb.
  • A special highlighting mechanism has been implemented. As the thumb passes through the angles (ticks / text), it can change the tick/text colors marking them as "traversed" to give the user a visual hint.
  • The tick length and the interval between ticks and text can also be customised.

Usage :

XML :

<com.goodiebag.protractorview.ProtractorViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"app:thumb="@drawable/your_thumb_drawable"app:arcColor="#4a4a4a"app:arcProgressColor="#FF0000"app:tickColor="#4a4a4a"app:tickProgressColor="#abe6"app:textColor="#000"app:textProgressColor="#FF0000"app:angleTextSize="10sp"app:arcWidth="4dp"app:progressWidth="4dp"app:tickOffset="18dp"app:tickLength="10dp"app:angle="15"app:tickIntervals="15"app:ticksBetweenLabel="three"app:touchInside="true"app:roundEdges="true" />

Java :

To create the view programatically, you can do the following :

ProtractorViewprotractorView =newProtractorView(this);//This can then be added to its parent layoutlayout.addView(protractorView);

Or you can reference it from your XML :

ProtractorViewprotractorView = (ProtractorView)findViewById(R.id.protractorview);//use setters to style it. Every xml attribute mentioned above has a setter to support programmatical creation of the viewsprotractorView.setTickIntervals(15);protractorView.setArcColor(getColor(R.color.colorAccent));protractorView.setProgressColor(getColor(R.color.myColor));...//so on

There is an event listener which can be set up as follows :

protractorView.setOnProtractorViewChangeListener(newProtractorView.OnProtractorViewChangeListener() {@OverridepublicvoidonProgressChanged(ProtractorViewpv,intprogress,booleanb) {//protractorView's getters can be accessed using pv instance.           }@OverridepublicvoidonStartTrackingTouch(ProtractorViewpv) {           }@OverridepublicvoidonStopTrackingTouch(ProtractorViewpv) {           }       });

Thanks to :

Shoutout toSeekArc.
Thanks to SeekArc byneild001 we were able to understand the drawing mechanism of the circular seekbar, which then helped us draw the semi-circular one.

LICENSE

MIT LicenseCopyright (c) 2017 GoodieBagPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

About

A semicircular seekbar view for selecting angle from 0° to 180° ✨

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp