Giter Site home page Giter Site logo

scrollable's Introduction

logo

Maven Central


Scrollable is a library for an Android application to implement various scrolling technicks. It's all started with scrolling tabs, but now much more can be done with it. Scrollable supports all scrolling and non-scrolling views, including: RecyclerView, ScrollView, ListView, WebView, etc and any combination of those inside a ViewPager. Library is designed to let developer implement desired effect without imposing one solution. Library is small and has no dependencies.

Preview

All GIFs here are taken from sample application module.

colorful_sample custom_overscroll_sample dialog_sample

*Serving suggestion

Installation

compile 'ru.noties:scrollable:1.3.0'

Usage

To start using this library ScrollableLayout must be aded to your layout.

<?xml version="1.0" encoding="utf-8"?>
<ru.noties.scrollable.ScrollableLayout
    android:id="@+id/scrollable_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:scrollable_autoMaxScroll="true"
    app:scrollable_defaultCloseUp="true">

    <ru.noties.scrollable.sample.SampleHeaderView
        style="@style/HeaderStyle"
        app:shv_title="@string/sample_title_fragment_pager"/>

    <ru.noties.scrollable.sample.TabsLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="@dimen/tabs_height"
        android:background="@color/md_teal_500"/>

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/tabs_height"/>

</ru.noties.scrollable.ScrollableLayout>

Please note, that ScrollableLayout positions its children like vertical LinearLayout, but measures them like a FrameLayout. It is crucial that scrolling content holder dimentions must be set to match_parent (minus possible sticky view that should be extracted from it, for example, by specifying android:layoutMarginTop="height_of_sticky_view").

Next, ScrollableLayout must be initialized in code:

final ScrollableLayout scrollableLayout = findView(R.id.scrollable_layout);

// this listener is absolute minimum that is required for `ScrollableLayout` to function
scrollableLayout.setCanScrollVerticallyDelegate(new CanScrollVerticallyDelegate() {
    @Override
    public boolean canScrollVertically(int direction) {
        // Obtain a View that is a scroll container (RecyclerView, ListView, ScrollView, WebView, etc)
        // and call its `canScrollVertically(int) method.
        // Please note, that if `ViewPager is used, currently displayed View must be obtained
        // because `ViewPager` doesn't delegate `canScrollVertically` method calls to it's children
        final View view = getCurrentView();
        return view.canScrollVertically(direction);
    }
});

Draggable View

This is a View, that can be dragged to change ScrollableLayout scroll state. For example, to expand header if tabs are dragged. To add this simply call:

// Please note that `tabsLayout` must be a child (direct or indirect) of a ScrollableLayout
scrollableLayout.setDraggableView(tabsLayout);

OnScrollChangedListener

In order to apply custom logic for different scroll state of a ScrollableLayout OnScrollChangedListener can be used (to change color of a header, create parallax effect, sticky tabs, etc)

scrollableLayout.addOnScrollChangedListener(new OnScrollChangedListener() {
    @Override
    public void onScrollChanged(int y, int oldY, int maxY) {

        // `ratio` of current scroll state (from 0.0 to 1.0)
        // 0.0 - means fully expanded
        // 1.0 - means fully collapsed
        final float ratio = (float) y / maxY;

        // for example, we can hide header, if we are collapsed
        // and show it when we are expanded (plus intermediate state)
        header.setAlpha(1.F - ratio);

        // to create a `sticky` effect for tabs this calculation can be used:
        final float tabsTranslationY;
        if (y < maxY) {
            // natural position
            tabsTranslationY = .0F;
        } else {
            // sticky position
            tabsTranslationY = y - maxY;
        }
        tabsLayout.setTranslationY(tabsTranslationY);
    }
});

OnFlingOverListener

To continue a fling event for a scrolling container OnFlingOverListener can be used.

scrollableLayout.setOnFlingOverListener(new OnFlingOverListener() {
    @Override
    public void onFlingOver(int y, long duration) {
        recyclerView.smoothScrollBy(0, y);
    }
});

OverScrollListener

