Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added adapter for NestedScrollView, added implementation and demo for… #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified app/.gitignore
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions app/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ repositories {
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "me.everything.overscrolldemo"
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -24,7 +24,7 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:25+'
compile 'com.android.support:design:25.1.0'
compile project(':liboverscroll')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation project(':liboverscroll')
}
Empty file modified app/proguard-rules.pro
100644 → 100755
Empty file.
Empty file modified app/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions app/src/main/java/me/everything/overscrolldemo/OverScrollDemoActivity.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import me.everything.overscrolldemo.view.RecyclerViewDemoFragment;
import me.everything.overscrolldemo.view.RecyclerViewStaggeredGridDemoFragment;
import me.everything.overscrolldemo.view.ScrollViewDemoFragment;
import me.everything.overscrolldemo.view.SwipeRefreshDemoFragment;
import me.everything.overscrolldemo.view.ViewPagerDemoFragment;

public class OverScrollDemoActivity extends AppCompatActivity
Expand Down Expand Up @@ -89,6 +90,9 @@ public boolean onNavigationItemSelected(MenuItem item) {
case R.id.drawer_item_misc_demo:
replaceMainFragment(new MiscViewsDemoFragment(), R.string.misc_views_demo_title);
break;
case R.id.drawer_item_swipe_refresh_demo:
replaceMainFragment(new SwipeRefreshDemoFragment(), R.string.swipe_refresh_title);
break;
}

DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package me.everything.overscrolldemo.view;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.widget.NestedScrollView;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;

import me.everything.android.ui.overscroll.OverScrollDecoratorHelper;
import me.everything.overscrolldemo.R;

public class SwipeRefreshDemoFragment extends Fragment {

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final SwipeRefreshLayout view = (SwipeRefreshLayout) inflater.inflate(R.layout.fragment_swiperefresh_overscroll_demo, container, false);
NestedScrollView nestedScrollView = view.findViewById(R.id.scrollView);
OverScrollDecoratorHelper.setUpOverScroll(nestedScrollView, true);
return view;
}
}
Empty file.
Empty file modified app/src/main/res/animator/fade_in_slow.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/animator/fade_out_quick.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/color/drawer_items_text.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/drawable-hdpi/app_icon.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-hdpi/ic_view_pager.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-ldpi/app_icon.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-ldpi/ic_view_pager.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-mdpi/app_icon.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-mdpi/ic_view_pager.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-xhdpi/app_icon.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-xhdpi/ic_view_pager.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-xxhdpi/app_icon.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable-xxhdpi/ic_view_pager.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/drawable/drawer_header_bkg.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/drawable/drawer_items_bkg.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/activity_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/activity_overscroll_demo_content.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/drawer_header_overscroll_demo.xml
100644 → 100755
Empty file.
30 changes: 30 additions & 0 deletions app/src/main/res/layout/fragment_swiperefresh_overscroll_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v4.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_gravity="center"
android:background="@color/colorAccent"
android:gravity="center"
android:text="Text" />


</LinearLayout>


</android.support.v4.widget.NestedScrollView>

</android.support.v4.widget.SwipeRefreshLayout>
Empty file modified app/src/main/res/layout/grid_item.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/gridview_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/horizontal_list_item.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/list_item.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/listview_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/misc_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/nested_scrollview_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/recyclerview_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/recyclerview_stgrid_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/scrollview_horizontal_item.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/scrollview_overscroll_demo.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/scrollview_vertical_item.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/vert_recycler.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/vertical_list_item.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/layout/viewpager_overscroll_demo.xml
100644 → 100755
Empty file.
32 changes: 13 additions & 19 deletions app/src/main/res/menu/activity_overscroll_demo_drawer_items.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,49 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<group
android:checkableBehavior="single">
<group android:checkableBehavior="single">

<item
android:id="@+id/drawer_item_recyclerview_demo"
android:icon="@drawable/ic_recycler"
android:title="RecyclerView Demo"
android:checked="true"
/>
android:icon="@drawable/ic_recycler"
android:title="RecyclerView Demo" />
<item
android:id="@+id/drawer_item_recyclerview_staggered_grid_demo"
android:icon="@drawable/ic_recycler"
android:title="RecyclerView - St.Grid Demo"
/>
android:title="RecyclerView - St.Grid Demo" />
<item
android:id="@+id/drawer_item_gridview_demo"
android:icon="@drawable/ic_grid"
android:title="GridView Demo"
/>
android:title="GridView Demo" />
<item
android:id="@+id/drawer_item_listview_demo"
android:icon="@drawable/ic_list"
android:title="ListView Demo"
/>
android:title="ListView Demo" />
<item
android:id="@+id/drawer_item_scrollview_demo"
android:icon="@drawable/ic_scroller"
android:title="ScrollView Demo"
/>
android:title="ScrollView Demo" />
<item
android:id="@+id/drawer_item_viewpager_demo"
android:icon="@drawable/ic_view_pager"
android:title="ViewPager Demo"
/>
android:title="ViewPager Demo" />
<item
android:id="@+id/drawer_item_nested_scrollview_demo"
android:title="NestedScrollView Demo"
/>
android:title="NestedScrollView Demo" />
<item
android:id="@+id/drawer_item_misc_demo"
android:icon="@drawable/ic_misc"
android:title="Misc-Views Demo"
/>
android:title="Misc-Views Demo" />
<item
android:id="@+id/drawer_item_swipe_refresh_demo"
android:title="SwipeRefreshLayout Demo" />

</group>

Expand Down
Empty file modified app/src/main/res/values-v21/styles.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values-w820dp/dimens.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/colors.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/dimens.xml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="nested_scrollview_demo_title">NestedScrollView Over-Scroll Demo</string>
<string name="misc_views_demo_title">Misc. Over-Scroll Demo</string>
<string name="nested_scrollview_text">This text box is scrollable thanks to being situated inside a nested scroll view. That makes it scrollable regardless of the scrolling of the content of the entire screen, which can be scrolled independently.\nThe point here is to demonstrate how the over-scroll effect can work in the presence of nested scroll-views, provided it is applied over the parent (root) view, regardless of having inner nested scroll-views as children.\nIn this demo, the root view is merely a ScrollView, and therefore applying the effect over it is straightforward (i.e. using the OverScrollHelper).</string>

<string name="swipe_refresh_title">SwipeRefreshLayout Over-Scroll Demo</string>
<string name="horiz_drag_label">⇔ Drag Horizontally</string>
<string name="vert_drag_label">⇳ Drag Vertically</string>

Expand Down
Empty file modified app/src/main/res/values/styles.xml
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.1.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
Empty file modified gradle.properties
100644 → 100755
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Sep 20 21:04:37 IDT 2016
#Thu Apr 19 16:13:11 AEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Empty file modified liboverscroll/.gitignore
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions liboverscroll/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -19,11 +19,11 @@ android {
}

dependencies {
compile 'com.android.support:recyclerview-v7:25.1.0'
api 'com.android.support:recyclerview-v7:27.1.1'

testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
testCompile "org.robolectric:robolectric:3.0"
testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:2.8.47"
testImplementation "org.robolectric:robolectric:3.3.2"
}


Expand Down
Empty file modified liboverscroll/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.