Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimorinny/show-case-card-view
Show case card view
https://github.com/dimorinny/show-case-card-view
android library view
Last synced: about 2 months ago
JSON representation
Show case card view
- Host: GitHub
- URL: https://github.com/dimorinny/show-case-card-view
- Owner: dimorinny
- License: apache-2.0
- Created: 2017-06-11T18:37:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-05T03:03:44.000Z (almost 2 years ago)
- Last Synced: 2023-09-18T16:05:23.846Z (over 1 year ago)
- Topics: android, library, view
- Language: Java
- Homepage:
- Size: 2.6 MB
- Stars: 147
- Watchers: 4
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Demo](https://github.com/dimorinny/show-case-card-view/blob/master/art/demo.gif?raw=true)
[![](https://jitpack.io/v/dimorinny/show-case-card-view.svg)](https://jitpack.io/#dimorinny/show-case-card-view)
## Dependency
Firstly, add Jitpack repository in your root build.gradle file (not your module build.gradle file):
```
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```Add dependency to your module's build.gradle file:
```
dependencies {
implementation 'com.github.dimorinny:show-case-card-view:0.0.4'
}
```## Usage
You can display a ShowCase on your activity or fragment using the below code.
To display a list of (click-through) steps:
```java
new ShowCaseStepDisplayer.Builder(MainActivity.this)
.addStep(new ShowCaseStep(new Center(), "Message at center"))
.addStep(new ShowCaseStep(view, "Message at View"))
.build().start();
```Use withScrollView() if some step's target Views could be inside a ScrollView, they will be auto-scrolled to:
```java
new ShowCaseStepDisplayer.Builder(MainActivity.this)
.withScrollView(scrollView)
.addStep(new ShowCaseStep(view, "Message at View to scroll to"))
.addStep(new ShowCaseStep(new TopLeft(), "Message at TopLeft"))
.build().start();
```To display a single item:
```java
new ShowCaseView.Builder(MainActivity.this)
.withTypedPosition(new TopLeft())
.withTypedRadius(new Radius(186F))
.withContent("This is hello world!")
.build()
.show(this);
```**Available positions:**
* `Position(PointF position)`
* `TopLeft()`
* `TopRight()`
* `BottomLeft()`
* `BottomRight()`
* `TopLeftToolbar()`
* `TopRightToolbar()`
* `ViewPosition(View view)`
* `Center()`
* `BottomCenter()`**Available radiuses:**
* `Radius(float radius)`
* `ViewRadius(View view)`For more complicated usage - see [example](https://github.com/dimorinny/show-case-card-view/blob/master/app/src/main/java/ru/dimorinny/showcasesample/MainActivity.java).