Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
99 views

Android constraintLayout set layout direction right to left doesn't work

I want the image to always be on the right side of the screen without gaps no matter how long the message is (as shown in the photo). I already set android:supportsRtl="true"in the manifest....
yzyzyz's user avatar
  • 11
6 votes
2 answers
2k views

What is the difference between paddingLeft and paddingStart in Android?

I was trying to set the padding of a LinearLayout in XML layouts of Android. But it gives me 2 options - paddingLeft and paddingStart. What are the differences, and is one the more correct/better ...
DevCaf's user avatar
  • 109
0 votes
0 answers
47 views

Supporting RTL on old layouts which are designed manually for RTL

I use Android Studio 3.5.2. In a very old project witch its targetSdkVersion is 14 (it is not updated for near 6 years) and was designed for devices with API lower than 17 and users that use right-to-...
hasanghaforian's user avatar
1 vote
1 answer
1k views

layout_constraintStart_toStartOf="parent" is broken in RTL

I have a layout, which supports RTL. It looks fine in preview in Android studio and on device in default locale, but is broken in Arabic locale. There is an image on start, button on end and two texts ...
darja's user avatar
  • 5,025
1 vote
2 answers
4k views

Android LayoutDirection set to RTL is not always working

I have Android application for which I need to force the entire app's layout to RTL. I'm doing this by the use of the xml attribute android:layoutDirection="rtl". It's all working fine until in one ...
2hamed's user avatar
  • 9,037
6 votes
3 answers
3k views

how do I force textView containing ltr characters, to right aligned on rtl enviroment

