Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-dev authored Oct 21, 2017
1 parent b579245 commit 3166978
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ with(viewModel) {
}
```

### Shared Preferences
### Shared Preferences binding
It's so annoying to deal with SharedPreferences directly:
```java
final String ageKey = "age";
Expand Down Expand Up @@ -124,7 +124,7 @@ prefs.isAdmin = true
println("the name is ${prefs.userName}")
```

### Bundle arguments tricks
### Bundle arguments binding
Dealing with args bundle has never been such simple before. Let's declare another one activity:
```kotlin
class SecondActivity : AppCompatActivity() {
Expand Down Expand Up @@ -157,10 +157,13 @@ val args = bundle {
}
```

### Resources
### Resources binding
Same rules can be used when using resources:
```kotlin
private val appName: String by res(R.string.app_name)
...
println(appName)
```
```

### Projects using this lib
- https://github.com/deviant-studio/energy-meter-scanner

0 comments on commit 3166978

Please sign in to comment.