To create custom overscroll handler (for example, like in SwipeRefreshLayout for loading, or to zoom-in header when cannot scroll further) OverScrollListener can be used

scrollableLayout.setOverScrollListener(new OverScrollListener() {
    @Override
    public void onOverScrolled(ScrollableLayout layout, int overScrollY) {

    }

    @Override
    public boolean hasOverScroll(ScrollableLayout layout, int overScrollY) {
        return false;
    }

    @Override
    public void onCancelled(ScrollableLayout layout) {

    }

    @Override
    public void clear() {

    }
});

OverScrollListener gives you full controll of overscrolling, but it implies a lot of handling. For a simple case OverScrollListenerBase can be used

scrollableLayout.setOverScrollListener(new OverScrollListenerBase() {
    @Override
    protected void onRatioChanged(ScrollableLayout layout, float ratio) {

    }
});

For example, this is onRatioChanged method from ZoomInHeaderOverScrollListener from sample application:

@Override
protected void onRatioChanged(ScrollableLayout layout, float ratio) {
    final float scale = 1.F + (.33F * ratio);
    mHeader.setScaleX(scale);
    mHeader.setScaleY(scale);

    final int headerHeight = mHeader.getHeight();
    mContent.setTranslationY(((headerHeight * scale) - headerHeight) / 2.F);
}

Scrolling Header

There is support for scrolling header. This means that if header can scroll, it will scroll first to the final position and only after that scroll event will be redirected. There are no extra steps to enable this feature if scrolling header is the first view in ScrollableLayout. Otherwise a XML attribute app:scrollable_scrollingHeaderId can be used, it accepts an id of a view.

Various customizations

CloseUpAlgorithm

In order to close-up ScrollableLayout (do not leave in intermediate state, allow only two scrolling states: collapsed & expanded, etc), CloseUpAlgorithm can be used. Its signature is as follows:

public interface CloseUpAlgorithm {

    int getFlingFinalY(ScrollableLayout layout, boolean isScrollingBottom, int nowY, int suggestedY, int maxY);

    int getIdleFinalY(ScrollableLayout layout, int nowY, int maxY);
}

And usage is like this:

scrollableLayout.setCloseUpAlgorithm(new MyCloseUpAlgorithm());

Library provides a DefaultCloseUpAlgorithm for a most common usage (to allow ScrollableLayout only 2 scrolling states: collapsed and expanded). It can be set via java code: scrollableLayout.setCloseUpAlgorithm(new DefaultCloseUpAlgorithm()) and via XML with app:scrollable_defaultCloseUp="true".

Also, there is an option to set duration after which CloseUpAlgorithm should be evaluated (idle state - no touch events). Java: scrollableLayout.setConsiderIdleMillis(100L) and XML: app:scrollable_considerIdleMillis="100". 100L is the default value and may be omitted.

If close-up need to have different animation times, CloseUpIdleAnimationTime can be used. Its signature:

public interface CloseUpIdleAnimationTime {
    long compute(ScrollableLayout layout, int nowY, int endY, int maxY);
}

If animation time is constant (do not depend on current scroll state), SimpleCloseUpIdleAnimationTime can be used. Java: scrollableLayout.setCloseUpIdleAnimationTime(new SimpleCloseUpIdleAnimationTime(200L)), XML: app:app:scrollable_closeUpAnimationMillis="200". 200L is default value and can be omitted.

If one want to get control of ValueAnimator that is used to animate between scroll states, CloseUpAnimatorConfigurator can be used. Its signature:

public interface CloseUpAnimatorConfigurator {
    // when called will already have a duration set
    void configure(ValueAnimator animator);
}

If only Interpolator must be configured, a InterpolatorCloseUpAnimatorConfigurator can be used. Java: scrollableLayout.setCloseAnimatorConfigurator(new InterpolatorCloseUpAnimatorConfigurator(interpolator)), XML: app:scrollable_closeUpAnimatorInterpolator="app:scrollable_closeUpAnimatorInterpolator="@android:interpolator/decelerate_cubic"

Auto Max Scroll

If you layout has a header with dynamic height, or it's height should be obtained at runtime, there is an option to automatically obtain it. Java: scrollableLayout.setAutoMaxScroll(true), XML: app:scrollable_autoMaxScroll="true". With this option there is no need manually set maxScrollY. Please note, that if not specified explicitly this option will be set to true if maxScroll option is not set (equals 0). Also, if at runtime called scrollableLayout.setMaxScroll(int), autoMaxScroll if set to true, will be set to false.

By default the first View will be used to calculate height, but if different one must be used, there is an option to specify id of this view. XML: app:scrollable_autoMaxScrollViewId="@id/header"

Disable Handling

If ScrollableLayout must not evaluate its scrolling logic (skip all touch events), scrollableLayout.setSelfUpdateScroll(boolean) can be used. Pass true to disable all handling, false to enable it.

Animate Scroll

To animate scroll state of a ScrollableLayout, animateScroll(int) can be used:

// returns ValueAnimator, that can be configured as desired
// `0` - expand fully
// `scrollableLayout.getMaxScroll()` - collapse
scrollableLayout.animateScroll(0)
        .setDuration(250L)
        .start();

Please note that ScrollableLayout caches returned ValueAnimator and reuses it. First of all because it doesn't make sense to have two different scrolling animations on one ScrollableLayout. So, it's advisable to clear all possible custom state before running animation (just like View handles ViewPropertyAnimator)

License

  Copyright 2015 Dimitry Ivanov ([email protected])

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

scrollable's People

Contributors

noties avatar varunsngl avatar w4lle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scrollable's Issues

there is Some Bug

if the scrollable_maxScroll larger than the screen height,it's scroll will have some problem.

my email :[email protected]

                                   ------------------------------- I'm so sorry , My Eglish is Not good.

Proguard,can't find referenced method 'float sqrt(float)' in library class android.util.FloatMath

Warning:ru.noties.scrollable.ScrollableScroller: can't find referenced method 'float sqrt(float)' in library class android.util.FloatMath
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Exception while processing task
java.io.IOException: Please correct the above warnings first.Error:Execution failed for task
...
...

':app:packageRelease'.

Unable to compute hash of /Users/captain_miao/am/androidCode/trunk/treadmill/app/build/intermediates/classes-proguard/release/classes.jar

Direction variable not available in setCanScrollVerticallyDelegate

I am using your library to implement a sliding up panel layout which has a scrollable layout at its root and a view pager as a child which will show two fragments

the setCanScrollVerticallyDelegate method on debugging gave me the result that the direction variable doesnt have a value

Can you help me out please

Header height is not preserved after screen rotation

Hi. I noticed that the sample app does not preserve the header view height after screen rotation.

P.S. Thanks for the superb library, this is what I am just looking for! I am willing to contribute this library :)

scroll bug

when you are scrolling beveled, the header and the content will not scroll together

Not able to get all library views

How can i get 'ru.noties.scrollable.sample.SampleHeaderView' ? I have added compile 'ru.noties:scrollable:1.3.0' but not able to get SampleHeaderView .

layout height problem with ViewPager

I use ScrollableLayout in a TabLayout+ViewPager,and ScrollableLayout has a LinearLayout(with Tablayout+ViewPager), if the ScrollableLayout in first page of tab,the height is ok,or else can see ScrollableLayout

when Scrolling the page,the headerview can scroll also

In FragmentPager,when Scrolling the page,the headerview can scroll also,and the page restored to its original position.I dont want the headerview to scroll or the page restored to its original position,how to solve it,Thanks

match_parent is not respected from second child

Hello,

I have a screen like this. I want to hide the header (including Tabs and "Kitapçık A B", excluding ActionBar) while scrolling to bottom.

screen shot 2015-04-04 at 11 34 59

I have implemented it like this.

<?xml version="1.0" encoding="utf-8"?>
<org.buraktamturk.loadingview.LoadingView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tf:lv_loading="false"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tf="http://schemas.android.com/apk/res-auto">
    <ru.noties.scrollable.ScrollableLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/scrollable_layout"
        tf:scrollable_maxScroll="96dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:orientation="vertical"
            android:layout_height="96dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:id="@+id/kitapcikLayout"
            android:background="?attr/colorPrimary"
            android:paddingLeft="11dp"
            android:paddingTop="5dp"

            android:orientation="horizontal">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:textSize="16sp"
                android:textColor="@android:color/white"
                android:text="@string/kitapcik" />

            <com.fem.tekno.utils.KitapciklarView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:layout_gravity="center_vertical"
                android:id="@+id/kitapciklar"
                />

            </LinearLayout>
        <com.astuetz.PagerSlidingTabStrip
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:textColorPrimary="@android:color/white"
            android:layout_height="56dp"
            android:background="?attr/colorPrimary" />
        </LinearLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewPager"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:layout_marginTop="96dp"
            />

    </ru.noties.scrollable.ScrollableLayout>
</org.buraktamturk.loadingview.LoadingView>

The final look when it scrolled down is this.

screen shot 2015-04-04 at 11 35 05

As presented above. There is 96dp (header's height) space between bottom of the device and end of the ViewPager.

Could you help me with removing the space?

Thanks,
Burak

HeaderView Issue

@noties : Header view is going inside the toolbar , i need to make header view below the toolbar with size variation as on scroll up size should get reduce and on scroll down size should get increase.
review_screen

Question

Nice work,but i want to know how to disable the sticky function?I just want to add a header for RecyclerView.

Missing resources

strings.xml is missing min_friction_text
dimension.xml is missing max_friction_steps

So right now it isn't compiling until you add those :)

Closeup Logic

Hi,

Is it possible to implement CloseUpAlgorithm such that the header doesn't expand and hide automatically? What I mean is, when the header is fully expanded, if I move my finger upwards till the header is half of its original height and release my finger, the header doesn't collapse but remains as it is.

I'm very new to development with regards to touch events so I'd be grateful if you could point me in the right direction.

Thanks!

nested two page bug

When nested match_parent FrameLayout and recyclerview match_parent slide down the normal drop-down, recyclerview cannot scroll, and recyclerview is no longer recyclerview

NoClassDefError for ScrollableLayout

Used design support library in my project , while using scrollable layout getting error as

Error:
java.lang.NoClassDefFoundError: ru.noties.scrollable.ScrollableLayout$2
at ru.noties.scrollable.ScrollableLayout.(ScrollableLayout.java:521)

Is there any solution for it?
I have used design support library with version 23.1.1

Thanks

Disable all logs

how to disable all logs
D/InputEventConsistencyVerifier: TouchEvent: ACTION_MOVE contained 1 pointers but there are currently 0 pointers down.
in ru.noties.scrollable.ScrollableLayout@b552f9f0
0: sent at 8776594648936, MotionEvent { action=ACTION_MOVE, id[0]=0, x[0]=128.0, y[0]=97.18901, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776594, downTime=8776490, deviceId=0, source=0x1002 }
-- recent events --
1: sent at 8776594648936, (unhandled) MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=128.0, y[0]=97.18901, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776594, downTime=8776490, deviceId=0, source=0x1002 }
2: sent at 8776577982270, MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=128.0, y[0]=90.14987, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776577, downTime=8776490, deviceId=0, source=0x1002 }
3: sent at 8776561315604, MotionEvent { action=ACTION_MOVE, id[0]=0, x[0]=128.0, y[0]=84.162964, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776561, downTime=8776490, deviceId=0, source=0x1002 }
4: sent at 8776490710000, MotionEvent { action=ACTION_MOVE, id[0]=0, x[0]=128.0, y[0]=82.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=8776490, downTime=8776490, deviceId=0, source=0x1002 }
5: sent at 8776490065000, MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=127.0, y[0]=79.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=8776490, downTime=8776490, deviceId=0, source=0x1002 }

dude

Sorry for the noob question, i have activity with tabs, in have 3 tabs(3 fragments), i the first two i have recycler view, i need to set this {canscroll vertical}, i follow your sample, but this not work...