all "lines" uses the same struct (width, height, gravity, ...: <LinearLayout android:layout_width="fill_parent" android:layout_height="30dp" android:orientation="horizontal"> <...
Atara's user avatar
  • 3,569
0 votes
1 answer
269 views

Spinner direction not changed

Hi everybody I have problem in setting spinners direction to RTl. In fact, my code dont work in api 17 & 18 in which layoutDirecton is supported , but it works perfectly in api 27 . <android....
Abolfazl Haghighi's user avatar
1 vote
1 answer
2k views

How to prevent LTR layout from being forced to RTL on certain Android devices?

After implementing RTL support in my app a user reported that LTR text is being forced as RTL on Arabic locales. This looks as follows: Notice how the text is right-aligned, even though it should be ...
Jonas Kalderstam's user avatar
4 votes
5 answers
2k views

MenuItem icon is not displaying correctly in RTL Layouts

In RTL, option menu item icon not displayed correctly!! but in LTR, everything is displayed well and beautifully. With the help of this command, I make the RTL program getWindow().getDecorView()....
Shahram's user avatar
  • 43
0 votes
1 answer
528 views

Punctuation Mark rendered at start of LTR text in RTL OS

Consider the snippet: <TextView android:layout_width="wrap_content" android:layout_width="wrap_content" android:text="Hello!" android:textDirection="locale"/> The code results ...
yash mittal's user avatar
2 votes
3 answers
1k views

How to apply RTL dynamically and effectively

I'm creating and adding TextViews in linear layout dynamically, whenever I'm applying layoutAmount.setRotationY(180); the layout changes its direction which is right, but the words of TextViews inside ...
blackHawk's user avatar
  • 6,297
0 votes
1 answer
132 views

setMarginEnd is not working for RTL languages

I have a custom view (TextView). When the user clicks on the screen, the custom view will move based on touch (X position). For that I'm calling setMarginLeft on the custom view dynamically in LTR ...
ravi's user avatar
  • 2,782
4 votes
2 answers
440 views

ConstraintLayout ListView RTL some lines are not RTL

On my ListView some lines are not RTL aligned. After scrolling and redrawing the lines are correct. My layout of the line item: <android.support.constraint.ConstraintLayout xmlns:android="http:/...
chrisonline's user avatar
  • 7,109
5 votes
1 answer
161 views

Disable RTL if no translations available

I have Arabic translations in application. The app also supports RTL layout. When the user uses Arabic everything looks fine. The problem is that when I change local to e.q. Persian where they use RTL ...
AppiDevo's user avatar
  • 3,225
0 votes
0 answers
273 views

Layout wrong position and width after force to rtl

After i forced my project use rtl by android studio refactor menu,my slider show on wrong width,i try changing all parent and nested elements in xml files with diffrent attrbiutes such android:...
Mostafa Khatibi's user avatar
1 vote
4 answers
322 views

App layout problems with Right-To-Left languages

I have developed an app in English language. When i change my android language to a right-to-left (later rtl) language , my app goes rtl layout but I don't want that. I want my app layout to stay left-...
Hossein Eftekhari's user avatar
12 votes
1 answer
6k views

How to detemine the current direction of a View (RTL/LTR)?

Background It's possible to get the current locale direction, using this: val isRtl=TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL It's also ...
android developer's user avatar
4 votes
1 answer
3k views

How to force rtl support for a view?

I've disabled and forced my application to not support rtl . Because it made lots of problems of views and layouts , this is my manifest code: <application android:name="ir.dizbon....
j jones's user avatar
  • 487
2 votes
0 answers
333 views

android: wrong drawable resource file when changing layout direction

I created different drawable resource folders for rtl and ltr layout directions.(drawable-ldrtl & drawable-ldltr) I use the following code to change layout directionL ViewCompat....
mamzi's user avatar
  • 545
0 votes
1 answer
840 views

Change all application design to support RTL

In my application i want to support RTL Layout direction to support Arabic language. using following function private void forceArabicLanguage() { Locale locale = new Locale("ar"); ...
Azak's user avatar
  • 270
5 votes
2 answers
2k views

Android - Wrong layout direction when switching RTL vs LTR many times

When I switch my app language between EN and AR (during runtime) the views behave correctly by moving from the LTR to the RTL but when I start stressing the app by switching languages many times the ...
abdelali eramli's user avatar
0 votes
1 answer
352 views

Translate android app a and make it force RTL

I'm new to android and i want to translate an app. to arabic and force RTL direction. If anyone can help please. Thank you
Amine's user avatar
  • 1
2 votes
1 answer
4k views

Android - setLayoutDirection in API 15 and API 16

Does anyone know if ViewCompat.setLayoutDirection works in API level below 17? I search for a solution all over the internet but I can't find a solid one.
gil cohen's user avatar
  • 343
1 vote
1 answer
177 views

Textview inside custom layout of ActionBar doesn't go rtl

I have this custom layout in my app bar. My problem is that not only the text is not shown completely, but also it sticks to the left instead of right. I have set all gravity, direction ...
Fatima's user avatar
  • 869
0 votes
2 answers
553 views

RTL properties with padding attribute android

I am working on an android application and provided support for RTL feature in my application. Now when I define any marginLeft Property, I define the same marginStart property also on that view to ...
Prithniraj Nicyone's user avatar
2 votes
2 answers
3k views

make a RTL navigation Drawer in android

I want to make my navigation open from right to left. But as soon as I change any of these steps my program face to error force closed after click on navigation after running the app. My ...
Tolou's user avatar
  • 29
0 votes
0 answers
246 views

Right to left in android application

I want to make the first word from right to left. IF i click on the button to show me the first word its work but its show me on the left in need it in the right Code String letter = ""; boolean ...
Dijam's user avatar
  • 1
0 votes
1 answer
651 views

Custom Layout for right-to-left languages in Android

I have a custom layout that extend ViewGroup class, How can I modify the layout programmatically in order to support the right-to-left languages e.g. Arabic, Farsi, etc. Which means reversing the ...
First Knight's user avatar
1 vote
3 answers
526 views

How to Rtl Horizontal ListView?

I'm currently using the Devsmartlib.jar library. in .xml file: <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="...
Mohamad Hasan Salmaaniyaan's user avatar
2 votes
0 answers
882 views

force left to right on TextView's declaration in the xml

I have a TextView that might contains both Latin letters and rtl language letters. When showing both on the same text, it doesn't look good. How can I force the TextView to be ltr even if i have rtl ...
Dus's user avatar
  • 4,220
10 votes
1 answer
4k views

Is android bug in load "layout-ldltr" layout against "layout-ldrtl" after orientation changed?

In my project I have to create both layout-ldltr and layout-ldrtl layouts for Right-To-Left and Left-To-Right languages. I launch application for Right-To-Left language, and every thing is good. But ...
Sayed Abolfazl Fatemi's user avatar
1 vote
1 answer
542 views

Does drawableStart converts to drawableLeft on older devices?

I am getting tons of Lint warning to change layout to better support RTL devices. If I use drawableStart in XML, what will happen in the devices that came before this attribute was introduced? Will ...
sandalone's user avatar
  • 41.7k
5 votes
3 answers
6k views

Android RTL layout direction align center issue

I'm developing an Android App that needs to be support Arabic language. (Which should be read from Right To Left). After quick googled the solutions, I figure out android fully support Arabic language ...
Wai Hong's user avatar
  • 165
2 votes
1 answer
1k views

Enable/disable RTL Support on run-time

I want to programmatically change layouting direction on run-time using Java, instead of relying on the static boolean supportsRTL XML property on compile-time. Any idea on how to achieve real-time ...
Behnam's user avatar
  • 6,600
17 votes
4 answers
7k views

How to override RTL support on a layout in Android

I set android:supportsRtl="true" in the <application> tag in AndroidManifest.xml, but I need to force one of the views to be left-to-right (LTR) nonetheless, even when the language of ...
escargot agile's user avatar
0 votes
1 answer
561 views

change Right to End for RTL layouts but layout-v17 was created

I have this in res/layout <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/txt" ...
Amos's user avatar
  • 1,341
14 votes
2 answers
9k views

How to prevent automatic right-to-left text direction for Hebrew and Arabic?

In a TextView, when a text starts with a Hebrew letter, the entire text is shown in RTL mode. The problem is that in my case only the first word is in Hebrew, while the entire sentence is in English,...
escargot agile's user avatar
3 votes
1 answer
2k views

Start/end & left/right for RTL languages in Android 4.2

I'm trying to make the layout of my app which will include support for RTL languages. The sdk versions targeted will be 15+. I've used start/end as well as left/right in all my layout files, however I ...
AlexR's user avatar
  • 43
6 votes
2 answers
21k views

How to RTL this android layout?

I want to rtl (Right To Left) below layout in android like when using layoutDirection="rtl" in parent layout (but it only for 4.2 and higher) and any way to make it direction to right-to-left clearly. ...
Mokhtarabadi's user avatar
8 votes
2 answers
6k views

Automatic layout mirroring in right-to-left locale with lollipop

I have recently checked a widget of an application I developed on a device running lollipop and a right-to-left locale (Hebrew). The problem is that Android 5 (lollipop) automatically mirrors ...
a.p.'s user avatar
  • 3,278
0 votes
1 answer
1k views

"android:supportsRtl" isn't work

I'm trying to make an app which support RTL and LTR and i'm using "android:supportsRtl" in the manifest and change layout properties to new start/end equivalents. similar this link My android is 4....
Behdad's user avatar
  • 23
4 votes
2 answers
3k views

Right to Left element direction in android older than 4.2

I have a table layout in my android application and want the first column in right and the second one in left , I try to use android:layoutDirection="rtl" but it's just work with version 4.2 and ...
user3093966's user avatar
0 votes
1 answer
6k views

in android's RelativeLayout toStartOf/toEndOf/alignStart/align/End does not work

unlike the simulator, when deployed to my 4.1.x RTL-friendly aligns like align_toEndOf does not seem to work. while the hard-coded align_toRightOf works fine could it be that the current local is not ...
Muayyad Alsadi's user avatar
0 votes
2 answers
655 views

Linkified textview invisible in RTL

I'm facing some problems with RTL support on a linkified TextView. My code is as follows: final TextView textView = (TextView) findViewById(R.id.where); if (textView != null) { ...
Johan's user avatar
  • 161
4 votes
1 answer
8k views

Android TextView right alignment on a right-to-left device

I am writing an app that displays in the Hebrew language and for that I am right aligning TextView's text. While developing on a Nexus device all works great and texts are displayed as it should, ...
Idan's user avatar
  • 2,869
9 votes
2 answers
6k views

Disable ActionBar RTL Direction

Android 4.2 introduced RTL (BiDi) support, to start using it I just follow the instructions (android:supportsRtl attribute to the element in your manifest file and set it “true") But then my ...
Shai Levy's user avatar
  • 715
1 vote
1 answer
3k views

Create textView right to left layout

I want set TextView direction right to left. I want that show unicode character right to left and align to right. I set my text view layout_gravity and gravity right but isn't work <RelativeLayout ...
Mostafa Rostami's user avatar
9 votes
4 answers
8k views

android:gravity="right" not working on all devices for Arabic and other RTL languages

I've got an Arabic Android application, and here is the XML code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:...
M.ES's user avatar
  • 940
21 votes
5 answers
20k views

How do I position the cursor on the right in EditText

My application uses RTL language (right to left). When the EditText field gets focus, the cursor appears on the left and only when the user starts to type, the cursor (and the RTL text) moves right. ...
Asaf Pinhassi's user avatar