{"id":13644219,"url":"https://github.com/satorufujiwara/material-scrolling","last_synced_at":"2025-04-21T07:30:31.997Z","repository":{"id":96805458,"uuid":"42585130","full_name":"satorufujiwara/material-scrolling","owner":"satorufujiwara","description":"Android library for material scrolling techniques.","archived":false,"fork":false,"pushed_at":"2016-06-03T02:35:32.000Z","size":2844,"stargazers_count":597,"open_issues_count":7,"forks_count":106,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-09T16:48:39.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/satorufujiwara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-09-16T12:15:25.000Z","updated_at":"2024-05-22T02:45:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"096fe260-9528-4336-ad9e-2be32c6edd94","html_url":"https://github.com/satorufujiwara/material-scrolling","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satorufujiwara%2Fmaterial-scrolling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satorufujiwara%2Fmaterial-scrolling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satorufujiwara%2Fmaterial-scrolling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satorufujiwara%2Fmaterial-scrolling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satorufujiwara","download_url":"https://codeload.github.com/satorufujiwara/material-scrolling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014533,"owners_count":21360969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:01:59.293Z","updated_at":"2025-04-21T07:30:30.121Z","avatar_url":"https://github.com/satorufujiwara.png","language":"Java","funding_links":[],"categories":["滚动效果(Scroll)","Libs"],"sub_categories":["\u003cA NAME=\"Animations\"\u003e\u003c/A\u003eAnimations"],"readme":"material-scrolling\n===\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-material--scrolling-green.svg?style=flat)](https://android-arsenal.com/details/1/2529)\n[![Download](https://api.bintray.com/packages/satorufujiwara/maven/material-scrolling/images/download.svg)](https://bintray.com/satorufujiwara/maven/material-scrolling/_latestVersion)\n\n\nAndroid library for [material scrolling techniques](http://www.google.com/design/spec/patterns/scrolling-techniques.html).\n\n ![ViewPager](/arts/viewpager.gif)  ![ImageFab](/arts/imagefab.gif)\n \n ![ViewPagerLand](/arts/viewpager_land.gif)\n\n# Features\n* Easily implement [material scrolling techniques](http://www.google.com/design/spec/patterns/scrolling-techniques.html) with RecyclerView.\n* Customize the behavior while scrolling.\n* Support RecyclerView in ViewPager.\n\n# Usage\n\n(For a working implementation of this project see the [sample](./sample).)\n\n## MaterialScrollingLayout\n\nLayout `ObservableRecyclerView` inside of `MaterialScrollingLayout`.\n\n```xml\n\u003cjp.satorufujiwara.scrolling.MaterialScrollingLayout\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/materialScrollingLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:ms_flexible_height=\"240dp\"\n        \u003e\n\n    \u003ccom.github.ksoichiro.android.observablescrollview.ObservableRecyclerView\n            android:id=\"@+id/recyclerView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            /\u003e\n\n\u003c/jp.satorufujiwara.scrolling.MaterialScrollingLayout\u003e\n```\n`ms_flexible_height`is height from `RecyclerView`s top to `RecyclerView`'s first item.\n\nAnd call `MaterialScrollingLayout.addBehavior(View, Behavior)` in Activity or Fragment.\n\nFirst argument is target `View`.\nSecond argument is `View`'s behavior while scrolling.\n\n```java\nmaterialScrollingLayout.addBehavior(bgImageView, new ParallaxBehavior());\nmaterialScrollingLayout.addBehavior(titleTextView, new ScrollingBehavior());\nmaterialScrollingLayout.addBehavior(fabView, new FabBehavior(getResources()));\n```\n\n`FabBehavior` is customized `Behavior`.\nIf you want customize behavior, create class that extends 'Behavior'.\n\n```java\npublic class TitleBehavior extends Behavior {\n    \n    private final int scrollLimitHeight;\n\n    public TitleBehavior(Resources r) {\n        scrollLimitHeight = r.getDimensionPixelOffset(R.dimen.title_scroll_height);\n    }\n\n    @Override\n    protected void onScrolled(View target, int scrollY, int dy) {\n        ViewCompat.setTranslationY(target, -Math.min(scrollY, scrollLimitHeight));\n    }\n}\n```\n\n## MaterialViewPager\n\nIf you want to use with `ViewPager`, use `MaterialViewPager`.\n\nAnd PagerAdapter must imptelement `MaterialScrollingViewPager.ContainRecyclerViewPagerAdapter`.\n\n```xml\n\u003cjp.satorufujiwara.scrolling.MaterialScrollingViewPager\n        android:id=\"@+id/viewpager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:ms_flexible_height=\"240dp\"\n        app:ms_base_height=\"48dp\"\n        /\u003e\n```\n\nAnd call `MaterialScrollingViewPager.addBehavior(View, Behavior)` in Activity or Fragment.\n\n# Gradle\n\n```groovy\nrepositories {\n    jcenter()\n}\ndependencies {\n    compile 'jp.satorufujiwara:material-scrolling:1.2.1'\n    compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'\n}\n```\n\n# Developed By\n\nSatoru Fujiwara (satorufujiwara)\n* Twitter [satorufujiwara](https://twitter.com/satorufujiwara)\n* holly.wist@gmail.com\n \nOther Projects\n* [recyclerview-binder](https://github.com/satorufujiwara/recyclerview-binder)\n * Android Library for RecyclerView to manage order of items and multiple view types. \n* [lighthttp](https://github.com/satorufujiwara/lighthttp)\n * Lightweitht HTTP client for Android \n\n# Dependencies\n\n* Library\n * [Android-ObservableScrollView](https://github.com/ksoichiro/Android-ObservableScrollView)\n\n* Sample\n * [recyclerview-binder](https://github.com/satorufujiwara/recyclerview-binder)\n * [SmartTabLayout](https://github.com/ogaclejapan/SmartTabLayout)\n\n\nLicense\n-------\n    Copyright 2015 Satoru Fujiwara\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatorufujiwara%2Fmaterial-scrolling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatorufujiwara%2Fmaterial-scrolling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatorufujiwara%2Fmaterial-scrolling/lists"}