<commit_before># Introduction [![Download](https://img.shields.io/github/release/rubengees/introduction.svg?label=JitPack)](https://jitpack.io/#rubengees/introduction/) ![API](https://img.shields.io/badge/API-14%2B-blue.svg) [![CircleCI](https://circleci.com/gh/rubengees/introduction.svg?style=shield)](https://circleci.com/gh/rubengees/introduction)

Show a beautiful Intro to your users with ease.

![](art/screenshot_gallery.png)

You can download the latest sample app [here](https://github.com/rubengees/introduction/releases/download/2.0.0/sample-release.apk).

### Table of contents

- [Include in your Project](#include-in-your-project)
- [Usage](#usage)
  - [Options](#options)
  - [Use Gifs as images](#use-gifs-as-images)
  - [Runtime Permissions](#runtime-permissions)
  - [Styles](#styles)
  - [Custom Views](#custom-views)
  - [Further reading](#further-reading)
- [Upgrade Guide](#upgrade-guide)
  - [1.1.0 to 1.1.1+](#110-to-111)
  - [1.0.x to 1.1.0+](#10x-to-110)
- [Metrics](#metrics)
- [Contributions and contributors](#contributions-and-contributors)
- [Acknowledgments](#acknowledgments)

### Include in your Project

Add this to your root `build.gradle` (usually in the root of your project):

```groovy
repositories {
    maven { url "https://jitpack.io" }
}
```

And this to your module `build.gradle` (usually in the `app` directory):

```groovy
dependencies {
    implementation 'com.github.rubengees:introduction:2.0.0'
}
```

If that doesn't work, look if there is a new version and the Readme was not updated yet.

If you want to use asynchronous image loading, introduced in the new version 1.1.0, you will need [Glide](https://github.com/bumptech/glide) or some other image loading library. If you want to use GIFs you will also need it.

### Usage

Create an `IntroductionBuilder` like the following:

```java
new IntroductionBuilder(this) // this is the Activity you want to start from.
```

Then add some Slides to your Introduction:

```java
new IntroductionBuilder(this).withSlides(generateSlides())
```

```java
private List<Slide> generateSlides() {
    List<Slide> result = new ArrayList<>();

    result.add(new Slide()
            .withTitle("Some title")
            .withDescription("Some description").
            withColorResource(R.color.green)
            .withImage(R.drawable.myImage)
    );

    result.add(new Slide()
            .withTitle("Another title")
            .withDescription("Another description")
            .withColorResource(R.color.indigo)
            .withImage(R.drawable.myImage2)
    );

    return result;
}
```

Finally introduce yourself!

```java
new IntroductionBuilder(this).withSlides(generateSlides()).introduceMyself();
```

That was easy right?

You can do many customizations, which will be covered by the following.

##### Options

You can let the user make decisions, which you can use like settings.
To do that you add an Option to your slide:
<commit_msg>Fix ugly code snippet in the README<commit_after># Introduction [![Download](https://img.shields.io/github/release/rubengees/introduction.svg?label=JitPack)](https://jitpack.io/#rubengees/introduction/) ![API](https://img.shields.io/badge/API-14%2B-blue.svg) [![CircleCI](https://circleci.com/gh/rubengees/introduction.svg?style=shield)](https://circleci.com/gh/rubengees/introduction)

Show a beautiful Intro to your users with ease.

![](art/screenshot_gallery.png)

You can download the latest sample app [here](https://github.com/rubengees/introduction/releases/download/2.0.0/sample-release.apk).

### Table of contents

- [Include in your Project](#include-in-your-project)
- [Usage](#usage)
  - [Options](#options)
  - [Use Gifs as images](#use-gifs-as-images)
  - [Runtime Permissions](#runtime-permissions)
  - [Styles](#styles)
  - [Custom Views](#custom-views)
  - [Further reading](#further-reading)
- [Upgrade Guide](#upgrade-guide)
  - [1.1.0 to 1.1.1+](#110-to-111)
  - [1.0.x to 1.1.0+](#10x-to-110)
- [Metrics](#metrics)
- [Contributions and contributors](#contributions-and-contributors)
- [Acknowledgments](#acknowledgments)

### Include in your Project

Add this to your root `build.gradle` (usually in the root of your project):

```groovy
repositories {
    maven { url "https://jitpack.io" }
}
```

And this to your module `build.gradle` (usually in the `app` directory):

```groovy
dependencies {
    implementation 'com.github.rubengees:introduction:2.0.0'
}
```

If that doesn't work, look if there is a new version and the Readme was not updated yet.

If you want to use asynchronous image loading, introduced in the new version 1.1.0, you will need [Glide](https://github.com/bumptech/glide) or some other image loading library. If you want to use GIFs you will also need it.

### Usage

Create an `IntroductionBuilder` like the following:

```java
new IntroductionBuilder(this) // this is the Activity you want to start from.
```

Then add some Slides to your Introduction:

```java
new IntroductionBuilder(this).withSlides(generateSlides())
```

```java
private List<Slide> generateSlides() {
    List<Slide> result = new ArrayList<>();

    result.add(new Slide()
            .withTitle("Some title")
            .withDescription("Some description")
            .withColorResource(R.color.green)
            .withImage(R.drawable.myImage)
    );

    result.add(new Slide()
            .withTitle("Another title")
            .withDescription("Another description")
            .withColorResource(R.color.indigo)
            .withImage(R.drawable.myImage2)
    );

    return result;
}
```

Finally introduce yourself!

```java
new IntroductionBuilder(this).withSlides(generateSlides()).introduceMyself();
```

That was easy right?

You can do many customizations, which will be covered by the following.

##### Options

You can let the user make decisions, which you can use like settings.
To do that you add an Option to your slide:

{'fraction_non_alphanumeric': 0.1407783417935702, 'fraction_numerical': 0.011844331641285956, 'mean_word_length': 3.9714045416316233, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '695563', 'n_tokens_mistral': 1980, 'n_tokens_neox': 1788, 'n_words': 500}