Skip to content

Commit aa11b58

Browse files
committed
2 parents ab1f8b1 + b1ae16c commit aa11b58

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There is no need to add every special character by [Unicode](https://www.w3schoo
1717
### Kotlin String interpolation
1818
When building equations in Kotlin sometimes double backslash is needed to escape Kotlin String Interpolation
1919
```kotlin
20-
var math = "$\\F&#2196{&#x2192}=ma_g$"
20+
var math = "$\\F&#x2196{&#x2192}=ma_g$"
2121
```
2222
# Demo
2323
![Demo RecyclerView](/MathViewGif.gif)
@@ -33,7 +33,7 @@ repositories {
3333
```
3434
```groovy
3535
dependencies {
36-
implementation 'com.github.jstarczewski:MathView:0.3.0'
36+
implementation 'com.github.jstarczewski:MathView:0.4.0'
3737
}
3838
```
3939
# Usage
@@ -56,10 +56,10 @@ dependencies {
5656
textColor = Color.GREEN.toString()
5757
backgroundColor = Color.WHITE
5858
text = "$\\F&#x2196{&#x2192}=ma_g$"
59-
}.update()
59+
}
6060
6161
```
62-
## Set text directly in xml
62+
## Set text and textZoom directly in xml
6363
6464
While setting text directly in XML, remember to encode HTML special characters, for example : `& = &`
6565

@@ -68,23 +68,22 @@ While setting text directly in XML, remember to encode HTML special characters,
6868
android:id="@+id/mvTest"
6969
android:layout_width="wrap_content"
7070
android:layout_height="wrap_content"
71-
app:text="$F=mg$"/>
71+
app:text="$F=mg$"
72+
app:textZoom="75"/>
7273
```
7374

7475

7576
# Interface
7677
There are currently five custom functions available for the user. I plan to refactor them to fit more in Kotlin style.
7778

7879
```kotlin
79-
// Apply properties, then call update()
80+
// Apply properties
8081
var mathView : MathView = findViewById<MathView>(R.id.mvEditTextExample)
8182
mathView.apply {
8283
text = "$\\F=10$" // sets text
8384
textColor = "red" // sets text color, default value is "black"
8485
backgroundColor = "blue" // sets background color, default value is "white"
85-
}.update() // updates changes
86-
87-
// There is no need to call update() after setting textZoom property
86+
}
8887
mathView.textZoom = 120 // set text size based on pixel density, default value is 100 (%)
8988
```
9089

@@ -94,4 +93,4 @@ Back in 2016 I created an Android App which contained a lot of equations rendere
9493

9594

9695
# Contributing
97-
Feel free to contribute and report issues. Feedback appreciated
96+
Feel free to contribute and report issues. Feedback appreciated!

0 commit comments

Comments
 (0)