{"id":13613644,"url":"https://github.com/danimahardhika/cafebar","last_synced_at":"2025-04-13T15:33:48.797Z","repository":{"id":198771984,"uuid":"83803768","full_name":"danimahardhika/cafebar","owner":"danimahardhika","description":"An upgraded Snackbar for Android that provides more options and easy to use","archived":false,"fork":false,"pushed_at":"2017-12-20T11:30:21.000Z","size":5769,"stargazers_count":145,"open_issues_count":5,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-02T20:45:43.358Z","etag":null,"topics":["android","android-library","material-components","material-design","snackbar","ui-components"],"latest_commit_sha":null,"homepage":null,"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/danimahardhika.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}},"created_at":"2017-03-03T14:00:14.000Z","updated_at":"2024-03-19T01:50:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c54ae28-957c-46bb-996f-bda2de9b63f6","html_url":"https://github.com/danimahardhika/cafebar","commit_stats":null,"previous_names":["danimahardhika/cafebar"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danimahardhika%2Fcafebar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danimahardhika%2Fcafebar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danimahardhika%2Fcafebar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danimahardhika%2Fcafebar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danimahardhika","download_url":"https://codeload.github.com/danimahardhika/cafebar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223592697,"owners_count":17170546,"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-library","material-components","material-design","snackbar","ui-components"],"created_at":"2024-08-01T20:00:52.131Z","updated_at":"2024-11-07T21:31:29.212Z","avatar_url":"https://github.com/danimahardhika.png","language":"Java","funding_links":[],"categories":["Android"],"sub_categories":[],"readme":"# CafeBar\n[![](https://jitpack.io/v/danimahardhika/cafebar.svg)](https://jitpack.io/#danimahardhika/cafebar) [![Build Status](https://travis-ci.org/danimahardhika/cafebar.svg?branch=master)](https://travis-ci.org/danimahardhika/cafebar) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/0f4b6a7685d54df59ad87fd3239fd9ed)](https://www.codacy.com/app/danimahardhika/cafebar?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=danimahardhika/cafebar\u0026amp;utm_campaign=Badge_Grade) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) \n\nAn upgraded Snackbar for Android that provides more options and easy to use. Download sample apk from [here](https://github.com/danimahardhika/cafebar/releases/download/1.1.0/app-release.apk).\n\n\u003cimg src=\"https://raw.githubusercontent.com/danimahardhika/cafebar/master/arts/screenshot.jpg\" height=\"456\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/danimahardhika/cafebar/master/arts/demo-0.gif\" height=\"456\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/danimahardhika/cafebar/master/arts/demo-1.gif\" height=\"456\"\u003e\n\n# Gradle Dependency\nThe minimum API level supported by this library is API 14\n\nAdd JitPack repository to root ```build.gradle```\n```Gradle\nallprojects {\n    repositories {\n        maven { url \"https://jitpack.io\" }\n    }\n}\n```\nAdd the dependency\n```Gradle\ndependencies {\n    implementation 'com.github.danimahardhika:cafebar:1.3.1'\n}\n```\n\n# Usage\nOld release [1.0.0](https://github.com/danimahardhika/cafebar/releases/tag/1.0.0) - [1.2.0](https://github.com/danimahardhika/cafebar/releases/tag/1.2.0) take a look [here](https://github.com/danimahardhika/cafebar/wiki/Old-Readme)\n\n#### Show simple CafeBar\n```java\nCafeBar.make(context, R.string.text, CafeBar.Duration.SHORT).show();\n```\n\n#### Show simple CafeBar with action\n```java\nCafeBar.make(context, R.string.text, CafeBar.Duration.SHORT)\n    .setAction(actionText, actionColor, callback)\n    .show();\n```\n\n#### Using builder\n```java\nCafeBar.builder(context)\n    .theme(CafeBarTheme.LIGHT)\n    .duration(CafeBar.Duration.MEDIUM)\n    .content(R.string.text)\n    .neutralText(\"Action\")\n    //You can parse string color\n    .neutralColor(Color.parseColor(\"#EEFF41\"))\n    //Or use color resource\n    .neutralColor(R.color.neutralText)\n    .show();\n```\n\n#### Retrieve CafeBar view\n```java\nCafeBar.Builder builder = new CafeBar.Builder(context);\n...\nCafeBar cafeBar = builder.build();\n\nView v = cafeBar.getView();\n//Do something\ncafeBar.show();\n```\n\n#### Floating CafeBar\n```java\n CafeBar.builder(context)\n    .content(\"some text\")\n    .floating(true)\n    .show();\n```\n\n#### CafeBar above Translucent NavigationBar\n```java\nCafeBar.builder(context)\n    .content(R.string.text)\n    //automatically determine if device has soft navigation bar and translucent navigation bar\n    .fitSystemWindow()\n    .show();\n```\n\n#### Custom Theme\n```java\nCafeBar.builder(context)\n    //Text color (content and buttons) automatically set\n    .theme(CafeBarTheme.Custom(Color.parseColor(\"#F44336\")));\n    .content(R.string.text)\n    .show();\n```\n\n#### Custom Font\n```java\nCafeBar.builder(context)\n    .content(R.string.text)\n    //You must place your font inside assets/fonts/ folder\n    .contentTypeface(\"RobotoMono-Regular.ttf\")\n    //Or\n    .contentTypeface(Typeface.createFromAsset(context.getAssets(), \"fonts/RobotoMono-Regular.ttf\");\n    .show();\n```\n\n# Customization\nBuilder\n- `customView()` \u0026#8594; Use custom view\n- `to()` \u0026#8594; Set target view, it should be `CoordinatorLayout`\n- `content()` \u0026#8594; Content text\n- `contentTypeface()` \u0026#8594; Custom typeface for content\n- `maxLines()` \u0026#8594; Max content lines, must be between 1 to 6.\n- `duration()` \u0026#8594; Show duration\n- `theme()` \u0026#8594; CafeBar theme, there are 3 choices available `DARK` (default), `LIGHT`, and `CLEAR_BLACK`. You can use custom theme `CafeBarTheme.Custom(int)`.\n- `icon()` \u0026#8594; Icon shown on left side of content\n- `showShadow()` \u0026#8594; Enable or disable shadow\n- `autoDismiss()` \u0026#8594; Enable or disable auto dismiss, default is true\n- `swipeToDismiss()` \u0026#8594; Enable or disable swipe to dismiss, only works with target view `CoordinatorLayout`.\n- `floating()` \u0026#8594; Set CafeBar style to floating\n- `gravity()` \u0026#8594; Set CafeBar view gravity, only works for tablet and floating\n- `fitSystemWindow()` \u0026#8594; Show CafeBar above translucent navigation bar\n- `neutralText()` \u0026#8594; Neutral action text\n- `neutralColor()` \u0026#8594; Neutral action text color\n- `neutralTypeface()` \u0026#8594; Custom typeface for neutral text\n- `onNeutral()` \u0026#8594; Neutral action callback\n- `positiveText()` \u0026#8594; Positive action text\n- `positiveColor()` \u0026#8594; Positive action text color\n- `positiveTypeface()` \u0026#8594; Custom typeface for positive text\n- `onPositive()` \u0026#8594; Positive action callback\n- `negativeText()` \u0026#8594; Negative action text\n- `negativeColor()` \u0026#8594; Negative action text color\n- `negativeTypeface()` \u0026#8594; Custom typeface for negative text\n- `onNegative()` \u0026#8594; Negative action callback\n- `buttonColor()` \u0026#8594; Set all buttons color\n- `buttonTypeface()` \u0026#8594; Set all buttons typeface\n- `typeface()` \u0026#8594; Set content and button typeface\n- `show()` \u0026#8594; Show CafeBar directly from builder\n- `build()` \u0026#8594; Create CafeBar\n\nCafeBar\n- `make()` \u0026#8594; Create CafeBar\n- `setAction()` \u0026#8594; It's the same with neutral action from builder, if `neutralText()` already set from builder `setAction()` will be ignored.\n- `getView()` \u0026#8594; Get root view of CafeBar\n- `show()` \u0026#8594; Show CafeBar\n- `dismiss()` \u0026#8594; Dismiss CafeBar\n\n# License\n```\nCopyright (c) 2017 Dani Mahardhika\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```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanimahardhika%2Fcafebar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanimahardhika%2Fcafebar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanimahardhika%2Fcafebar/lists"}