Onboarder


Source link: https://github.com/jrejaud/Onboarder

Onboarder

Onboarding Library for Android Inspired by Onboard for iOS.
This is a simple library to quickly create Onboarding inside your app.

A (very) simple example

Usage

###Onboarding Pages First, build Onboarding Pages. Each page relates to an Onboarding Fragment inside your Onboarding Activitiy.
You can pass a title, body text, and drawable resource int, as well as button text.
If you do not want a button in your Onboarding Fragment, user the Constructor method with no button text parameter.

//Building Onboarding Pages OnboardingPage page1 = new OnboardingPage("First screen title","This is important information, pay attention",R.drawable.logo);
 OnboardingPage page2 = new OnboardingPage(null,"This is a robut.",R.drawable.logo,"Okay, tell me more");
 OnboardingPage page3 = new OnboardingPage("The Robot again!","Hey look, it's the robot again! \nMaybe he wants to be your friend.",R.drawable.logo,"We're done here");

####Optional Settings

//Optionally set the title and body text colors for a specific page. page1.setTitleTextColor(R.color.white);
 page1.setBodyTextColor(R.color.white);
  page2.setBodyTextColor(R.color.white);
  page3.setTitleTextColor(R.color.white);
 page3.setBodyTextColor(R.color.white);
//Finally, add all the Onboarding Pages to a list List<OnboardingPage> onboardingPages = new LinkedList<>();
 onboardingPages.add(page1);
 onboardingPages.add(page2);
 onboardingPages.add(page3);
 

###Onboarding Activity ####Setting a color as background

//Create a bundle for the Onboarding Activity Bundle onboardingActivityBundle = OnboardingActivity.newBundleColorBackground(R.color.greenBackground, onboardingPages);

####Setting a color as background

//Create a bundle for the Onboarding Activity Bundle onboardingActivityBundle = OnboardingActivity..newBundleImageBackground(R.drawable.backgroundPicture, onboardingPages);

####Optional Settings

//Optionally set if the user can swipe between fragments. True by default. onboardingActivityBundle.putBoolean(OnboardingActivity.SWIPING_ENABLED,true);
  //Optionally set if the activity has dot pagination at the bottom of the screen (only available when swiping is enabled). True by default. onboardingActivityBundle.putBoolean(OnboardingActivity.HIDE_DOT_PAGINATION,false);

####Starting the Onboarding Activity

//Start the Onboarding Activity Intent intent = new Intent(this,OnboardingActivity.class);
 intent.putExtras(onboardingActivityBundle);
 startActivity(intent);

####Custom onButtonClick actions By default, clicking a button in an Onboarding Fragment will move to the next one in the list.
If the Onboarding Activity is on the last Onboarding Fragment, it will simple finish() itself.

If you want something different to happen when the user clicks a button in an Onboarding Fragment, extend the Onboarding Activitiy and override the onOnboardingClick method.

It will pass the fragment position inside of the list that the user clicked.

public class MyOnboardingActivity extends OnboardingActivity {

@Override
  public void onOnboardingClick(int position) {

Log.d("TAG", "Position is: " + position);

  
}
 
}

Next, simply start your Onboarding Activity instead of the normal one.

//Start your version of the Onboarding Activity Intent intent = new Intent(this,MyOnboardingActivity.class);
 intent.putExtras(onboardingActivityBundle);
 startActivity(intent);

Installation

Onboarder uses JitPack Gradle Installation:

Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {

maven {
 url "https://jitpack.io" 
}
  
}
 
}

Add the dependencies:

dependencies {
  compile 'com.github.jrejaud:Onboarder:v1.02'  
}

For more info, check the JitPack page

Libraries used

ViewPagerIndicator2
An (mildly) improved ViewPagerIndicator, originally by Jake Wharton

Resources

Devknox is a developer friendly plugin developed by the team behind Appknox, a cloud-based mobile security solution trusted by many businesses worldwide.

Devknox is a slick and handy security plugin for Android Studio and IntelliJ. It helps developers detect and resolve security issues as they write code.

Java 8 Optional-like APIs for everyone.

A websocket client library for Android.

A date time range picker for android written in Kotlin.

A simple view to see logcat in your app.

Utility class to make GoogleMap with custom theme.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes