Skip to content
This repository was archived by the owner on Jan 3, 2019. It is now read-only.

Commit 96efcd7

Browse files
author
nimrodda
committed
Merge branch 'develop'
2 parents a048eda + dcd9e84 commit 96efcd7

File tree

10 files changed

+56
-14
lines changed

10 files changed

+56
-14
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "docs"]
2+
path = docs
3+
url = https://github.com/Nimrodda/WizarDroid.wiki.git

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ before_install:
1616
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
1717

1818
# Gradle
19-
- wget http://services.gradle.org/distributions/gradle-1.8-bin.zip
20-
- unzip gradle-1.8-bin.zip
21-
- export GRADLE_HOME=$PWD/gradle-1.8
19+
- wget http://services.gradle.org/distributions/gradle-1.11-bin.zip
20+
- unzip gradle-1.11-bin.zip
21+
- export GRADLE_HOME=$PWD/gradle-1.11
2222
- export PATH=$GRADLE_HOME/bin:$PATH
2323

2424
# install android build tools

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change Log
22
===============================================================================
33

4+
Version 1.2.0 *(2014-03-18)*
5+
----------------------------
6+
7+
* Fix: Issue #37 - removed minSdk and targetSdk from AndroidManifest.xml - contributed by @knicknak
8+
* Feature: Device's back button will now cause the wizard to go to the previous step - contributed by @denny0223
9+
* Feature: Install WizarDroid.aar to local maven repository via 'gradle install' command
10+
* Upgraded to Gradle 1.11 and Android Gradle plugin 0.9.0
11+
412
Version 1.1.1 *(2013-11-10)*
513
----------------------------
614

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:0.6.+'
6+
classpath 'com.android.tools.build:gradle:0.9.+'
7+
classpath 'com.github.dcendents:android-maven-plugin:1.0'
78
}
89
}
910

1011
allprojects {
11-
version = "1.1.1"
12+
version = "1.2.0"
1213
group = "org.codepond"
14+
15+
project.ext {
16+
versionCode = 5
17+
}
1318
}
1419

1520
subprojects {

docs

Submodule docs added at 3021e4c

wizardroid-sample/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion 14
99
targetSdkVersion 19
10+
versionCode project.ext.versionCode
11+
versionName version
1012
}
1113

1214
signingConfigs {

wizardroid-sample/src/main/AndroidManifest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="org.codepond.wizardroid.sample"
4-
android:versionCode="4" android:versionName="1.1.1">
3+
package="org.codepond.wizardroid.sample" >
54

6-
<uses-sdk android:minSdkVersion="14"
7-
android:targetSdkVersion="19"
8-
android:theme="@android:style/Theme.Holo.Light.DarkActionBar"/>
5+
<uses-sdk android:theme="@android:style/Theme.Holo.Light.DarkActionBar"/>
96
<application android:icon="@drawable/icon"
107
android:label="@string/app_name"
118
android:uiOptions="splitActionBarWhenNarrow">

wizardroid/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apply plugin: 'android-library'
2-
apply plugin: 'maven'
2+
apply plugin: 'android-maven'
33
apply plugin: 'signing'
44

55
android {
@@ -9,6 +9,8 @@ android {
99
defaultConfig {
1010
minSdkVersion 9
1111
targetSdkVersion 19
12+
versionCode project.ext.versionCode
13+
versionName version
1214
}
1315
}
1416

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="4" android:versionName="1.1.1" package="org.codepond.wizardroid">
3-
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.codepond.wizardroid">
43
<application/>
5-
</manifest>
4+
</manifest>

wizardroid/src/main/java/org/codepond/wizardroid/Wizard.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.support.v4.app.Fragment;
44
import android.support.v4.app.FragmentActivity;
55
import android.support.v4.app.FragmentManager;
6+
import android.support.v4.app.FragmentManager.OnBackStackChangedListener;
67
import android.support.v4.app.FragmentStatePagerAdapter;
78
import android.support.v4.view.ViewPager;
89
import android.view.ViewGroup;
@@ -42,8 +43,10 @@ public static interface WizardCallbacks {
4243
private final ContextManager contextManager;
4344
private final WizardCallbacks callbacks;
4445
private final ViewPager mPager;
46+
private final FragmentManager mFragmentManager;
4547

4648
private boolean fingerSlide;
49+
private int backStackEntryCount;
4750

4851

4952
/**
@@ -61,12 +64,28 @@ public Wizard(final WizardFlow wizardFlow,
6164
this.contextManager = contextManager;
6265
this.callbacks = callbacks;
6366
this.mPager = (ViewPager) activity.findViewById(R.id.step_container);
67+
this.mFragmentManager = activity.getSupportFragmentManager();
68+
6469
if (mPager == null) {
6570
throw new RuntimeException("Cannot initialize Wizard. View with ID: step_container not found!" +
6671
" The hosting Activity/Fragment must have a ViewPager in its layout with ID: step_container");
6772
}
73+
6874
mPager.setAdapter(new WizardPagerAdapter(activity.getSupportFragmentManager()));
6975

76+
backStackEntryCount = mFragmentManager.getBackStackEntryCount();
77+
mFragmentManager.addOnBackStackChangedListener(new OnBackStackChangedListener() {
78+
@Override
79+
public void onBackStackChanged() {
80+
backStackEntryCount = mFragmentManager.getBackStackEntryCount();
81+
82+
//onBackPressed
83+
if (backStackEntryCount < getCurrentStepPosition()){
84+
mPager.setCurrentItem(getCurrentStepPosition() - 1);
85+
}
86+
}
87+
});
88+
7089
//Implementation of OnPageChangeListener to handle wizard control via user finger slides
7190
mPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
7291

@@ -103,6 +122,12 @@ else if (positionOffset < initialOffset){
103122
@Override
104123
public void onPageSelected(int position) {
105124
//Signal that the page is now "selected"
125+
if (backStackEntryCount < position){
126+
mFragmentManager.beginTransaction().addToBackStack(null).commit();
127+
}
128+
else if (backStackEntryCount > position){
129+
mFragmentManager.popBackStack();
130+
}
106131
consumedPageSelectedEvent = true;
107132
}
108133

0 commit comments

Comments
 (0)