In fragments that i have recycler view, i implements CanScrollVerticallyDelegate, OnFlingOverListener methods:

override fun canScrollVertically(direction: Int): Boolean {
return recycler_view_relation.canScrollVertically(direction)
}

override fun onFlingOver(y: Int, duration: Long) {
        recycler_view_relation.smoothScrollBy(0, y)
} 

On activity i have: (nts top is my tabs)
scrollable_layout.setDraggableView(nts_top)

is correct?
And how to collpse on click

use ScrollableLayout has a quickreturn

Hello,
thanks for this great lib.
Sometimes i would like to show header before scroll list.
I use this code :

     mScrollableLayout.setCanScrollVerticallyDelegate(new CanScrollVerticallyDelegate() {
            @Override
            public boolean canScrollVertically(int direction) {
                if(direction<0){
                    if(mScrollableLayout.getScrollY()==0){ //header is visible
                        return mListPlayers.canScrollVertically(direction);
                    }else{
                        return false;
                    }
                }
                return mListPlayers.canScrollVertically( direction);
            }
        });

Boolean return value seems to be ok, but i'm not able to scroll the list after scrollbarLayout scrolls to top without touch up and touch down.

What can I change to do that ?
Thanks.

dependencies problem

dependencies does not prompt for errors, it is also synchronized, but you can't find the class dependencies {
compile 'ru.noties:scrollable:1.3.0' } Restart, still not in effect

Scrolling is slow and lagy

I am using a recyclerView and if I scroll and after let it free to scroll itself, the move is very slow with a lot of friction.
ezgif com-gif-maker

Problem with layout

I have

  • Header Image -
  • Taps layout -
  • ViewPager with Fragments -

When I scroll up to Taps layout, height of ViewPager still keep old height, ViewPager not fill to bottom of screen, so I can see other screen under.

Issue scrolling the list/recyclview down

Whenever I scroll down, the header scrolls and becomes visible; but I have to release and scroll down again for the scrolling to continue.

How do I change this behavior such that with one scroll down/drag down the header will show while the list will still continue to scroll down.

Hiding/Showing Header Not Working

Thanks for this API.

I implemented a logic whereby I hide the header when a particular ViewPager tab is selected. I do this inside the onPageSelected, but it doesn't seems to work but it works inside the currently showing ViewPager Tab Fragment onResume.

Please how do I resolve this so that it works in the viewpager onPageSelected function.

Problem scrolling Up

Hi!
I have a viewpager with only one fragment and inside this fragment a recyclerview. When i scroll down there is no problem, but when i want to scroll up until the top, the recyclerview is blocked and instead the ScrollableLayout scroll. I wish that the ScrollableLayout would scroll only after the recyclerview reached the top.

Scroll in header area.

Hi Dimitry,
sorry to disturb you again.
in my layout,i got a complex header view longer than the screen height,which has ImageView,ViewPager etc.all of the cell views in header are clickable.
it seems a little lag during scroll,unless the TabsLayout is sticky.
you can add a couple of TextViews in a vertical linearlayout header,and every TextView has a click listener.

How to add Toolbar in xml ?

if my app use theme

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">

how to make sticky toolbar in xml ?

View Pager not taking the complete height even on using "match parent"

Hi Dimitry,

Whenever I scroll up the scrollablelayout, there is a certain blank space left behind which I suppose belongs to the activity holding the view pager, can you please tell me what is wrong with my code.

My Activity Layout :

<include
    android:id="@+id/action_bar_points"
    layout="@layout/custom_action_bar_toolbar" />

<ru.noties.scrollable.ScrollableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollable_layout"
app:scrollable_autoMaxScroll="true"
app:scrollable_autoMaxScrollViewId="@+id/header"
app:scrollable_considerIdleMillis="125"
app:scrollable_friction="0.050"
app:scrollable_closeUpAnimationMillis="250"
app:scrollable_defaultCloseUp="true"
app:scrollable_scrollerFlywheel="false"
app:scrollable_closeUpAnimatorInterpolator="@android:anim/accelerate_decelerate_interpolator">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/points_parent"
    android:orientation="vertical"
    android:background="@color/app_bg">

