Skip to content

Commit afa69fb

Browse files
author
sergey_polohach_cr
committed
fixed issue
1 parent 6c48c8e commit afa69fb

File tree

63 files changed

+1207
-1226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1207
-1226
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
Version | Changes
88
--- | ---
9+
v.1.0.9 | <ul><li>Fixed issue #65 https://github.com/Cleveroad/SlidingTutorial-Android/issues/65</li><li>Scrolling in one direction. Added flag for rollback?</li></ul>
910
v.1.0.8 | Fixed issue with NullPointerException with addOnTutorialPageChangeListener() called before onCreate()
1011
v.1.0.7 | <ul><li>Fixed import for SupportTutorialFragment</li><li>Updated versions of dependencies</li></ul>
1112
v.1.0.6 | <ul><li>Added new simple way of creation of tutorial</li><li>Fixed memory leaks issues</li><li>Updated default sizes of page indicator's elements</li><li>Updated default colors of page indicator</li><li>Updated versions of dependencies</li><li>Removed unused or unnecessary methods</li></ul>

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ All you need to do is:
2828

2929
## Full Documentation
3030

31+
## Setup
32+
To include this library to your project add dependency in **build.gradle** file:
33+
```groovy
34+
dependencies {
35+
implementation "com.cleveroad:slidingtutorial:1.0.9"
36+
}
37+
```
38+
3139
[Quick Start]
3240

3341
* [Configure your tutorial with TutorialOptions]

build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4+
ext.junit_version = '4.12'
5+
ext.support_version = '28.0.0'
6+
ext.constraint_layout_version = '1.1.3'
7+
ext.leakcanary_version = '1.5.4'
8+
ext.tools_build_gradle_version = '3.1.3'
9+
410
repositories {
511
jcenter()
12+
google()
613
}
714
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.0'
15+
classpath "com.android.tools.build:gradle:$tools_build_gradle_version"
916
// NOTE: Do not place your application dependencies here; they belong
1017
// in the individual module build.gradle files
1118
}
@@ -14,5 +21,6 @@ buildscript {
1421
allprojects {
1522
repositories {
1623
jcenter()
24+
google()
1725
}
18-
}
26+
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.0.8
2-
VERSION_CODE=18
1+
VERSION_NAME=1.0.9
2+
VERSION_CODE=19
33
GROUP=com.cleveroad
44

55
POM_DESCRIPTION=Sliding tutorial is simple library that help other developers easy create great tutotial

gradle/wrapper/gradle-wrapper.jar

53.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Nov 14 13:57:01 EET 2018
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

lib/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
4+
compileSdkVersion 28
65

76
defaultConfig {
8-
minSdkVersion 14
9-
targetSdkVersion 25
10-
versionCode 18
11-
versionName "1.0.8"
7+
minSdkVersion 15
8+
targetSdkVersion 28
9+
versionCode 19
10+
versionName "1.0.9"
1211
}
1312
buildTypes {
1413
release {
@@ -21,8 +20,10 @@ android {
2120
}
2221

2322
dependencies {
24-
compile fileTree(dir: 'libs', include: ['*.jar'])
25-
compile 'com.android.support:support-v4:25.3.1'
23+
final support_version = '28.0.0'
24+
25+
implementation fileTree(dir: 'libs', include: ['*.jar'])
26+
implementation "com.android.support:support-v4:$support_version"
2627
}
2728

2829
apply from: './gradle-mvn-push.gradle'

lib/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.cleveroad.slidingtutorial"/>
1+
<manifest package="com.cleveroad.slidingtutorial" />

lib/src/main/java/com/cleveroad/slidingtutorial/FragmentPagerAdapter.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import android.app.FragmentTransaction;
3030
import android.os.Build;
3131
import android.os.Parcelable;
32+
import android.support.annotation.NonNull;
3233
import android.support.v4.view.PagerAdapter;
3334
import android.util.Log;
3435
import android.view.View;
@@ -71,16 +72,17 @@ abstract class FragmentPagerAdapter extends PagerAdapter {
7172
public abstract Fragment getItem(int position);
7273

7374
@Override
74-
public void startUpdate(ViewGroup container) {
75+
public void startUpdate(@NonNull ViewGroup container) {
7576
if (container.getId() == View.NO_ID) {
7677
throw new IllegalStateException("ViewPager with adapter " + this
7778
+ " requires a view id");
7879
}
7980
}
8081

82+
@NonNull
8183
@SuppressLint("CommitTransaction")
8284
@Override
83-
public Object instantiateItem(ViewGroup container, int position) {
85+
public Object instantiateItem(@NonNull ViewGroup container, int position) {
8486
if (mCurTransaction == null) {
8587
mCurTransaction = mFragmentManager.beginTransaction();
8688
}
@@ -115,7 +117,7 @@ private void setUserVisibilityHint(Fragment fragment, boolean isVisible) {
115117

116118
@SuppressLint("CommitTransaction")
117119
@Override
118-
public void destroyItem(ViewGroup container, int position, Object object) {
120+
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
119121
if (mCurTransaction == null) {
120122
mCurTransaction = mFragmentManager.beginTransaction();
121123
}
@@ -125,31 +127,29 @@ public void destroyItem(ViewGroup container, int position, Object object) {
125127
}
126128

127129
@Override
128-
public void setPrimaryItem(ViewGroup container, int position, Object object) {
130+
public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
129131
Fragment fragment = (Fragment) object;
130132
if (fragment != mCurrentPrimaryItem) {
131133
if (mCurrentPrimaryItem != null) {
132134
mCurrentPrimaryItem.setMenuVisibility(false);
133135
setUserVisibilityHint(mCurrentPrimaryItem, false);
134136
}
135-
if (fragment != null) {
136-
fragment.setMenuVisibility(true);
137-
setUserVisibilityHint(fragment, true);
138-
}
137+
fragment.setMenuVisibility(true);
138+
setUserVisibilityHint(fragment, true);
139139
mCurrentPrimaryItem = fragment;
140140
}
141141
}
142142

143143
@Override
144-
public void finishUpdate(ViewGroup container) {
144+
public void finishUpdate(@NonNull ViewGroup container) {
145145
if (mCurTransaction != null) {
146146
mCurTransaction.commitAllowingStateLoss();
147147
mCurTransaction = null;
148148
}
149149
}
150150

151151
@Override
152-
public boolean isViewFromObject(View view, Object object) {
152+
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
153153
return ((Fragment) object).getView() == view;
154154
}
155155

lib/src/main/java/com/cleveroad/slidingtutorial/OnTutorialPageChangeListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,4 @@ public interface OnTutorialPageChangeListener {
3535
* @param position Position index of the new selected page.
3636
*/
3737
void onPageChanged(int position);
38-
3938
}

0 commit comments

Comments
 (0)