-1

I have one simple UI that appears differently on two different api level emulators.

in api level 19 emulator its appear as api level 19 radio button and in api level 23 its appear as api level 23 radio button i want first radio button to appear in all version of android device because its look more traditional and its appear in the time where none of radio button is selected as well rather another one (api level 23) is only appear when is getting select if none of radio button is selected then its not even appear on UI. so its hard to even get known that there is radio button or something.

My i did not write any separate code with respect to android versions. i am not able to get how same code have different UI appearance for different versions.

Nisarg Desai
  • 361
  • 3
  • 16

1 Answers1

1

You will have to explicitely define the style you want to give to your radio button in XML.

I suggest you take a look at this answer to have some code to start with

https://stackoverflow.com/a/19163987/7540393

Community
  • 1
  • 1
Arthur Attout
  • 2,701
  • 2
  • 26
  • 49
  • i did already look over that answer in that they did create entire new graphic for radio button and replace the existing one. I don't want whole new graphic i want same as already they have provide in existing older version and keep that in newer version as well. – Nisarg Desai Apr 10 '17 at 08:37
  • Unfortunately this is the way styles work .. Either you stick to what Android gives you, or you have to redefine the whole style even if you just want to change the color or anything. – Arthur Attout Apr 10 '17 at 08:46
  • Damn! well that hurts. so we can not use their existing style in newer version either!. can we get their older version drawables? – Nisarg Desai Apr 10 '17 at 08:53
  • 1
    There are lots of ways you can check for this source. If you are on Android Studio you can use CTRL + click on the style you need the source for. Otherwise you can dig manually the Google Git to find what you need but this will be a bit longer. https://chromium.googlesource.com/android_tools/+/master/sdk/extras/android/support/v7/appcompat/res/values/styles_base.xml – Arthur Attout Apr 10 '17 at 08:58
  • ctrl+click shows me new version`s AppCompact theme drawables only. Means nothing is easy in android to make UI consistent across all devices. anyways thanks for help. – Nisarg Desai Apr 10 '17 at 09:01