An open API service indexing awesome lists of open source software.

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".

Awesome Lists containing this project

README

          

# InkBasicModels

[![](https://jitpack.io/v/irontec/InkBasicModels.svg)](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()
)
))
```