0

I have One layout file with TextView, EditText and ImageView, and when i go to setting screen and change the font size, I have to reload the above activity runtime.

There will be only one layout file and everytime font size is changed same file should be loaded to match the new font size.

how can i achieve this ?

Thanks

mpb
  • 83
  • 1
  • 9
  • onresume of activity you can get the size and set it to textview – prabhat yadav Jan 09 '19 at 12:09
  • Not only textview.. layout as a whole i have to reload , matching with font size, onConfigurationchange () will called if font size change happens()? – mpb Jan 09 '19 at 12:26

1 Answers1

0

You check it at Activity. `override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig)

// Checks the orientation of the screen
if (newConfig.orientation === Configuration.ORIENTATION_LANDSCAPE) {
    Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show()
} else if (newConfig.orientation === Configuration.ORIENTATION_PORTRAIT) {
    Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show()
}

` .After changing the text size that you want. You can follow this solution: How to make font sizes in app to not get effected by changing Settings Font size