Go through git-practical welcome page open-source library AppIntro
Without P1 today, go to the topic
Today is a handsome app slide introduction page. Why handsome?
The author defines his content in this way.
Make a cool intro for your Android app.
Let's see how it works.
Can there be other operations besides sliding? Yes. See the following.
The gray buttons can be clicked, and the entire View's SKIP and next can also be hidden. That is to say, this View is live, and it is not a background.
How to use? <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwPkdyYWRsZTo8L3A + DQo8cHJlIGNsYXNzPQ = "brush: java;"> repositories { mavenCentral()}dependencies { compile 'com.github.paolorotolo:appintro:3.4.0'}
Eclipse has a large number of friends today. If you want to use it all, you need to copy more than a dozen classes. You can just copy what you need.
Because this is the implementation of a boot page, it may be different from some common business flow activities (what is the custom BaseActivity?). Therefore, the author directly encapsulates the parent class.
Must inherit from AppIntro
Public class your class extends AppIntro
Although he also inherits from AppCompatActivity, do not overwrite him.
public abstract class AppIntro extends AppCompatActivity
The author wrote an init Method for us.public abstract void init(@Nullable Bundle savedInstanceState);
Then, call addSlide (your Fragment) to pass in Fragment, which is similar to the traditional ViewPager. AppIntro will automatically generate the dot indicator and button.
You can also use the default layout style to pass in the photo print control.addSlide(AppIntroFragment.newInstance(title, description, image, background_colour));
You can make some settings like this to set some colors to make them invisible.
setBarColor(Color.parseColor("#3F51B5")); setSeparatorColor(Color.parseColor("#2196F3")); showSkipButton(false); setProgressButtonEnabled(false); setVibrate(true); setVibrateIntensity(30);
When you click to Skip
@Override public void onSkipPressed() { }
When the user clicks finish
@Override public void onDonePressed() { }
Fragment needs to be changed
@Override public void onSlideChanged() { }
When a user clicks the next button
@Override public void onNextPressed() { }
The author has also prepared various animation effects. You can set them if necessary.
setFadeAnimation()setZoomAnimation()setFlowAnimation()setSlideOverAnimation()setDepthAnimation()