Android Material Intro Screen


Source link: https://github.com/TangoAgency/material-intro-screen

Android Material Intro Screen

Material intro screen is inspired by Material Intro and developed with love from scratch. I decided to rewrite completely almost all features in order to make Android intro screen easy to use for everyone and extensible as possible.

Features

Simple slide Custom slide Permission slide Finish slide

Usage

Step 1:

Add gradle dependecy

dependencies {

compile 'agency.tango.android:material-intro-screen:{
latest_release
}
' 
}
 

Step 2:

First, your intro activity class needs to extend MaterialIntroActivity:

public class IntroActivity extends MaterialIntroActivity

Step 3:

Add activity to manifest with defined theme:


  <activity

 android:name=".IntroActivity"

 android:theme="@style/Theme.Intro" />

Step 4:

Add slides:

 @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

addSlide(new SlideFragmentBuilder()

  .backgroundColor(R.color.colorPrimary)

  .buttonsColor(R.color.colorAccent)

  .possiblePermissions(new String[]{
Manifest.permission.CALL_PHONE, Manifest.permission.READ_SMS
}
)

  .neededPermissions(new String[]{
Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION
}
)

  .image(agency.tango.materialintroscreen.R.drawable.ic_next)

  .title("title 3")

  .description("Description 3")

  .build(),

  new MessageButtonBehaviour(new View.OnClickListener() {

@Override

public void onClick(View v) {

 showMessage("We provide solutions to make you love your work");

}

  
}
, "Work with love"));
 
}

Explanation of SlideFragment usage:

  • possiblePermissions ? permissions which are not necessary to be granted
  • neededPersmissions ? permission which are needed to be granted to move further from that slide
  • MessageButtonBehaviour ? create a new instance only if you want to have a custom action or text on a message button

Step 5:

Customize Intro Activity:

  • setSkipButtonVisible() ? show skip button instead of back button on the left bottom of screen
  • hideBackButton() ? hides any button on the left bottom of screen
  • enableLastSlideAlphaExitTransition() ? set if the last slide should disapear with alpha hiding effect

Customizing view animations:

You can set enter, default and exit translation for every view in intro activity. To achive this you need to get translation wrapper for chosen view (for example: getNextButtonTranslationWrapper()) and set there new class which will implement IViewTranslation

getBackButtonTranslationWrapper()

  .setEnterTranslation(new IViewTranslation() {

@Override

public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {

 view.setAlpha(percentage);

}

  
}
);

Available translation wrappers:

  • getNextButtonTranslationWrapper()
  • getBackButtonTranslationWrapper()
  • getPageIndicatorTranslationWrapper()
  • getViewPagerTranslationWrapper()
  • getSkipButtonTranslationWrapper()

Custom slides

Of course you are able to implement completely custom slides. You only need to extend SlideFragment and override following functions:

  • backgroundColor()
  • buttonsColor()
  • canMoveFurther() (only if you want to stop user from being able to move further before he will do some action)
  • cantMoveFurtherErrorMessage() (as above)

If you want to use parallax in a fragment please use one of the below views:

And set there the app:layout_parallaxFactor attribute:

<agency.tango.materialintroscreen.parallax.ParallaxLinearLayout xmlns:android="http://schemas.android.com/apk/res/android">

<ImageView

android:id="@+id/image_slide"

app:layout_parallaxFactor="0.6"/>

All features which are not available in simple Slide Fragment are shown here: Custom Slide

Things I have used to create this

Getting Help

To report a specific problem or feature request, open a new issue on Github.

Company

           

Here you can see open source work developed by Tango Agency.

Whether you're searching for a new partner or trusted team for creating your new great product we are always ready to start work with you.

You can contact us via [email protected]. Thanks in advance.

Resources

Set of helpful utils for the Android platform.

This plugin provides a task to generate a HTML license report based on the configuration. (eg. licenseDebugReport for all debug dependencies in an Android project).

Applying this to an Android or Java project will generate a the license file (open_source_licenses.html) in the <project>/build/reports/licenses/.

Extended management of fragments for the Android platform.

View and navigational transitions for the Android platform.

Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image selection.

Cryptographic tools for the Android platform.

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