Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added gradle instructions for use with gradle 7+ #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 56 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,51 @@ Since Google introduced the Material design philosophy I have seen quite a few a

[![jitpack][4]][5]

Add the jitpack repo to your your project's build.gradle at the end of repositories [Why?](#why-jitpack)
Add the jitpack repo to your your project. [Why?](#why-jitpack)

Using the new dependency resolution management (Gradle 6.8+):

/settings.gradle
```groovy
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```

For older gradle versions:

/build.gradle
```groovy
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
```

Then add the dependency to your module's build.gradle:

/app/build.gradle
```groovy
// gradle 7.0+
implementation 'com.github.deano2390:MaterialShowcaseView:1.3.7'

// older versions
compile 'com.github.deano2390:MaterialShowcaseView:1.3.7'
```

NOTE: Some people have mentioned that they needed to add the @aar suffix to get it to resolve from JitPack:
```groovy
// gradle 7.0+
implementation 'com.github.deano2390:MaterialShowcaseView:1.3.7@aar'

// older versions
compile 'com.github.deano2390:MaterialShowcaseView:1.3.7@aar'
```

Expand All @@ -48,37 +72,33 @@ This is the basic usage of a single showcase view, you should check out the samp

```java

// single example
new MaterialShowcaseView.Builder(this)
.setTarget(mButtonShow)
.setDismissText("GOT IT")
.setContentText("This is some amazing feature you should know about")
.setDelay(withDelay) // optional but starting animations immediately in onCreate can make them choppy
.singleUse(SHOWCASE_ID) // provide a unique ID used to ensure it is only shown once
.show();




// sequence example
ShowcaseConfig config = new ShowcaseConfig();
config.setDelay(500); // half second between each showcase view

MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this, SHOWCASE_ID);

sequence.setConfig(config);

sequence.addSequenceItem(mButtonOne,
"This is button one", "GOT IT");

sequence.addSequenceItem(mButtonTwo,
"This is button two", "GOT IT");

sequence.addSequenceItem(mButtonThree,
"This is button three", "GOT IT");

sequence.start();

// single example
new MaterialShowcaseView.Builder(this)
.setTarget(mButtonShow)
.setDismissText("GOT IT")
.setContentText("This is some amazing feature you should know about")
.setDelay(withDelay) // optional but starting animations immediately in onCreate can make them choppy
.singleUse(SHOWCASE_ID) // provide a unique ID used to ensure it isonly shown once
.show();

// sequence example
ShowcaseConfig config = new ShowcaseConfig();
config.setDelay(500); // half second between each showcase view

MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this,SHOWCASE_ID);

sequence.setConfig(config);

sequence.addSequenceItem(mButtonOne,
"This is button one", "GOT IT");

sequence.addSequenceItem(mButtonTwo,
"This is button two", "GOT IT");

sequence.addSequenceItem(mButtonThree,
"This is button three", "GOT IT");

sequence.start();
```

# Why Jitpack
Expand Down