Skip to content

Commit 378b478

Browse files
author
Dimitry Ivanov
committed
Added sample gifs
1 parent b2a1cd4 commit 378b478

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

art/scrollable_colorful.gif

1.41 MB
Loading

art/scrollable_custom_overscroll.gif

692 KB
Loading

art/scrollable_dialog.gif

689 KB
Loading

library/build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,11 @@ dependencies {
5454
if (project.hasProperty('release')) {
5555
// check if we removed debug library when releasing
5656
final def dependencies = project.configurations.getByName('compile')?.dependencies
57-
if (dependencies) {
58-
dependencies.forEach({ dependency ->
59-
if ('ru.noties' == dependency.group
60-
&& 'debug' == dependency.name) {
61-
throw new RuntimeException('Remove `debug` library before releasing')
62-
}
63-
})
64-
}
57+
dependencies?.forEach({ dependency ->
58+
if ('ru.noties' == dependency.group
59+
&& 'debug' == dependency.name) {
60+
throw new RuntimeException('Remove `debug` library before releasing')
61+
}
62+
})
6563
apply from: 'https://raw.githubusercontent.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
6664
}

sample.gif

-2.69 MB
Binary file not shown.

sample/src/main/java/ru/noties/scrollable/sample/colorful/ColorfulActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,13 @@ Item getItem(int position) {
309309

310310
private static class ColorfulOverScrollListener extends ZoomInHeaderOverScrollListener {
311311

312+
private final SampleHeaderView mHeader;
312313
private final View mContent;
313314
private final View mTabs;
314315

315-
ColorfulOverScrollListener(View header, View content, View tabs) {
316+
ColorfulOverScrollListener(SampleHeaderView header, View content, View tabs) {
316317
super(header, content);
318+
mHeader = header;
317319
mContent = content;
318320
mTabs = tabs;
319321
}
@@ -322,6 +324,9 @@ private static class ColorfulOverScrollListener extends ZoomInHeaderOverScrollLi
322324
protected void onRatioChanged(ScrollableLayout layout, float ratio) {
323325
super.onRatioChanged(layout, ratio);
324326
mTabs.setTranslationY(mContent.getTranslationY());
327+
// additionally, we will apply a bit of translationY to header text view
328+
// to achieve nice visual effect
329+
mHeader.getTextView().setTranslationY(mContent.getTranslationY() / 2.F);
325330
}
326331
}
327332

sample/src/main/java/ru/noties/scrollable/sample/scrollheader/ScrollHeaderActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void onCreate(Bundle sis) {
4040
headerRecyclerView.setAdapter(adapter);
4141
contentRecyclerView.setAdapter(adapter);
4242

43-
scrollableLayout.setFriction(.04F);
43+
scrollableLayout.setFriction(.035F);
4444
scrollableLayout.setDraggableView(header);
4545

4646
scrollableLayout.setCanScrollVerticallyDelegate(new CanScrollVerticallyDelegate() {

0 commit comments

Comments
 (0)