vitoksmile / ControlView

Android library to controlling values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ControlView

Screenshot 1 Screenshot 2
Screenshot 3 Screenshot 4

Requirements

  • SDK 10 and and higher

Usage

Easy to Use

Add the xml code:

<com.vitoksmile.library.view.controlview.ControlView
  xmlns:cv="http://schemas.android.com/apk/res-auto"
  android:id="@+id/controlView"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  cv:colorArc="@color/colorAccent"
  cv:colorBase="@color/colorPrimaryDark"
  cv:colorValueNeed="@color/colorAccent"
  cv:rangeMax="80"
  cv:rangeMin="20"
  cv:text="%"
  cv:value="34"
  cv:valueNeed="44" />

Add this to initialize the ControlView:

mControlView = (ControlView) findViewById(R.id.controlView);

Setters:

mControlView.setRange(0, 100);
mControlView.setValue(60);
mControlView.setValueNeed(75);
mControlView.setText("%");
mControlView.setColor(Color.BLUE);
mControlView.setColorArc(Color.GRAY);
mControlView.setColorValueNeed(Color.WHITE);

or use ControlViewBuilder:

new ControlViewBuilder()
  .range(140, 360)
  .value(179, 179)
  .text("P")
  .color(Color.YELLOW, Color.parseColor("#CCCC00"), Color.WHITE)
  .build(mControlView);

Listeners

ControlView.OnControlValueChangeListener

@Override
public void onControlValueChanged(float value) {
}

About

Android library to controlling values

License:Apache License 2.0


Languages

Language:Java 100.0%