Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.10'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:bintray-release:0.5.0'
}
}

allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
21 changes: 21 additions & 0 deletions config/config.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ext.configuration = [
applicationId: "com.chyrta.boilerplate",
versionMajor: 1,
versionMinor: 0,
versionPatch: 0,
versionClassifier: "",
minimumSdk: 14,
compileSdk: 27,
targetSdk: 27,
buildTools: "27.0.3"
]

def configuration = ext.configuration;

ext.buildVersionCode = {
return configuration.minimumSdk * 10000000 + configuration.versionMajor * 10000 + configuration.versionMinor * 100 + configuration.versionPatch
}

ext.buildVersionName = {
return configuration.versionMajor + "." + configuration.versionMinor + "." + configuration.versionPatch;
}
47 changes: 47 additions & 0 deletions config/library.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ext {
versions = [
kotlin: "1.2.10",
butterKnife: "8.0.1",
supportLibrary: "26.0.1",
constraintLayout: "1.0.2",
pageIndicator: "0.2.0"
]
}


ext {
versions = [
androidBuildToolsVersion: "27.0.3",
androidMinSdkVersion : 15,
androidTargetSdkVersion : 27,
androidCompileSdkVersion: 27,
kotlinVersion : "1.2.10",
butterKnifeVersion : "8.8.1",
supportLibraryVersion : "27.0.3",
constraintLayoutVersion : "1.0.2",
pageIndicatorViewVersion: "0.2.0",
]

// Libraries
supportDeps = [
appCompatV7 : "com.android.support:appcompat-v7:$versions.supportLibraryVersion",
design : "com.android.support:design:$versions.supportLibraryVersion",
constraintLayout: "com.android.support.constraint:constraint-layout:$versions.constraintLayoutVersion"
]

injection = [
butterKnife: "com.jakewharton:butterknife:$versions.butterKnifeVersion",
]

processors = [
butterKnifeCompiler: "com.jakewharton:butterknife-compiler:$versions.butterKnifeVersion"
]

kotlin = "org.jetbrains.kotlin:kotlin-stdlib-jre8:$versions.kotlinVersion"
pageIndicator = "com.romandanylyk:pageindicatorview:$versions.pageIndicatorViewVersion"

supportDepsLibraries = supportDeps.values()
injectionLibraries = injection.values()
annotationProcessors = processors.values()

}
36 changes: 36 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ext {
versions = [
androidBuildToolsVersion: "26.0.1",
androidMinSdkVersion : 15,
androidTargetSdkVersion : 26,
androidCompileSdkVersion: 26,
kotlinVersion : "1.1.3-2",
butterKnifeVersion : "8.0.1",
supportLibraryVersion : "26.0.1",
constraintLayoutVersion : "1.0.2",
pageIndicatorViewVersion: "0.2.0",
]

// Libraries
supportDeps = [
appCompatV7 : "com.android.support:appcompat-v7:$versions.supportLibraryVersion",
design : "com.android.support:design:$versions.supportLibraryVersion",
constraintLayout: "com.android.support.constraint:constraint-layout:$versions.constraintLayoutVersion"
]

injection = [
butterKnife: "com.jakewharton:butterknife:$versions.butterKnifeVersion",
]

processors = [
butterKnifeCompiler: "com.jakewharton:butterknife-compiler:$versions.butterKnifeVersion"
]

kotlin = "org.jetbrains.kotlin:kotlin-stdlib-jre8:$versions.kotlinVersion"
pageIndicator = "com.romandanylyk:pageindicatorview:$versions.pageIndicatorViewVersion"

supportDepsLibraries = supportDeps.values()
injectionLibraries = injection.values()
annotationProcessors = processors.values()

}
109 changes: 109 additions & 0 deletions documentation/Android Onboarder 1.0 Migration Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Android Onboarder 1.0 Migration Guide

Android Onboarder 1.0 a is first and latest major release of Android Onboarder which helps you to create beautiful onboarding experience for the users of your app. Recently, Google has released their own [guidelines]("material.io/guidelines/growth-communications/onboarding.html") of how onboarding should works in Android apps which support Material Design pattern.

## New Requirements
Android Onboarder works starting from API 16 and targeted to Android Oreo API 26.

## Breaking API changes

### Kotlin
First release of the library was rewritten to Kotlin to reduce size of the codebase and provides support of first-class supported of the modern language by Google.

### Creating of onboarding pages
One of the weak points of the library as its many copycats around Github is creating onboarging simply with constructor and provided parameters which strongly restricted of what do we want to see in the result. Android Onboarder offers you to use classic Builder patterns while creating onboarding pages.

