I have designed an Android app, when I test it in a device it's language is Arabic ,the position of image views changes ,like a mirror !
I need a solution to make the layout the same as for English ,because I have image views and I made a translation for them according to screen width,so when the language is Arabic ; the 1% of screen width begins from the right of screen !,and my app when I programmed it ;the image view starts from the left of screen !
I want solution not only for higher SDK !
Some of my java Code :
img = (ImageView) findViewById(R.id.imageView);
img2 = (ImageView) findViewById(R.id.imageView3);
in same function named go has parameters according to img1 and img2:
dis = metrics.widthPixels * 0.043f;
fromxall=metrics.widthPixels * 0.01f;
toxall = metrics.widthPixels * 0.05f + dis;
fromyall = 0;
toyall = 0;
TranslateAnimation moveLefttoRight = new TranslateAnimation(fromxall, toxall, fromyall, toyall);
moveLefttoRight.setDuration(300);
moveLefttoRight.setFillAfter(true);
imgx.startAnimation(moveLefttoRight);
eXtensible Markup Language, or XML: A markup language created as a standard way to encode data in internet-based applications. Android applications use XML to create layout files.
in manifest change RTL to false
<application
android:allowBackup="true"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:supportsRtl="false"
android:theme="@style/AppTheme">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With