<LinearLayout
    android:layout_width="fill_parent"
    android:orientation="vertical"
    android:id="@+id/header"
    android:layout_height="wrap_content">

        <RelativeLayout
            android:layout_width="140dp"
            android:layout_height="140dp"
            android:background="@drawable/circle_my_points_bg"
            android:layout_marginTop="@dimen/margin15dp"
            android:layout_marginBottom="@dimen/margin15dp"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center"
            android:id="@+id/circular_relative_view">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/star_icon"
                android:text=""
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/margin10dp"
                android:padding="@dimen/margin5dp"
                android:textSize="16sp"
                android:textColor="@color/orange_text"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/level_text_points"
                android:layout_below="@id/star_icon"
                android:layout_centerHorizontal="true"
                android:text=""
                android:layout_marginTop="@dimen/margin5dp"
                fontPath="fonts/Gotham-XLight.otf"
                android:textSize="16sp"
                android:textColor="@color/orange_text"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/level_points"
                android:layout_below="@id/level_text_points"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/margin10dp"
                android:text="9400"
                fontPath="fonts/Gotham-XLight.otf"
                android:textSize="20sp"
                android:textColor="@color/black"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/reward_points_text"
                android:layout_below="@id/level_points"
                android:layout_centerHorizontal="true"
                android:text=""
                android:padding="4dp"
                fontPath="fonts/Gotham-XLight.otf"
                android:textSize="12sp"
                android:textColor="@color/black"/>

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:id="@+id/points_indicator"
            android:layout_below="@id/circular_relative_view"
            android:layout_marginTop="@dimen/margin20dp"
            android:padding="@dimen/margin5dp"
            android:visibility="gone">
        </RelativeLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/light_gray"
            android:layout_marginTop="@dimen/margin15dp"
            android:layout_marginLeft="@dimen/margin10dp"
            android:layout_marginRight="@dimen/margin10dp"
            android:layout_below="@id/points_indicator"/>

    </LinearLayout>

             <android.support.design.widget.TabLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/points_tablayout"
                app:tabMode="fixed"
                app:tabGravity="fill"
                app:tabIndicatorColor="@color/app_bg"
                app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
                app:tabSelectedTextColor="@color/orange_text"
                app:tabTextColor="@color/black"/>

            <android.support.v4.view.ViewPager
                android:id="@+id/points_viewpager"
                android:layout_width="match_parent"
                android:layout_height="fill_parent"
                android:background="@color/app_bg"
                android:layout_below="@id/points_tablayout"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"
               />

    </LinearLayout>
</ru.noties.scrollable.ScrollableLayout>

Viewpager fragment 1:

?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/redeem_recyclerview"
android:background="@color/app_bg"
android:clipToPadding="false"
android:numColumns="auto_fit"
android:padding="@dimen/item_offset"/>

Issue while fast scrolling vertically

First thanks alot for that wonderful efforts
.My issue is when I fast scrolling vertically its scrolling not smooth as compared to scroll slowly vertically.
Please suggest something.

No such property: GROUP for class

Error:FAILURE: Build failed with an exception.

  • Where:
    Script 'https://raw.githubusercontent.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' line: 48

  • What went wrong:
    A problem occurred configuring project ':app'.

    A problem occurred configuring project ':library'.
    No such property: GROUP for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Not Support Toolbar

use toolbar will stay two toolbar height ,one is toolbar ,another is white background whitout noting.like this
qq20150603-1

because the ScrollLayout method onLayout , child onLayout with childTop use the given top.
if use given top = 0 , the issue will be solved. should you fix it ? thx
code :
@OverRide
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
int childTop = top;
// should use
//childTop = 0;
for (int i = 0; i < getChildCount(); i++) {
final View view = getChildAt(i);
view.layout(left, childTop, right, childTop + view.getMeasuredHeight());
childTop += view.getMeasuredHeight();
}
}

ScrollHeader is not smoothly

When I want top a page, I use scrollTo(0, 0), it back to top without animator. Could you help me it smoothly? Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.