0

In my application, I have an option for accessibility options. I want some specific ImageViews to change their opacity when the user changes his or her accessibility level. Example: for such behavior, fonts sizes are changed when the user changes the font size in the phone's settings (in case the font is in sp).

Is there any way to change the opacity of certain views all over the application by specific setting?

Thank you

Ishaan Javali
  • 1,711
  • 3
  • 13
  • 23
Yaniv
  • 3,321
  • 8
  • 30
  • 45

1 Answers1

1

You can access the system setting's entries using:

Settings.System class

Check out documentation for his : https://developer.android.com/reference/android/provider/Settings.System.html

Ncs
  • 313
  • 1
  • 9
  • Okay, but how can I change in the layout the opacity? – Yaniv Jan 03 '19 at 14:15
  • Suppose you have the "layout" variable initialized, you just use the "setAlpha(0.3)" function to set opacity (1 is opaque and 0 is transparent). More detailed answer: https://stackoverflow.com/questions/19541581/how-to-make-a-linearlayout-partially-transparent-in-android – Ncs Jan 03 '19 at 14:23