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

Commit

Permalink
Merge pull request #300 from florent37/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
florent37 authored Feb 28, 2017
2 parents 85a1248 + 2f43f95 commit 4ebc9f4
Show file tree
Hide file tree
Showing 42 changed files with 269 additions and 1,241 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

10 changes: 1 addition & 9 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion MaterialViewPager.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
66 changes: 15 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MaterialViewPager

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MaterialViewPager-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1731)
[![Android Weekly](https://img.shields.io/badge/android--weekly-151-blue.svg)](http://androidweekly.net/issues/issue-151)
[![CircleCI](https://circleci.com/gh/florent37/MaterialViewPager.svg?style=svg)](https://circleci.com/gh/florent37/MaterialViewPager)

Material Design ViewPager easy to use library

Expand All @@ -18,15 +19,16 @@ You can find a sample APK : [Link](https://github.com/florent37/MaterialViewPage

And have a look on a sample Youtube Video : [Youtube Link](http://www.youtube.com/watch?v=r95Tt6AS18c)

[![Video](http://i.giphy.com/xTiTnmEsdqa7IZaMXS.gif)](http://www.youtube.com/watch?v=r95Tt6AS18c)

#Download

In your module [![Download](https://api.bintray.com/packages/florent37/maven/MaterialViewPager/images/download.svg)](https://bintray.com/florent37/maven/MaterialViewPager/_latestVersion)
```groovy
compile ('com.github.florent37:materialviewpager:1.2.0@aar'){
transitive = true
}
compile 'com.github.florent37:materialviewpager:1.2.1'
//dependencies
compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
```

#Usage
Expand Down Expand Up @@ -344,7 +346,7 @@ Create your own layout using a PagerSlidingTabStrip
**Don't forget to give it id="@id/materialviewpager_pagerTitleStrip"**

```xml
<com.github.florent37.materialviewpager.MaterialViewPager`
<com.github.florent37.materialviewpager.MaterialViewPager
...
app:viewpager_pagerTitleStrip="@layout/my_tabs"
...
Expand Down Expand Up @@ -423,61 +425,25 @@ viewPage.setAdapter(...);
mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
```

#Register your Scrollable

First thing, your fragment view and your scrollable must be **transparent**, so **do not use android:backgound="..."**
Sample :

```xml
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
```


##RecyclerView

### LinearLayoutManager / GridLayoutManager
#RecyclerView

```java
mRecyclerView.setDecorator(new MaterialViewPagerHeaderDecorator());
mRecyclerView.setAdapter(yourAdapter);
```

### StaggedLayoutManager

From your fragment
```java
mRecyclerView.setAdapter(new RecyclerViewMaterialAdapter(yourAdapter));
MaterialViewPagerHelper.registerRecyclerView(getActivity(), mRecyclerView);
```

##ScrollView
#ScrollView

The ScrollView must be an [ObservableScrollView][android-observablescrollview]
The ScrollView must be an NestedScrollView`
```java
MaterialViewPagerHelper.registerScrollView(getActivity(), mScrollView, null);
```

###CallBacks
If you already use ObservableScrollViewCallbacks (maybe for load more, or anything else)
And include @layout/material_view_pager_placeholder` as first child

```java
MaterialViewPagerHelper.registerScrollView(getActivity(), mScrollView, myObservableScrollViewCallbacks);
```

So myObservableScrollViewCallbacks will be still notified

###Layout

And must include @layout/material_view_pager_placeholder as first child
```xml
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
Expand All @@ -492,7 +458,7 @@ And must include @layout/material_view_pager_placeholder as first child
...your content...

</LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
</android.support.v4.widget.NestedScrollView>
```

#CHANGELOG
Expand Down Expand Up @@ -581,7 +547,6 @@ Tell me if you're using my library in your application, I'll share it in this RE
* [Glide][glide] (from Bumptech)
* [KenBurnsView][kenburnsview] (from flavioarfaria)
* [Material PagerSlidingTabStrip][pagerslidingtitlestrip] (from jpardogo, forked from astuetz)
* [Android-Observablescrollview][android-observablescrollview] (from ksoichiro)

#Credits

Expand Down Expand Up @@ -621,5 +586,4 @@ License

[glide]: https://github.com/bumptech/glide
[kenburnsview]: https://github.com/flavioarfaria/KenBurnsView
[pagerslidingtitlestrip]: https://github.com/jpardogo/PagerSlidingTabStrip
[android-observablescrollview]: https://github.com/ksoichiro/Android-ObservableScrollView
[pagerslidingtitlestrip]: https://github.com/jpardogo/PagerSlidingTabStrip
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ buildscript {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:+'
classpath 'io.fabric.tools:gradle:1.+'
Expand All @@ -20,11 +20,11 @@ buildscript {
}

ext {
minSdk = 10
sdk = 23
buildTools = "23.0.3"
supportVersion = "23.3.0"
libraryVersion = '1.2.0'
minSdk = 14
sdk = 24
buildTools = "24.0.2"
supportVersion = "24.0.0"
libraryVersion = '1.2.1'
}

allprojects {
Expand Down
5 changes: 5 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
deployment:
release:
tag: /v.*/
commands:
- ./gradlew :materialviewpager:bintrayUpload
24 changes: 18 additions & 6 deletions gradle/bintray-android-v1.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,30 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives javadocJar
//archives javadocJar
archives sourcesJar
}

def _user = System.getenv("BINTRAY_USER")
def _key = System.getenv("BINTRAY_API_KEY")
def _passphrase = System.getenv("BINTRAY_PASSPHRASE")

if(project.rootProject.file('local.properties').exists() && (_user == null || _user.isEmpty())){
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

_user = properties.getProperty("bintray.user")
_key = properties.getProperty("bintray.apikey");
_passphrase = properties.getProperty("bintray.gpg.password")
}

// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
user = _user
key = _key

configurations = ['archives']
pkg {
Expand All @@ -44,7 +56,7 @@ bintray {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
passphrase = _passphrase
//Optional. The passphrase for GPG signing'
}
}
Expand Down
49 changes: 0 additions & 49 deletions gradle/bintray-java-v1.gradle

This file was deleted.

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 @@
#Wed Apr 10 15:27:10 PDT 2013
#Mon Feb 27 17:10:37 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
12 changes: 3 additions & 9 deletions materialviewpager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ dependencies {

compile (
'com.android.support:appcompat-v7:'+project.supportVersion,
'com.android.support:support-v4:'+project.supportVersion,
'com.android.support:recyclerview-v7:'+project.supportVersion,
'com.android.support:cardview-v7:'+project.supportVersion,
'com.android.support:support-annotations:'+project.supportVersion
)

compile 'com.nineoldandroids:library:2.4.0'

compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
}

Expand Down Expand Up @@ -63,7 +58,6 @@ ext {
allLicenses = ["Apache-2.0"]
}

if (project.rootProject.file('local.properties').exists()) {
apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
}

apply from: rootProject.file('gradle/install-v1.gradle')
apply from: rootProject.file('gradle/bintray-android-v1.gradle')
Loading

0 comments on commit 4ebc9f4

Please sign in to comment.