material-intro-screen

½éÉÜ£º

ÓÖÒ»¸öƯÁÁµÄÒýµ¼Ò³Ð§¹û¡£

ÔËÐÐЧ¹û£º

ʹÓÃ˵Ã÷£º

Step 1:

Ìí¼ÓgradleÒÀÀµ

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

Step 2:

ÈÃÒýµ¼Ò³µÄactivity¼Ì³ÐMaterialIntroActivity:

public class IntroActivity extends MaterialIntroActivity

Step 3:

ÔÚmanifestÌí¼Óactivity²¢Ö¸¶¨¶¨ÒåºÃµÄÖ÷Ì⣺

        <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) {
                        Toast.makeText(IntroActivity.this, "We provide solutions to make you love your work", Toast.LENGTH_SHORT).show();
                    }
                }, "Work with love"));
}
已下载
0