Android library for material scrolling techniques.

Overview

material-scrolling

License Android Arsenal Download

Android library for material scrolling techniques.

ViewPager ImageFab

ViewPagerLand

Features

Usage

(For a working implementation of this project see the sample.)

MaterialScrollingLayout

Layout ObservableRecyclerView inside of MaterialScrollingLayout.

<jp.satorufujiwara.scrolling.MaterialScrollingLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/materialScrollingLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:ms_flexible_height="240dp"
        >

    <com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

</jp.satorufujiwara.scrolling.MaterialScrollingLayout>

ms_flexible_heightis height from RecyclerViews top to RecyclerView's first item.

And call MaterialScrollingLayout.addBehavior(View, Behavior) in Activity or Fragment.

First argument is target View. Second argument is View's behavior while scrolling.

materialScrollingLayout.addBehavior(bgImageView, new ParallaxBehavior());
materialScrollingLayout.addBehavior(titleTextView, new ScrollingBehavior());
materialScrollingLayout.addBehavior(fabView, new FabBehavior(getResources()));

FabBehavior is customized Behavior. If you want customize behavior, create class that extends 'Behavior'.

public class TitleBehavior extends Behavior {
    
    private final int scrollLimitHeight;

    public TitleBehavior(Resources r) {
        scrollLimitHeight = r.getDimensionPixelOffset(R.dimen.title_scroll_height);
    }

    @Override
    protected void onScrolled(View target, int scrollY, int dy) {
        ViewCompat.setTranslationY(target, -Math.min(scrollY, scrollLimitHeight));
    }
}

MaterialViewPager

If you want to use with ViewPager, use MaterialViewPager.

And PagerAdapter must imptelement MaterialScrollingViewPager.ContainRecyclerViewPagerAdapter.

<jp.satorufujiwara.scrolling.MaterialScrollingViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:ms_flexible_height="240dp"
        app:ms_base_height="48dp"
        />

And call MaterialScrollingViewPager.addBehavior(View, Behavior) in Activity or Fragment.

Gradle

repositories {
    jcenter()
}
dependencies {
    compile 'jp.satorufujiwara:material-scrolling:1.2.1'
    compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'
}

Developed By

Satoru Fujiwara (satorufujiwara)

Other Projects

  • recyclerview-binder
  • Android Library for RecyclerView to manage order of items and multiple view types.
  • lighthttp
  • Lightweitht HTTP client for Android

Dependencies

License

Copyright 2015 Satoru Fujiwara

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.
Comments
  • mini SDK >16 ?

    mini SDK >16 ?

    nice work ~ :dango:

    but when i add compile 'jp.satorufujiwara:material-scrolling:1.0.0' gradle task tell my mini SDK(14) smaller than this libray(16)

    opened by asker517 3
  • Change color of tab_layout ?

    Change color of tab_layout ?

    @satorufujiwara @cafedeaqua

    Hi this is a perfect library and looks wonderful, i appreciate your effort ! i m beginner and m learning to code ! Please help me out with few things ..

    how can we change color of tab layout in viewpager layout? Keeping transparent when not scrolled and changing the color when scrolled up ?

    Also if we want to keep the toolbar sticky , how could we do it ?

    opened by vj-1023 1
  • Add final identifier for method parameters to avoid mistake intention…

    Add final identifier for method parameters to avoid mistake intention…

    Thank you for this good useful library.

    I'd like to add a little bit code to improve source quality. Could you please review this PR?

    Thank you for best regards, cafedeaqua

    opened by cafedeaqua 1
  • Question

    Question

    Hello!

    Your Code is working well on me, i just want to ask is there any chance to change the background image while i'm changing the view pager. so each page has a different background image.

    Thanks!

    opened by ghost 0
  • Make Toolbar Sticky in viewpager layout ?

    Make Toolbar Sticky in viewpager layout ?

    How could we make the toolbar sticky in viewpager layout ? On scrolling the recyclerview the toolbar moves out of the screen and the tabs only remain sticky. I would like to keep the tabs as well as the toolbar sticky ! how can that be done ?

    Please acknowledge this ! @satorufujiwara @cafedeaqua

    opened by vj-1023 0
  • Element in the parallax header layout can't receive onClick events

    Element in the parallax header layout can't receive onClick events

    My parallax header is a FrameLayout containing various clickable elements, right now I'm unable to receive any onClick events. Is it the normal behaviour of the header?

    opened by abs-paradigm 0
  • NullPointerException when using GridLayoutManager

    NullPointerException when using GridLayoutManager

    Library works like a charm when I use LinearLayoutManager, but what I would like to do is use a grid. I get nullPointerException when I use GridLayoutManager java.lang.NullPointerException at jp.satorufujiwara.scrolling.RecyclerViewHolder.scrollTo(RecyclerViewHolder.java:50)

    Is this currently a bug or this library will not support grid ?

    opened by CanGokdere 1
