https://github.com/irontec/inkbasicmodels
Library to make easier to modify view parameters and make "programmatic styles".
https://github.com/irontec/inkbasicmodels
Last synced: 7 months ago
JSON representation
Library to make easier to modify view parameters and make "programmatic styles".
- Host: GitHub
- URL: https://github.com/irontec/inkbasicmodels
- Owner: irontec
- License: gpl-3.0
- Created: 2019-08-16T09:52:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T11:26:51.000Z (about 5 years ago)
- Last Synced: 2025-01-31T04:53:53.238Z (over 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 155 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InkBasicModels
[](https://jitpack.io/#irontec/InkBasicModels)
## Usage
Edit some `LinearLayout` parameters:
```kt
findViewById(R.id.linearlayout)?.applyModel(GeneralViewMdl(
paddingBottom = 16.dpToPx(),
paddingLeft = 16.dpToPx(),
paddingRight = 16.dpToPx(),
paddingTop = 16.dpToPx()
))
```
Edit some `TextView` parameters:
```kt
findViewById(R.id.textview)?.applyModel(TextViewMdl(
textMdl = TextMdl(
text = InkSpannableBuilder().addText("Example text with some").addBlank().addTextBold("bold"),
textColorResId = R.color.colorAccent,
textSizeSp = 20f
),
generalViewMdl = GeneralViewMdl(
onClick = { Toast.makeText(this, "You clicked me!", Toast.LENGTH_SHORT).show(); true},
paddingBottom = 16.dpToPx(),
paddingLeft = 16.dpToPx(),
paddingRight = 16.dpToPx(),
paddingTop = 16.dpToPx()
)
))
```