Previously:
```java
OnboarderPage onboarderPage1 = new OnboarderPage("Planet Earth", "Our lovely pale blue dot", R.drawable.planet1);
OnboarderPage onboarderPage2 = new OnboarderPage("Venus", "The love goddess", R.drawable.planet2);
OnboarderPage onboarderPage3 = new OnboarderPage("Mars", "Say hi to Curiosity!", R.drawable.planet3);

onboarderPage1.setBackgroundColor(R.color.onboarder_bg_1);
onboarderPage2.setBackgroundColor(R.color.onboarder_bg_2);
onboarderPage3.setBackgroundColor(R.color.onboarder_bg_3);

List<OnboarderPage> pages = new ArrayList<>();

pages.add(onboarderPage1);
pages.add(onboarderPage2);
pages.add(onboarderPage3);

for (OnboarderPage page : pages) {
page.setTitleColor(R.color.primary_text);
page.setDescriptionColor(R.color.secondary_text);
page.setMultilineDescriptionCentered(true);
}

setSkipButtonTitle("Skip");
setFinishButtonTitle("Finish");

setOnboardPagesReady(pages);
```

Now:
```java
addPage(OnboarderPage.newCreator()
.title("Planet Earth")
.description("Our lovely pale blue dot")
.backgroundColor(R.color.black_transparent)
.imageResourceId(R.drawable.planet1)
.create());
addPage(OnboarderPage.newCreator()
.title("Venus")
.description("The love goddess")
.backgroundColor(R.color.black_transparent)
.imageResourceId(R.drawable.planet2)
.create());
addPage(OnboarderPage.newCreator()
.title("Mars")
.description("Say hi to Curiosity")
.backgroundColor(R.color.black_transparent)
.imageResourceId(R.drawable.planet3)
.create());
addGetStartedButton(GetStartedButton.newCreator()
.text("Get started")
.textColorResourceId(R.color.colorAccent)
.create());
startOnboarding();
```

### Introducing Get Started Button


### Reducing customization
Regarding Google's in direction of describing, as a creator of the library I decided to reduce the respecting to support key features as the aim of the library is to help developers reduce quantity of hours on implementing onboarding stuff.

Due to that changes, skip and finish buttons were removed.

#### Removed Skip and Finish buttons
These buttons were removed, use Getting Started.
```java
setSkipButtonTitle("Skip");
setFinishButtonTitle("Finish")
```


Previously:
```java
@Override
public void onSkipButtonPressed() {
super.onSkipButtonPressed();
Toast.makeText(this, "Skip button was pressed!", Toast.LENGTH_SHORT).show();
}

@Override
public void onFinishButtonPressed() {
Toast.makeText(this, "Finish button was pressed", Toast.LENGTH_SHORT).show();
}
```

Now:
```java
@Override
public void onGetStartedButtonPressed() {
Toast.makeText(this, "Skip button was pressed!", Toast.LENGTH_SHORT).show();
}
```

Presenting new 'Get Started', you have take care of all the stuff which should be happened after in
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

support_library_version = 26.0.1
# org.gradle.parallel=true
25 changes: 14 additions & 11 deletions onboarder/build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

repositories {
jcenter()
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
buildToolsVersion '26.0.2'

defaultConfig {
minSdkVersion 14
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

}

dependencies {
testCompile 'junit:junit:4.12'
apply from: "../dependencies.gradle"

compile "com.android.support:appcompat-v7:$support_library_version"
compile "com.android.support:design:$support_library_version"
dependencies {
implementation kotlin
implementation supportDepsLibraries
implementation injectionLibraries
implementation pageIndicator
annotationProcessor annotationProcessors
}

publish {
Expand Down Expand Up @@ -106,4 +109,4 @@ subprojects {
}
}
}
}
}
45 changes: 45 additions & 0 deletions onboarder/src/main/java/com/chyrta/onboarder/GetStartedButton.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.chyrta.onboarder

import android.support.annotation.ColorRes
import android.support.annotation.StringRes

class GetStartedButton {

var title: String? = null
var titleResourceId: Int? = null
private set
@StringRes get
var textColorResourceId: Int? = null
private set
@ColorRes get

inner class Creator internal constructor() {

fun text(title: String): Creator {
this@GetStartedButton.title = title
return this
}

fun textResourceId(@StringRes titleResourceId: Int): Creator {
this@GetStartedButton.titleResourceId = titleResourceId
return this
}

fun textColor(@ColorRes textColorResourceId: Int): Creator {
this@GetStartedButton.textColorResourceId = textColorResourceId
return this
}

fun create(): GetStartedButton {
return this@GetStartedButton
}

}

companion object {
fun newCreator(): Creator {
return GetStartedButton().Creator()
}
}

}
Loading