{"id":13516323,"url":"https://github.com/Yalantis/JellyToolbar","last_synced_at":"2025-03-31T06:30:34.503Z","repository":{"id":45377896,"uuid":"86439306","full_name":"Yalantis/JellyToolbar","owner":"Yalantis","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-22T10:02:12.000Z","size":598,"stargazers_count":1492,"open_issues_count":12,"forks_count":181,"subscribers_count":51,"default_branch":"develop","last_synced_at":"2024-11-01T20:36:21.720Z","etag":null,"topics":["android","animation","kotlin","toolbar"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/Yalantis.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":"2017-03-28T09:13:34.000Z","updated_at":"2024-11-01T18:18:13.000Z","dependencies_parsed_at":"2023-01-18T23:15:09.979Z","dependency_job_id":null,"html_url":"https://github.com/Yalantis/JellyToolbar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yalantis%2FJellyToolbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yalantis%2FJellyToolbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yalantis%2FJellyToolbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yalantis%2FJellyToolbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yalantis","download_url":"https://codeload.github.com/Yalantis/JellyToolbar/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429459,"owners_count":20775805,"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":["android","animation","kotlin","toolbar"],"created_at":"2024-08-01T05:01:21.346Z","updated_at":"2025-03-31T06:30:33.506Z","avatar_url":"https://github.com/Yalantis.png","language":"Kotlin","funding_links":[],"categories":["开源库"],"sub_categories":["UI"],"readme":"# JellyToolbar\n\n[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)]()\n[![](https://jitpack.io/v/yalantis/jellytoolbar.svg)](https://jitpack.io/#yalantis/jellytoolbar)\n[![Yalantis](https://raw.githubusercontent.com/Yalantis/PullToRefresh/develop/PullToRefreshDemo/Resources/badge_dark.png)](https://yalantis.com/?utm_source=github)\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.yalantis.jellyanimation.demo\"\u003e\u003cimg alt=\"Android app on Google Play\" src=\"https://developer.android.com/images/brand/en_app_rgb_wo_60.png\" /\u003e\u003c/a\u003e\n\nCheck this [project on dribbble](https://dribbble.com/shots/2092541-Search-Bar-Animation)\n\n\u003cimg src=\"gif.gif\"/\u003e\n\n## Requirements\n- Android SDK 16+\n\n## Usage\n\nAdd to your root build.gradle:\n```Groovy\nallprojects {\n\trepositories {\n\t  ...\n\t  maven { url \"https://jitpack.io\" }\n\t}\n}\n```\n\nAdd the dependency:\n```Groovy\ndependencies {\n  compile 'com.github.yalantis:jellytoolbar:v1.0'\n}\n```\n\n## How to use this library in your project?\n\nFirst of all, add `JellyToolbar` to the xml layout of your activity, so it looks like that:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\u003e\n\n    \u003ccom.yalantis.jellytoolbar.widget.JellyToolbar\n        android:id=\"@+id/toolbar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@color/colorPrimary\"\n        android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n        android:paddingStart=\"@dimen/activity_horizontal_margin\"\n        app:cancelIcon=\"@drawable/ic_close\"\n        app:endColor=\"@color/colorEnd\"\n        app:icon=\"@drawable/ic_search\"\n        app:startColor=\"@color/colorStart\"\n        app:title=\"@string/str_news_feed\"\n        app:titleTextColor=\"@android:color/white\" /\u003e\n\n\u003c/LinearLayout\u003e\n```\n\n\nAfter that pass an instance of the `JellyListener` and content view \n(the view which would be inserted to the toolbar) to the `JellyToolbar`. \n`JellyToolbar` has `getToolbar()` method to let you use all the methods of the standard `Toolbar`. \n\n\n```Java\npublic class MainActivity extends AppCompatActivity {\n\n    private JellyToolbar toolbar;\n    private AppCompatEditText editText;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        toolbar = (JellyToolbar) findViewById(R.id.toolbar);\n        toolbar.getToolbar().setNavigationIcon(R.drawable.ic_menu);\n        toolbar.setJellyListener(jellyListener);\n\n        editText = (AppCompatEditText) LayoutInflater.from(this).inflate(R.layout.edit_text, null);\n        editText.setBackgroundResource(R.color.colorTransparent);\n        toolbar.setContentView(editText);\n    }\n\n    private JellyListener jellyListener = new JellyListener() {\n        @Override\n        public void onCancelIconClicked() {\n            if (TextUtils.isEmpty(editText.getText())) {\n                toolbar.collapse();\n            } else {\n                editText.getText().clear();\n            }\n        }\n    };\n\n}\n```\n\nTo control the animation flow use `collapse()` and `expand()` methods.\n\nOverride `onToolbarExpandingStarted()`, `onToolbarCollapsingStarted()`, `onToolbarExpanded()` and `onToolbarCollapsed()`\nmethods of the `JellyListener` to get all the animation events.\n\n## Let us know!\n\nWe’d be really happy if you sent us links to your projects where you use our component. Just send an email to github@yalantis.com And do let us know if you have any questions or suggestion regarding the animation. \n\nP.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!\n\n## License\n\n\tThe MIT License (MIT)\n\n\tCopyright © 2017 Yalantis, https://yalantis.com\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYalantis%2FJellyToolbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYalantis%2FJellyToolbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYalantis%2FJellyToolbar/lists"}