Skip to content

Commit

Permalink
Merge pull request #7 from AbdElraoufSabri/develop
Browse files Browse the repository at this point in the history
fix readme
  • Loading branch information
abd3lraouf authored Feb 7, 2020
2 parents 22628e5 + aaa881f commit 8746b80
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,62 @@ Latest version from **jitpack** is [![](https://jitpack.io/v/AbdElraoufSabri/Fan
dependencies {
implementation 'com.github.AbdElraoufSabri:FancyAndroidRuler:X.Y.Z'
}
```
```
## RTL Support

[![RTL][1]][1]

## LTR Support _default_
[![LTR][2]][2]

## Usage
### XML
```xml
<TextView
android:id="@+id/value_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="32sp"
tools:text="1" />

<io.abdelraoufsabri.learn.ruler.widget.FancyRuler
android:id="@+id/myScrollingValuePicker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:rulerMinValue="15"
app:rulerMaxValue="108"
app:rulerDefaultPosition="107.75"
app:rulerSystem="imperial"
app:rulerPointerColor="#FF0000FF"
app:rulerNormalUnitBarColor="#FF0000FF"
app:rulerMiddleUnitBarColor="#00BCD4"
app:rulerMiddleUnitTextColor="#00BCD4"
app:rulerQuarterUnitBarColor="#E91E63"
app:rulerQuarterUnitTextColor="#E91E63"
app:rulerThreeQuartersUnitBarColor="#FFEB3B"
app:rulerThreeQuartersUnitTextColor="#FFEB3B"
app:rulerMainUnitBarColor="#4CAF50"
app:rulerMainUnitTextColor="#4CAF50"
app:rulerBackgroundColor="#000"
/>
```

### Kotlin
```kotlin
class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

myScrollingValuePicker.setOnScrollChangedListener({
value_text.text = myScrollingValuePicker.getReading(it).toString()
}, 250)
}
}

```

[1]: https://i.stack.imgur.com/nA2hK.png
[2]: https://i.stack.imgur.com/uGiTD.png

0 comments on commit 8746b80

Please sign in to comment.