實現一個很酷的Android應用介紹:AppIntro

gf67 9年前發布 | 29K 次閱讀 AppIntro Android開發 移動開發

AppIntro幫助您實現一個很酷的Android應用介紹。

使用說明:

build.gradle:


repositories {
    mavenCentral()
}

dependencies {
  compile 'com.github.paolorotolo:appintro:1.1.0'
}


創建一個繼承自AppIntro的Activity


public class MyIntro extends AppIntro {

    // Please DO NOT override onCreate. Use init.
    @Override
    public void init(Bundle savedInstanceState) {

        // Add your slide's fragments here.
        // AppIntro will automatically generate the dots indicator and buttons.
        addSlide(new FirstSlide(), getApplicationContext());
        addSlide(new SecondSlide(), getApplicationContext());
        addSlide(new ThirdSlide(), getApplicationContext());
        addSlide(new FourthSlide(), getApplicationContext());

        // You can override bar/separator color if you want.
        setBarColor(Color.parseColor("#3F51B5"));
        setSeparatorColor(Color.parseColor("#2196F3"));

        // You can also hide Skip button
        showSkipButton(false);
    }

    @Override
    public void onSkipPressed() {
    // Do something when users tap on Skip button.
    }

    @Override
    public void onDonePressed() {
    // Do something when users tap on Done button.
    }
}


注意 不要重寫onCreate,只用 init 方法就可以了。


項目主頁:http://www.baiduhome.net/lib/view/home/1434096459676

 本文由用戶 gf67 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!