Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

adjust font scale in android studio

private fun adjustFontScale(configuration: Configuration) {
        if (configuration.fontScale > 0.90) {
            configuration.fontScale = 0.90f
            val metrics = resources.displayMetrics
            val wm = baseContext.getSystemService(WINDOW_SERVICE) as WindowManager
            wm.defaultDisplay.getMetrics(metrics)
            metrics.scaledDensity = configuration.fontScale * metrics.density
            baseContext.resources.updateConfiguration(configuration, metrics)
        }
    }
 
PREVIOUS NEXT
Tagged: #adjust #font #scale #android #studio
ADD COMMENT
Topic
Name
7+7 =