Skip to content

Commit

Permalink
Example and ReadMe update
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinMoskala committed Aug 12, 2017
1 parent fc04d6d commit 92ab0c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -51,7 +51,7 @@ To make gradient, you need to define it from code:

```java
int[] intArray = getResources().getIntArray(R.array.progressGradientColors);
seekArc.setProgressGradient(intArray);
arcSeekBar.setProgressGradient(intArray);
```

[Here](https://github.com/MarcinMoskala/ArcSeekBar/blob/master/app/src/main/res/values/colors.xml) you can find array definition.
Expand All @@ -70,8 +70,8 @@ ArcSeekBar properties are:
* `enabled` is progress enabled or not (`true` by default). For disabled there is no thumb displayed.

Each property can be changes pragmatically, and additionally gradient progress or background can be set using:
* `setProgressGradient`
* `setProgressBackgroundGradient`
* `setProgressGradient` e.g. `arcSeekBar.setProgressGradient(Color.GREEN, Color.BLUE, Color.YELLOW);`
* `setProgressBackgroundGradient` e.g. `arcSeekBar.setProgressBackgroundGradient(Color.GREEN, Color.BLUE, Color.YELLOW);`

## Installation

Expand Down
@@ -1,5 +1,6 @@
package com.marcinmoskala.arcseekbar;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
Expand All @@ -11,16 +12,16 @@ public class MainActivity extends AppCompatActivity {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArcSeekBar seekArc = findViewById(R.id.seekArc);
ArcSeekBar arcSeekBar = findViewById(R.id.seekArc);

seekArc.setOnProgressChangedListener(new ProgressListener() {
arcSeekBar.setOnProgressChangedListener(new ProgressListener() {
@Override
public void invoke(int progress) {
Log.i("SeekBar", "Value is " + progress);
}
});

int[] intArray = getResources().getIntArray(R.array.progressGradientColors);
seekArc.setProgressGradient(intArray);
arcSeekBar.setProgressGradient(intArray);
}
}

0 comments on commit 92ab0c6

Please sign in to comment.