Skip to content

Repository files navigation

material-intro

Android Arsenaljitpack.ioBuild StatusApache License 2.0

A simple material design app intro with cool animations and a simple API.

Very inspired by Google's app intros.

Demo video on YouTube: https://youtu.be/eKnCHw0UTrk

Demo

A demo app is available on Google Play:

Get it on Google Play

Screenshots

Simple slideCustom slideFade effectFullscreen
Simple slideCustom slideFade effectFullscreen
SimpleSlide.javaFragmentSlide.javaIntroActivity.javaIntroActivity.java

Dependency

material-intro is available on jitpack.io

Gradle dependency:

allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.heinrichreimersoftware:material-intro:1.2.1'
}

How-To-Use

Step 1: Your Activity must extend IntroActivity and be in your AndroidManifest.java:

publicclassMainIntroActivityextendsIntroActivity{
@OverrideprotectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
}
}
<manifest ...>
<application ...>
<activityandroid:name=".MainIntroActivity"android:theme="@style/Theme.Intro"/>
</application>
</manifest>

Step 2: Add Slides:

publicclassMainIntroActivityextendsIntroActivity{
@OverrideprotectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
/** * Standard slide (like Google's intros) */addSlide(newSimpleSlide.Builder()
.title(R.string.title_1)
.description(R.string.description_1)
.image(R.drawable.image_1)
.background(R.color.background_1)
.backgroundDark(R.color.background_dark_1)
.permission(Manifest.permission.CAMERA)
.build());
/** * Custom fragment slide */addSlide(newFragmentSlide.Builder()
.background(R.color.background_2)
.backgroundDark(R.color.background_dark_2)
.fragment(R.layout.fragment_2, R.style.FragmentTheme)
.build());
}
}

Slide types:

  • SimpleSlide: Standard slide featuring a title, short description and image like Google's intros.
  • FragmentSlide: Custom slide containing a Fragment or a layout resource.
  • Slide: Base slide. If you want to modify what's shown in your slide this is the way to go.
  • Feel free to submit an issue or pull request if you think any slide types are missing

Step 3: Enable features:

publicclassMainIntroActivityextendsIntroActivity{
@OverrideprotectedvoidonCreate(BundlesavedInstanceState){
/* Enable/disable fullscreen */setFullscreen(true);
super.onCreate(savedInstanceState);
/* Enable/disable skip button */setSkipEnabled(true);
/* Enable/disable finish button */setFinishEnabled(true);
/* Add a navigation policy to define when users can go forward/backward */setNavigationPolicy(newNavigationPolicy() {
@OverridepublicbooleancanGoForward(intposition) {
returntrue;
}
@OverridepublicbooleancanGoBackward(intposition) {
returnfalse;
}
});
/* Add a listener to detect ehen users try to go to a page they can't go to */addOnNavigationBlockedListener(newOnNavigationBlockedListener() {
@OverridepublicvoidonNavigationBlocked(intposition, intdirection) {
}
});
/* Add your own page change listeners */addOnPageChangeListener(newViewPager.OnPageChangeListener(){
@OverridepublicvoidonPageScrolled(intposition, floatpositionOffset, intpositionOffsetPixels) {
}
@OverridepublicvoidonPageSelected(intposition) {
}
@OverridepublicvoidonPageScrollStateChanged(intstate) {
}
});
}
}

Changes

  • Version 1.2.1:
    • Fixed annotation bug
  • Version 1.2:
    • Validation feature (#7, 55d2d08)
    • Permission requests (55d2d08)
    • Bug fixes
  • Version 1.1:
    • Bug fixes (#1, #4, #5, #6, #21)
    • Option to disable skip button / finish button (#3)
    • Added demo on how to open a new activity after completing the inro (#14)
    • Added scrollable slides (#22)
  • Version 1.0:
    • Initial release

Open source libraries

material-intro uses the following open source files:

License

Copyright 2016 Heinrich Reimer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A simple material design app intro with cool animations and a simple API.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages