简体   繁体   中英

add library into android project from GitHub

how to download library from " https://github.com/TangoAgency/material-intro-screen " ? I want to download library file and add that to my project.

只需在依赖项部分的应用程序模块gradle文件中添加以下行:

compile 'agency.tango.android:material-intro-screen:0.0.3'

Add this line in your build.gradle file.

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

You have to follow these steps (available at the bottom of the github page)

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"));
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM