{"id":13643236,"url":"https://github.com/ToDou/appbarlayout-spring-behavior","last_synced_at":"2025-04-21T01:32:23.410Z","repository":{"id":50342159,"uuid":"70798228","full_name":"ToDou/appbarlayout-spring-behavior","owner":"ToDou","description":"One Behavior help AppBarLayout to scroll spring","archived":false,"fork":false,"pushed_at":"2019-05-31T02:20:11.000Z","size":83811,"stargazers_count":1188,"open_issues_count":27,"forks_count":157,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-12T21:33:39.496Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ToDou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-13T11:06:05.000Z","updated_at":"2024-11-23T14:37:41.000Z","dependencies_parsed_at":"2022-09-08T14:22:52.346Z","dependency_job_id":null,"html_url":"https://github.com/ToDou/appbarlayout-spring-behavior","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToDou%2Fappbarlayout-spring-behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToDou%2Fappbarlayout-spring-behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToDou%2Fappbarlayout-spring-behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToDou%2Fappbarlayout-spring-behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToDou","download_url":"https://codeload.github.com/ToDou/appbarlayout-spring-behavior/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982606,"owners_count":21355732,"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:44.331Z","updated_at":"2025-04-21T01:32:18.402Z","avatar_url":"https://github.com/ToDou.png","language":"Java","readme":"# appbarlayout-spring-behavior\nOne library contains one behavior help appbarlayout to scroll spring. In the sample have add the realtimeblur test and add tablayout with TabScrimHelper(animate color with CollapsingToolbarLayout).Because of some methods in the Behavior of AppBarLayout not open to the out package. So I set the package name same to the support design.\n\n[Download Sample](https://github.com/ToDou/appbarlayout-spring-behavior/releases)\n\nScreenshot\n====\nFirst is with spring. Second with blur and TabScrimHelper.\n\n|H|H|\n|---|---|\n|![](/screenshot/appbar_spring.gif)|![](/screenshot/appbar_spring_blur_tab.gif)|\n\nInstallation\n====\n```groovy\ndependencies {\n    implementation 'com.github.todou:appbarspring:1.0.x'\n}\n```\n\n|des|version|branch|\n|---|---|---|\n|supportpre|1.0.7|master|\n|support28|1.0.9|support28|\n|androidx|1.0.8|androidx|\n\nUsages\n====\n#### AppBarLayout-Spring\n```xml\n\u003candroid.support.design.widget.AppBarLayout\n        ...\n        app:layout_behavior=\"@string/appbar_spring_behavior\"\n        ...\u003e\n        ...\n\u003c/android.support.design.widget.AppBarLayout\u003e\n```\nif you want add blur with the spring.You can add this by the [RealtimeBlurView](https://github.com/mmin18/RealtimeBlurView):\n```java\nfinal RealtimeBlurView realtimeBlurView = (RealtimeBlurView) findViewById(R.id.real_time_blur_view);\nAppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.app_bar);\nAppBarLayoutSpringBehavior springBehavior = (AppBarLayoutSpringBehavior) ((CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams()).getBehavior();\nspringBehavior.setSpringOffsetCallback(new AppBarLayoutSpringBehavior.SpringOffsetCallback() {\n      @Override\n      public void springCallback(int offset) {\n           int radius = 20 * (240 - offset \u003e 0 ? 240 - offset : 0) / 240;\n           realtimeBlurView.setBlurRadius(radius);\n      }\n});\n```\nWith the tablayout you can add **TabScrimHelper** to let TabLayout animate color with the CollapsingToolbarLayout:\n```java\nTabScrimHelper tabScrimHelper = new TabScrimHelper(tabLayout, collapsingToolbarLayout);\nappBarLayout.addOnOffsetChangedListener(tabScrimHelper);\n```\n\nLicense\n====\n\u003cpre\u003e\nCopyright 2016 ToDou\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\u003c/pre\u003e\n","funding_links":[],"categories":["AppBar","Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FToDou%2Fappbarlayout-spring-behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FToDou%2Fappbarlayout-spring-behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FToDou%2Fappbarlayout-spring-behavior/lists"}