Owner
Satoru Fujiwara
Developer Relations of @LINE
Satoru Fujiwara
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.

TextFieldBoxes A new Material Design text field that comes in a box, based on Google Material Design guidelines. ???? 中文看这里 UPDATE NOTICE 1.4.5 Releas

Mark Wang 769 Jan 7, 2023
Cute library to implement SearchView in a Material Design Approach

MaterialSearchView Cute library to implement SearchView in a Material Design Approach. Works from Android API 14 (ICS) and above. #Native version Mayb

Miguel Catalan Bañuls 3.8k Jan 3, 2023
💠Metaphor is the library to easily add Material Motion animations

Metaphor Metaphor is the library to easily add Material Motion animations. Who's using Metaphor? ?? Check out who's using Metaphor Include in your pro

Ranbir Singh 132 Dec 25, 2022
Implementation of Ripple effect from Material Design for Android API 9+

RippleEffect ExpandableLayout provides an easy way to create a view called header with an expandable view. Both view are external layout to allow a ma

Robin Chutaux 4.9k Dec 30, 2022
Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animations painless.

AnimatableCompose Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animation painless. What you can create from M

Emir Demirli 12 Jan 2, 2023
Material image loading implementation

MaterialImageLoading Material image loading implementation Sample And have a look on a sample Youtube Video : Youtube Link [] (https://www.youtube.com

Florent CHAMPIGNY 392 Nov 17, 2022
Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

StrikedImageView Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines. Gradle allprojects { repositories

null 9 Sep 21, 2022
Sophisticated and cool intro with Material Motion Animation

☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer)

Ranbir Singh 34 Sep 8, 2022
☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer or Memory leak)

Material Intro Sophisticated and cool intro with Material Motion Animations. Who's using Material Intro? ?? Check out who's using Material Intro Inclu

Ranbir Singh 34 Sep 8, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API

What is Postman? Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API Usage P

Cafer Mert Ceyhan 129 Dec 24, 2022
Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.

1. Add dependency dependencies { implementation 'com.hbb20:android-country-picker:X.Y.Z' } For latest version, 2. Decide your use-case

Harsh B. Bhakta 65 Dec 6, 2022
Android library for swipable gestures

Swipper Android Library for custom views to control brightness , volume and seek through swipable gestures . These views could easily replace the conv

Mobile Development Group 105 Dec 30, 2022
Android Library that lights items for tutorials or walk-throughs etc...

Spotlight Gradle dependencies { implementation 'com.github.takusemba:spotlight:x.x.x' } Usage val spotlight = Spotlight.Builder(this) .setTarg

TakuSemba 3.4k Jan 4, 2023
[] An Android library which allows developers to easily add animations to ListView items

DEPRECATED ListViewAnimations is deprecated in favor of new RecyclerView solutions. No new development will be taking place, but the existing versions

Niek Haarman 5.6k Dec 30, 2022
Android Rubber Picker Library

RubberPicker RubberPicker library contains the RubberSeekBar and RubberRangePicker, inspired by Cuberto's rubber-range-picker. Getting started Setting

Chrisvin Jem 547 Jan 5, 2023
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.

EtsyBlur EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the past Etsy app. Try out the sa

Manabu S. 755 Dec 29, 2022
[] Android library for using the Honeycomb animation API on all versions of the platform back to 1.0!

DEPRECATED NineOldAndroids is deprecated. No new development will be taking place. Existing versions will (of course) continue to function. New applic

Jake Wharton 4.5k Jan 9, 2023
Android library. Flexible components for chat UI implementation with flexible possibilities for styling, customizing and data management. Made by Stfalcon

ChatKit for Android ChatKit is a library designed to simplify the development of UI for such a trivial task as chat. It has flexible possibilities for

Stfalcon LLC 3.6k Jan 5, 2023