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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nimrodda committed Mar 18, 2014
2 parents a048eda + dcd9e84 commit 96efcd7
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs"]
path = docs
url = https://github.com/Nimrodda/WizarDroid.wiki.git
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ before_install:
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

# Gradle
- wget http://services.gradle.org/distributions/gradle-1.8-bin.zip
- unzip gradle-1.8-bin.zip
- export GRADLE_HOME=$PWD/gradle-1.8
- wget http://services.gradle.org/distributions/gradle-1.11-bin.zip
- unzip gradle-1.11-bin.zip
- export GRADLE_HOME=$PWD/gradle-1.11
- export PATH=$GRADLE_HOME/bin:$PATH

# install android build tools
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change Log
===============================================================================

Version 1.2.0 *(2014-03-18)*
----------------------------

* Fix: Issue #37 - removed minSdk and targetSdk from AndroidManifest.xml - contributed by @knicknak
* Feature: Device's back button will now cause the wizard to go to the previous step - contributed by @denny0223
* Feature: Install WizarDroid.aar to local maven repository via 'gradle install' command
* Upgraded to Gradle 1.11 and Android Gradle plugin 0.9.0

Version 1.1.1 *(2013-11-10)*
----------------------------

Expand Down
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.github.dcendents:android-maven-plugin:1.0'
}
}

allprojects {
version = "1.1.1"
version = "1.2.0"
group = "org.codepond"

project.ext {
versionCode = 5
}
}

subprojects {
Expand Down
1 change: 1 addition & 0 deletions docs
Submodule docs added at 3021e4
2 changes: 2 additions & 0 deletions wizardroid-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode project.ext.versionCode
versionName version
}

signingConfigs {
Expand Down
7 changes: 2 additions & 5 deletions wizardroid-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.codepond.wizardroid.sample"
android:versionCode="4" android:versionName="1.1.1">
package="org.codepond.wizardroid.sample" >

<uses-sdk android:minSdkVersion="14"
android:targetSdkVersion="19"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar"/>
<uses-sdk android:theme="@android:style/Theme.Holo.Light.DarkActionBar"/>
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:uiOptions="splitActionBarWhenNarrow">
Expand Down
4 changes: 3 additions & 1 deletion wizardroid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'android-library'
apply plugin: 'maven'
apply plugin: 'android-maven'
apply plugin: 'signing'

android {
Expand All @@ -9,6 +9,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode project.ext.versionCode
versionName version
}
}

Expand Down
5 changes: 2 additions & 3 deletions wizardroid/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="4" android:versionName="1.1.1" package="org.codepond.wizardroid">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.codepond.wizardroid">
<application/>
</manifest>
</manifest>
25 changes: 25 additions & 0 deletions wizardroid/src/main/java/org/codepond/wizardroid/Wizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentManager.OnBackStackChangedListener;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.ViewGroup;
Expand Down Expand Up @@ -42,8 +43,10 @@ public static interface WizardCallbacks {
private final ContextManager contextManager;
private final WizardCallbacks callbacks;
private final ViewPager mPager;
private final FragmentManager mFragmentManager;

private boolean fingerSlide;
private int backStackEntryCount;


/**
Expand All @@ -61,12 +64,28 @@ public Wizard(final WizardFlow wizardFlow,
this.contextManager = contextManager;
this.callbacks = callbacks;
this.mPager = (ViewPager) activity.findViewById(R.id.step_container);
this.mFragmentManager = activity.getSupportFragmentManager();

if (mPager == null) {
throw new RuntimeException("Cannot initialize Wizard. View with ID: step_container not found!" +
" The hosting Activity/Fragment must have a ViewPager in its layout with ID: step_container");
}

mPager.setAdapter(new WizardPagerAdapter(activity.getSupportFragmentManager()));

backStackEntryCount = mFragmentManager.getBackStackEntryCount();
mFragmentManager.addOnBackStackChangedListener(new OnBackStackChangedListener() {
@Override
public void onBackStackChanged() {
backStackEntryCount = mFragmentManager.getBackStackEntryCount();

//onBackPressed
if (backStackEntryCount < getCurrentStepPosition()){
mPager.setCurrentItem(getCurrentStepPosition() - 1);
}
}
});

//Implementation of OnPageChangeListener to handle wizard control via user finger slides
mPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

Expand Down Expand Up @@ -103,6 +122,12 @@ else if (positionOffset < initialOffset){
@Override
public void onPageSelected(int position) {
//Signal that the page is now "selected"
if (backStackEntryCount < position){
mFragmentManager.beginTransaction().addToBackStack(null).commit();
}
else if (backStackEntryCount > position){
mFragmentManager.popBackStack();
}
consumedPageSelectedEvent = true;
}

Expand Down

0 comments on commit 96efcd7

Please sign in to comment.