This repo forked from ShowCaseView
-
Create new variable
private GuideView mGuideView; private GuideView.Builder builder;
-
Set builder in your activity
builder = new GuideView.Builder(this) .setTitle("title lorem ipsum dolor sir amet") .setContentText("content lorem ipsum dolor sir amet") .setViewAlign(AlignType.center) .setTitleGravity(Gravity.CENTER) .setContentGravity(Gravity.RIGHT) .setButtonGravity(Gravity.CENTER) .setButtonText("OK") .setTargetView(myButton) .setGuideListener(new GuideListener() { @Override public void onDismiss(View view) { Log.d(TAG,"Success"); } }); mGuideView = builder.build(); mGuideView.show();
Gradle
- Add to your root build gradle.
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation 'com.github.happyfresh:ShowCaseView:1.1'
}
Maven
- Add to your repository link
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the dependency
<dependency>
<groupId>com.github.happyfresh</groupId>
<artifactId>ShowCaseView</artifactId>
<version>1.1</version>
</dependency>
new GuideView.Builder(this)
.setTitle("Guide Title Text")
.setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
.setTargetView(view)
.setContentTypeFace(Typeface)//optional
.setTitleTypeFace(Typeface)//optional
.setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
.build()
.show();
new GuideView.Builder(this)
.setTitle("Guide Title Text")
.setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
.setTargetView(view)
.setContentTextSize(12)//optional
.setTitleTextSize(14)//optional
.setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
.build()
.show();
new GuideView.Builder(this)
.setTitle("Guide Title Text")
.setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
.setViewAlign(AlignType.center)
.setTargetView(view)
.setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
.build()
.show();
new GuideView.Builder(this)
.setTitle("Guide Title Text")
.setTargetView(view)
.setContentSpan((Spannable) Html.fromHtml("<font color='red'>testing spannable</p>"))
.setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
.build()
.show();
new GuideView.Builder(MainActivity.this)
.setTitle("Guide Title Text")
.setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
.setViewAlign(AlignType.center)
.setTargetView(view1)
.setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
.setGuideListener(new GuideListener() {
@Override
public void onDismiss(View view) {
//TODO ...
}
})
.build()
.show();
mGuideView.mMessageView.okButton.setVisibility(View.GONE);
mGuideView.mMessageView.okButton.onclickListener...
Type | Description |
---|---|
outside | Dismissing with click on outside of MessageView |
anywhere | Dismissing with click on anywhere |
targetView | Dismissing with click on targetView(targetView is assigned with setTargetView method) |
Since HappyFresh forked and using this repo from ShowCaseView, i'm added some changes and new feature
New | Description |
---|---|
setViewAlign(AlignType.center) | Gravity for view |
setTitleGravity(Gravity.CENTER) | Gravity for title |
setContentGravity(Gravity.CENTER) | Gravity for content description |
setButtonGravity(Gravity.CENTER) | Gravity for Button |
setButtonText(string) | set button text |