Skip to content
Android RTL intro slider
Kotlin Java
Branch: master
Clone or download
Latest commit d67c63c Nov 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea improve samlpe app Nov 21, 2019
RTLIntroSlider improve samlpe app Nov 21, 2019
app update sample app Nov 21, 2019
gradle/wrapper add sample app Nov 21, 2019
screenshots added screenshots Nov 21, 2019
.gitignore Initial commit Nov 21, 2019
LICENSE Initial commit Nov 21, 2019
README.md Update README.md Nov 21, 2019
build.gradle add sample app Nov 21, 2019
gradle.properties add sample app Nov 21, 2019
gradlew add sample app Nov 21, 2019
gradlew.bat add sample app Nov 21, 2019
settings.gradle add sample app Nov 21, 2019

README.md

Android RTL intro slider

This is an android intro slider library with supporting RTL layouts.

Screenshot 2

Import

First add jitpack maven repository to your project-level gradle file:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Then include library by adding it into your app-level gradle dependencies

	dependencies {
	        implementation 'com.github.alikhaleghi76:rtl-slider:1.0.6'
	}

Simple usage

After importing library, you can add slider to your layout xml file like this:

    <ali.khaleghi.rtlintroslider.RTLIntroSlider
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/introSlider" />

and in your java code:

        RTLIntroSlider introSlider = findViewById(R.id.introSlider);
        
        introSlider.addPage(
                "TITLE1",
                "DETAIL1",
                ContextCompat.getColor(this, R.color.intro_text_color1),
                ContextCompat.getColor(this, R.color.intro_background_color1),
                R.drawable.icon1
        );
        
        introSlider.addPage(
                "",
                "DETAIL2",
                ContextCompat.getColor(this, R.color.intro_text_color2),
                ContextCompat.getColor(this, R.color.intro_background_color2),
                -1
        );
        

Advanced usage

You can customize almost everything in this library! To customize slider through xml, first add this line of code to your root layout:

    xmlns:sliderOptions="http://schemas.android.com/apk/res-auto"

Then you can use this attributes to customize slider:

    <ali.khaleghi.rtlintroslider.RTLIntroSlider
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/introSlider"
        sliderOptions:next_text="@string/next"
        sliderOptions:skip_text="@string/skip"
        sliderOptions:enter_text="@string/enter"
        sliderOptions:show_indicator="true"
        sliderOptions:is_rtl="true"
        sliderOptions:active_dot_color="#CCFFFFFF"
        sliderOptions:inactive_dot_color="#77FFFFFF"
        sliderOptions:separator_color="#88FFFFFF"
        sliderOptions:next_color="#FFFFFF"
        sliderOptions:skip_color="#FFFFFF" />

You can customize slider inside java code like this:

        
        // to set custom font
        introSlider.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/custom_font.ttf"));

        // show/hide skip button
        introSlider.setSkipVisibile(true);

        // rtl/ltr slider
        introSlider.setRtl(true);

        // text of next button
        introSlider.setNextText("NEXT");

        // text of skip button
        introSlider.setSkipText("SKIP");
        
        // to add custom slider page
        introSlider.addFragment(new Fragment1());

        // show/hide indicator
        introSlider.setShowIndicator(true);
        
        // to add list of custom pages
        ArrayList<Fragment> fragments = new ArrayList<>(); 
        fragments.add(new Fragment1()); 
        fragments.add(new Fragment2()); 
        introSlider.addFragments(fragments);
        
        // observe skip button click
        introSlider.addOnSkipClickListener(() -> finish());
        

License

GNU General Public License v3.0

You can’t perform that action at this time.