medium-textview icon indicating copy to clipboard operation
medium-textview copied to clipboard

how to change the text size?

Open iloster opened this issue 8 years ago • 1 comments

iloster avatar Jan 03 '17 08:01 iloster

import android.view.ViewGroup
import android.widget.TextView
import io.github.angebagui.mediumtextview.ParagraphView
import mx.jetty.jetty.jettyelements.FontManager

/**
 * @author Gorro
 * @since 06/09/17.
 */

fun ViewGroup.setFont() {
    (0..this.childCount).map {
        val view = this.getChildAt(it)
        if (view is ParagraphView) {
            (0..view.childCount).map { index ->
                val txtV = view.getChildAt(index)
                if (txtV is TextView) {
                    if (it == 0) {
                        FontManager(txtV.context).initStyle(txtV, 1)
                        txtV.textSize = 24f
                    } else {
                        FontManager(txtV.context).setTypeFace(txtV)
                    }
                }
            }
        }
    }
}

I wrote this Kotlin function to change the font Of course

FontManager(txtV.context).initStyle(txtV, 1)

it's a function to set te TypeFont :)

gorrotowi avatar Sep 06 '17 23:09 gorrotowi