I had the same problem because my application works both in English and Hebrew. Here is what I did:
Set the android:layoutDirection="ltr" tab android:layoutDirection="ltr" .
In the activity of tabs java - in onCreate moved to the last page if the language was Hebrew.
In the PlaceholderFragment class in both onCreateView and getPageTitl e, it is checked whether the language is Hebrew and if views and captions are returned in the opposite order.
I know that the question concerned rtl as a whole, not just Hebrew, but this change can be easily implemented by changing the condition.
Here is my FinalTutorialActivity full code:
package com.romsharony.finaltutorial; import android.support.design.widget.TabLayout; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import java.util.Locale; public class FinalTutorialActivity extends AppCompatActivity { private SectionsPagerAdapter mSectionsPagerAdapter; private ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_final_tutorial); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);
Rom source share