{"id":13637520,"url":"https://github.com/Semper-Viventem/Material-backdrop","last_synced_at":"2025-04-19T08:34:26.793Z","repository":{"id":183531190,"uuid":"141615016","full_name":"Semper-Viventem/Material-backdrop","owner":"Semper-Viventem","description":"A simple solution for implementing Backdrop pattern for Android","archived":false,"fork":false,"pushed_at":"2019-12-20T09:35:48.000Z","size":3483,"stargazers_count":219,"open_issues_count":3,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-02T00:23:39.935Z","etag":null,"topics":["android","android-app","android-design","android-design-pattern","android-library","android-sdk","androidx","backdrop","bintray","design-patterns","foreground","jetpack","kotlin-library","library","material","material-backdrop","material-components","material-design","patterns","ui-components"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Semper-Viventem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-07-19T18:07:39.000Z","updated_at":"2024-06-28T12:06:21.000Z","dependencies_parsed_at":"2023-07-24T20:53:47.549Z","dependency_job_id":null,"html_url":"https://github.com/Semper-Viventem/Material-backdrop","commit_stats":null,"previous_names":["semper-viventem/material-backdrop"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Semper-Viventem%2FMaterial-backdrop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Semper-Viventem%2FMaterial-backdrop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Semper-Viventem%2FMaterial-backdrop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Semper-Viventem%2FMaterial-backdrop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Semper-Viventem","download_url":"https://codeload.github.com/Semper-Viventem/Material-backdrop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223795272,"owners_count":17204137,"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","android-app","android-design","android-design-pattern","android-library","android-sdk","androidx","backdrop","bintray","design-patterns","foreground","jetpack","kotlin-library","library","material","material-backdrop","material-components","material-design","patterns","ui-components"],"created_at":"2024-08-02T00:01:18.790Z","updated_at":"2024-11-09T06:31:24.692Z","avatar_url":"https://github.com/Semper-Viventem.png","language":"Kotlin","funding_links":[],"categories":["Android"],"sub_categories":["Components"],"readme":"# Backdrop\n\n[ ![Download](https://api.bintray.com/packages/semper-viventem/maven/backdrop/images/download.svg) ](https://bintray.com/semper-viventem/maven/backdrop/_latestVersion)[![](https://jitpack.io/v/Semper-Viventem/BackdropView.svg)](https://jitpack.io/#Semper-Viventem/BackdropView)\n\n\n## What is it?\nThis library makes it easy to implement a [Backdrop](https://material.io/design/components/backdrop.html) pattern with a CoordinatorLayout\n\n\n\u003cimg src=\"/docs/images/Screenshot_20180722-000750.png\" width=\"300\"\u003e  \u003cimg src=\"/docs/images/Screenshot_20180722-000754.png\" width=\"300\"\u003e\n\n\n\u003cimg src=\"/docs/images/Screenshot_20180722-000802.png\" width=\"300\"\u003e  \u003cimg src=\"/docs/images/Screenshot_20180722-000806.png\" width=\"300\"\u003e\n\n\n## Download\n**JCenter (Recommended):**\n```groovy\ndependencies {\n    implementation 'ru.semper-viventem.backdrop:backdrop:0.1.7'\n}\n```\n\n**JitPack:**\n```groovy\nrepositories {\n\t...\n\tmaven { url 'https://jitpack.io' }\n}\n\ndependencies {\n    implementation 'com.github.Semper-Viventem:BackdropView:0.1.7'\n}\n```\n\n## How to use it?\nYou need to add front layout and back layout (with toolbar) to CoordinatorLayout.\n\nAdd BackdropBehavior to your front layout:\n\n**XML**\n```xml\n\u003candroid.support.design.widget.CoordinatorLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n    \n    \u003c!-- BackLayout for BackDrop --\u003e\n    \u003ccom.google.android.material.appbar.AppBarLayout\n        android:id=\"@+id/backLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\u003e\n\n        \u003c!-- Must contain a Toolbar --\u003e\n        \u003candroidx.appcompat.widget.Toolbar\n            android:id=\"@+id/toolbar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"/\u003e\n\n        \u003c!-- For example, NavigationView. Or you can use anything --\u003e\n        \u003ccom.google.android.material.navigation.NavigationView\n            android:id=\"@+id/navigationView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            app:menu=\"@menu/main_menu\"/\u003e\n    \u003c/com.google.android.material.appbar.AppBarLayout\u003e\n\n    \u003c!-- Add BackdropBehavior to this view --\u003e\n    \u003candroid.support.design.card.MaterialCardView\n        android:id=\"@+id/foregroundContainer\"\n        app:layout_behavior=\"ru.semper_viventem.backdrop.BackdropBehavior\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\u003e\n        \n        \u003c!-- Anything --\u003e\n    \u003c/android.support.design.card.MaterialCardView\u003e\n\n\u003c/android.support.design.widget.CoordinatorLayout\u003e\n```\n\n\n**Kotlin**\n\n*I used this extension to search for behavior:*\n```kotlin\nfun \u003cT : CoordinatorLayout.Behavior\u003c*\u003e\u003e View.findBehavior(): T = layoutParams.run {\n    if (this !is CoordinatorLayout.LayoutParams) throw IllegalArgumentException(\"View's layout params should be CoordinatorLayout.LayoutParams\")\n\n    (layoutParams as CoordinatorLayout.LayoutParams).behavior as? T\n            ?: throw IllegalArgumentException(\"Layout's behavior is not current behavior\")\n}\n```\n\n```kotlin\n...\n\nval backdropBehavior: BackdropBehavior = foregroundContainer.findBehavior() // find behavior\n\nwith(backdropBehavior) {\n\n        // Attach your back layout to behavior.\n        // BackDropBehavior will find the toolbar itself.\n        attachBackLayout(R.id.backLayout)\n        \n        // Set navigation icons for toolbar\n        setClosedIcon(R.drawable.ic_menu)\n        setOpenedIcon(R.drawable.ic_close)\n        \n        // Add listener\n        addOnDropListener(object : BackdropBehavior.OnDropListener {\n            override fun onDrop(dropState: BackdropBehavior.DropState, fromUser: Boolean) {\n                // TODO: handle listener            \n            }\n        })\n}\n\n...\n```\n\n\n## License\n\n```\n\nMIT License\n\nCopyright (c) 2018 Konstantin Kulikov (kostyaxxx8@gmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSemper-Viventem%2FMaterial-backdrop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSemper-Viventem%2FMaterial-backdrop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSemper-Viventem%2FMaterial-backdrop/lists"}