Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 36 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,48 @@ Possible usages are:

### Setup
In your project's build.gradle file:

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

In your Application's or Module's build.gradle file:

dependencies {
```gradle
allprojects {
repositories {
...
compile 'com.github.BeppiMenozzi:Knob:1.9.0'
maven { url "https://jitpack.io" }
...
}

### Minimal usage
Layout:

}
```
In your Application's or Module's build.gradle file:
```gradle
dependencies {
...
xmlns:app="http://schemas.android.com/apk/res-auto"
compile 'com.github.BeppiMenozzi:Knob:1.9.0'
...
<it.beppi.knoblibrary.Knob
android:layout_width="64dp"
android:layout_height="64dp"
android:id="@+id/knob"
app:kNumberOfStates="6"
/>

}
```
### Minimal usage
Layout:
```xml
...
xmlns:app="http://schemas.android.com/apk/res-auto"
...
<it.beppi.knoblibrary.Knob
android:layout_width="64dp"
android:layout_height="64dp"
android:id="@+id/knob"
app:kNumberOfStates="6" />
```
Listener:

...
Knob knob = (Knob) findViewById(R.id.knob);
knob.setState(firstState);
knob.setOnStateChanged(new Knob.OnStateChanged() {
@Override
public void onState(int state) {
// do something
}
});

...

```java
// ...
Knob knob = (Knob) findViewById(R.id.knob);
knob.setState(firstState);
knob.setOnStateChanged(new Knob.OnStateChanged() {
@Override
public void onState(int state) {
// do something
}
});
// ...
```
<br>
As default, nearly all features are disabled and the default knob is minimal:<br>
<img src="gifs/ezgif.com-b175d4980a.gif"><br>
Expand Down