right-to-left

How to create RTL ViewPager?

*爱你&永不变心* 提交于 2019-11-29 02:01:23
I'm using ViewPager in my application and I want to support RTL, but when I cahnge my device language to RTl it seems it does'nt working. I want the tabs to start from the right side (the first fragment in the right). Please help me to solve it. EDIT : Here is a picture of it: Tabs start from the left side Here is my code: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" xmlns:ads=

Android : Change entire app layout directions programmatically

筅森魡賤 提交于 2019-11-29 00:01:31
问题 How can I change entire app layout direction to RTL? I am writing an app that user must select it's language in first launch and the layout should change based on user selection to RTL or remains LTR. I used to add android:supportsRtl="true" to the AndroidManifest and android:layoutDirection="rtl" for each layout but this approach have some problems like below : One problem is when I change the direction to RTL the ActionBar home icon or navigation button (when home as up is enabled) remains

Force RTL layout direction not working for app

送分小仙女□ 提交于 2019-11-28 22:49:20
I'm trying to add RTL language support in my app (specifically Arabic right now). I'll be supporting English as well. What I've done: Set minSdkVersion to 17 Added android:supportsRtl="true" to my application tag in AndroidManifest.xml Switched my left/right attributes to start/end At first I made these changes manually, then I used Android Studio's "Refactor -> Add RTL Support Where Possible..." menu item. When I preview my layout files, I can see the RTL preview is properly mirroring the UI; however, even when I use the "Force RTL Layout Direction", my app doesn't display the RTL layout. The

Set LayoutDirection (RTL) for api lower than 17

我们两清 提交于 2019-11-28 22:40:29
I am going to build a Persian app (RTL) . my app includes a ListView and a Navigation Drawer . I added in Manifest in application tag android:supportsRtl="true" and in onCreate() method: getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL); I know that LayoutDirection for less than 17 api does not work. for api level 17 and higher: for api lower than 17: How do I solve this problem. 1- Putting a conditional statement to check the android api and assign a particular layout ? 2-use folder layout-ldrtl in eclipse? 3 - ... ? What is the best way?? <android.support.v4.widget

The project references RTL attributes, but does not explicitly enable or disable RTL support [duplicate]

左心房为你撑大大i 提交于 2019-11-28 20:28:44
This question already has an answer here: What is use of android:supportsRtl=“true” in AndroidManifest xml file 3 answers In Eclipse manifest file , i get a warning message. Application language is Turkish ( Not right to left ). "The project references RTL attributes, but does not explicitly enable or disable RTL support with android:supportsRtl in the manifest " I can not add android:supportsRtl line, because my min sdk versionn is 9. This warning is important? Thanks If you do not support RTL (= Right To Left locales), you need to replace all references of start by left and end by right in

UICollectionView iOS 9 issue on project with RTL languages support

北战南征 提交于 2019-11-28 19:13:20
It seems like Apple's new feature of auto-flip interface on RTL languages cause problems when using UICollectionView . I used constraints of type Trailing/Leading for the collection view and they switched their values, as they should, on RTL language. The problem is that the data actually presented is of the last indexPath in the collection's data source but the UIScrollView.contentOffset.x of the first cell is 0. A proper behaviour would have been one of the following: Displaying the first indexPath correctly and switching the direction of the scroll (to the right) - Best option Not flipping

Why does this code, written backwards, print “Hello World!”

孤街醉人 提交于 2019-11-28 15:00:49
Here is some code that I found on the Internet: class M‮{public static void main(String[]a‭){System.out.print(new char[] {'H','e','l','l','o',' ','W','o','r','l','d','!'});}} This code prints Hello World! onto the screen; you can see it run here . I can clearly see public static void main written, but it is backwards. How does this code work? How does this even compile? Edit: I tried this code in IntellIJ, and it works fine. However, for some reason it doesn't work in notepad++, along with cmd. I still haven't found a solution to that, so if anyone does, comment down below. There are invisible

JAVA Swing GUI Components howto RTL view?

对着背影说爱祢 提交于 2019-11-28 13:38:37
How can i make my Java Swing GUI Components [Right To Left] for Arabic language from NetBeans Desktop Application? Don't you just have to use: Component.setComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT ) I believe that the swing components all already have support for RTL, don't they? Not sure how/where you'd do that in regards to netbeans, though. The call of Component.setComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT ) should do the trick. But be sure to use the SwingConstants LEADING and TRAILING instead of LEFT and RIGHT in your layouts. The same goes for

How to draw RTL text (Arabic) onto a Bitmap and have it ordered properly?

寵の児 提交于 2019-11-28 12:32:40
I'm trying to draw Arabic text onto a Bitmap for display: Bitmap img = Bitmap.createBitmap( (int) f+100, 300, Config.RGB_565); Canvas c = new Canvas(); c.setBitmap( img ); mFace = Typeface.createFromAsset(getAssets(),"DejaVuSansCondensed.ttf"); mPaint.setTypeface(mFace); content = "يجري"; content = ArabicUtilities.reshape( content ); System.out.println("Drawing text: " + content); c.drawText(content, 30, 30, mPaint); The ArabicUtilities class is a tool to reshape the unicode text so the letters are connected. see: http://github.com/agawish/Better-Arabic-Reshaper/ However, the bitmap that is

React RTL. Conditional Import CSS

孤人 提交于 2019-11-28 09:28:34
I am incorporating RTL to my React application. I have two CSS files, one for LTR and one for RTL. I have a drop down from where user select either English version or Arabic version. I am stuck with that how to conditional import my RTL CSS file when user select Arabic version and back to normal CSS file when user select English. Any help or guidance on this will be highly appreciated I am using React & webpack Regards I have faced this problem before, What I have done is that when my main container is mounting, I check for the language, if it's Arabic, I require the Arabic CSS file, if not I