Skip to content

Commit

Permalink
+ added getters for views
Browse files Browse the repository at this point in the history
* updated gradle and dependencies versions

- removed application tag to prevent manifest merging errors
  • Loading branch information
Iojjj committed Apr 22, 2016
1 parent e9b667c commit 7745cb8
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 15 deletions.
60 changes: 59 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
### Android template
# Built application files
*.apk
*.ap_
Expand All @@ -11,11 +12,11 @@
# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/
/*/build/

# Local configuration file (sdk path, etc)
local.properties
Expand All @@ -25,3 +26,60 @@ proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml

# Keystore files
*.jks
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.android.tools.build:gradle:2.1.0-beta3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
@@ -1,5 +1,5 @@
VERSION_NAME=0.9.4
VERSION_CODE=5
VERSION_NAME=0.9.5
VERSION_CODE=7
GROUP=com.cleveroad

POM_DESCRIPTION=Sliding tutorial is simple library that help other developers easy create great tutotial
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Aug 20 16:59:06 EEST 2015
#Fri Apr 22 09:56:58 EEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
6 changes: 3 additions & 3 deletions lib/build.gradle
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
versionCode 7
versionName "0.9.5"
}
buildTypes {
release {
Expand All @@ -23,7 +23,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:appcompat-v7:23.3.0'
}

apply from: './gradle-mvn-push.gradle'
4 changes: 0 additions & 4 deletions lib/src/main/AndroidManifest.xml
@@ -1,9 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cleveroad.slidingtutorial">

<application android:allowBackup="true" android:label="@string/st_app_name"
android:supportsRtl="true">

</application>

</manifest>
Expand Up @@ -26,6 +26,8 @@
import android.animation.ArgbEvaluator;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
Expand All @@ -46,6 +48,7 @@ public abstract class PresentationPagerFragment extends Fragment implements View

private ViewPager viewPager;
private View bSkip;
private View separator;
private CirclePageIndicator indicator;

private ArgbEvaluator argbEvaluator = new ArgbEvaluator();
Expand All @@ -65,6 +68,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
viewPager = (ViewPager) view.findViewById(getViewPagerResId());
indicator = (CirclePageIndicator) view.findViewById(getIndicatorResId());
bSkip = view.findViewById(getButtonSkipResId());
separator = view.findViewById(getSeparatorResId());
return view;
}

Expand Down Expand Up @@ -94,6 +98,38 @@ public void onClick(View v) {
}
}

/**
* Get line separator view.
* @return line separator view
*/
public View getSeparator() {
return separator;
}

/**
* Get view pager.
* @return view pager
*/
public ViewPager getViewPager() {
return viewPager;
}

/**
* Get skip button.
* @return skip button
*/
public View getSkipButton() {
return bSkip;
}

/**
* Get view pager indicator.
* @return view pager indicator
*/
public CirclePageIndicator getPagerIndicator() {
return indicator;
}

/**
* According to position and positionOffset changing background color. If last position then
* change root view alpha.
Expand Down Expand Up @@ -150,14 +186,21 @@ protected List<? extends PageFragment> getPageFragments() {
return Collections.emptyList();
}

@LayoutRes
protected abstract int getLayoutResId();

@IdRes
protected abstract int getViewPagerResId();

@IdRes
protected abstract int getIndicatorResId();

@IdRes
protected abstract int getButtonSkipResId();

@IdRes
protected abstract int getSeparatorResId();

/**
* Enable or disable infinite scroll. Default value is false.
*
Expand Down
Expand Up @@ -24,4 +24,9 @@ public int getIndicatorResId() {
public int getButtonSkipResId() {
return R.id.tvSkip;
}

@Override
protected int getSeparatorResId() {
return R.id.separator;
}
}
1 change: 1 addition & 0 deletions lib/src/main/res/layout/st_fragment_presentation.xml
Expand Up @@ -18,6 +18,7 @@
android:layout_gravity="bottom|center_horizontal">

<View
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="0.1dp"
android:background="@android:color/white"/>
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Expand Up @@ -25,7 +25,7 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:percent:23.1.1'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:percent:23.3.0'
compile project(':lib')
}

0 comments on commit 7745cb8

Please sign in to comment.