0

Hi I'm new to android world. I'm working on an application that supports arabic and english languages.So I made my design for english language in the xml and through the code when the user wants to work with arabic language I change the gravity of my widgets to match the arabic right-to-left look.

Now if the user changes the language from english to arabic and for some reason he wanted to get back to english again.How can I restore the layout in the xml again?

Thanks in advance :)

FAFI
  • 379
  • 2
  • 6
  • 21

1 Answers1

0

It will be more comfortable for you to create two layouts and switch them in right order.

Egor
  • 39,695
  • 10
  • 113
  • 130
  • Thanks for replying me :).But it's gonna increase the size of my application. – FAFI Jun 04 '11 at 18:10
  • Usually layouts weigh a couple of kilobytes, I don't think you should worry about it. – Egor Jun 04 '11 at 19:20
  • If I'm working with only one xml then I'll have to set the gravity or make ALIGN_PARENT_RIGHT for each widget in my xml? – FAFI Jun 05 '11 at 15:07
  • But I have a problem here.I have a list in xml and the row it in another xml when I try to make ALIGN_PARENT_RIGHT to the row xml it throws exception – FAFI Jun 06 '11 at 18:21
  • source not found exception at this line of code:- //threads row //lastPost tvThread=(TextView)findViewById(R.id.txtLastPost); params = (RelativeLayout.LayoutParams)tvThread.getLayoutParams();//here params.setMargins(20, 0, 0, 0); but it switches the list's widget normally – FAFI Jun 06 '11 at 18:43
  • It's hard to understand what you've written here, maybe you should create a separate question? – Egor Jun 06 '11 at 20:03