Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
badoualy committed Jun 25, 2016
2 parents 5d7a6a5 + 8d6aecd commit 057603e
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 14 deletions.
Binary file modified ART/screen.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-stepper--indicator-green.svg?style=true)](https://android-arsenal.com/details/1/3711)

# ![](https://github.com/badoualy/stepper-indicator/blob/master/sample/src/main/res/mipmap-mdpi/ic_launcher.png) Stepper indicator
> ### Designed by the great https://dribbble.com/LeslyPyram :)
> ### Designed by the awesome https://dribbble.com/LeslyPyram :)
<img src="https://github.com/badoualy/stepper-indicator/blob/master/ART/screen.gif" width="300">

Expand Down
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://jitpack.io" }
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.12'
gradleVersion = '2.14'
}

task clean(type: Delete) {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
GROUP=com.github.badoualy
VERSION_CODE=102
VERSION_NAME=1.0.2
VERSION_CODE=101
VERSION_NAME=1.0.1

POM_NAME=Stepper Indicator
POM_ARTIFACT_ID=stepper-indicator
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 13 07:42:04 CEST 2016
#Thu Jun 16 07:35:21 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ public int getCurrentStep() {
/**
* Sets the current step
*
* @param currentStep a value between 0 (inclusive) and stepCount (exclusive)
* @param currentStep a value between 0 (inclusive) and stepCount (inclusive)
*/
@UiThread
public void setCurrentStep(int currentStep) {
if (currentStep < 0 || currentStep >= stepCount)
if (currentStep < 0 || currentStep > stepCount)
throw new IllegalArgumentException("Invalid step value " + currentStep);

previousStep = this.currentStep;
Expand Down Expand Up @@ -396,11 +396,23 @@ public void setViewPager(ViewPager pager) {
setViewPager(pager, pager.getAdapter().getCount());
}

/**
* Sets the pager associated with this indicator
*
* @param pager viewpager to attach
* @param keepLastPage true if should not create an indicator for the last page, to use it as the final page
*/
public void setViewPager(ViewPager pager, boolean keepLastPage) {
if (pager.getAdapter() == null)
throw new IllegalStateException("ViewPager does not have adapter instance.");
setViewPager(pager, pager.getAdapter().getCount() - (keepLastPage ? 1 : 0));
}

/**
* Sets the pager associated with this indicator
*
* @param pager viewpager to attach
* @param stepCount the real page count to display (use this if you are using looped viewpager)
* @param stepCount the real page count to display (use this if you are using looped viewpager to indicate the real number of pages)
*/
public void setViewPager(ViewPager pager, int stepCount) {
if (this.pager == pager)
Expand Down
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.badoualy.stepperindicator.sample"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 101
versionName "1.0.1"
}
buildTypes {
release {
Expand All @@ -29,5 +29,5 @@ dependencies {
if (compileLocal)
compile project(':library')
else
compile 'com.github.badoualy:stepper-indicator:1.0.0'
compile 'com.github.badoualy:stepper-indicator:1.0.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

StepperIndicator indicator = (StepperIndicator) findViewById(R.id.stepper_indicator);
assert indicator != null;
indicator.setViewPager(pager, pager.getAdapter().getCount() - 1);
// We keep last page for a "finishing" page
indicator.setViewPager(pager, true);
}

public static class PageFragment extends Fragment {
Expand Down

0 comments on commit 057603e

Please sign in to comment.