{"id":13507618,"url":"https://github.com/SimonVT/MessageBar","last_synced_at":"2025-03-30T09:32:58.180Z","repository":{"id":7633503,"uuid":"8993254","full_name":"SimonVT/MessageBar","owner":"SimonVT","description":"An Android Toast replacement, similar to the one seen in the GMail app.","archived":false,"fork":false,"pushed_at":"2013-08-07T15:10:58.000Z","size":772,"stargazers_count":551,"open_issues_count":3,"forks_count":114,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-03-29T11:08:24.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://simonvt.github.com/MessageBar/","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/SimonVT.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}},"created_at":"2013-03-24T21:07:44.000Z","updated_at":"2024-10-31T11:48:57.000Z","dependencies_parsed_at":"2022-09-21T19:24:47.308Z","dependency_job_id":null,"html_url":"https://github.com/SimonVT/MessageBar","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonVT%2FMessageBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonVT%2FMessageBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonVT%2FMessageBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonVT%2FMessageBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonVT","download_url":"https://codeload.github.com/SimonVT/MessageBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174600,"owners_count":20735417,"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-01T02:00:37.083Z","updated_at":"2025-03-30T09:32:58.159Z","avatar_url":"https://github.com/SimonVT.png","language":"Java","readme":"MessageBar\n==========\n\nAn Android Toast replacement, similar to the one seen in the GMail app.\nMultiple messages can be posted in succession, and each message will be\nshown for 5 seconds.\n\n\nUsage\n=====\n\nThere's two ways to use the MessageBar. It can either be attached directly\nto an activity, or a View can be passed.\n\nAttaching to an activity\n------------------------\n\nThis approach requires adding the following attributes to the Activity's theme.\n\n```xml\n\u003citem name=\"messageBarContainerStyle\"\u003e@style/MessageBar.Container\u003c/item\u003e\n\u003citem name=\"messageBarTextStyle\"\u003e@style/MessageBar.Message\u003c/item\u003e\n\u003citem name=\"messageBarButtonStyle\"\u003e@style/MessageBar.Button\u003c/item\u003e\n```\n\nAttaching the MessageBar is then done by passing the Activity to the\nMessageBar constructor.\n\n```java\nmMessageBar = new MessageBar(this);\n```\n\nThis will automatically add a MessageBar layout to the content view.\n\nAttaching to a View\n-------------------\n\nThis can be used e.g. when attaching to a Fragment, or if custom views\nare to be used for showing the message.\n\nWhen using this approach, child views with the following id's must be added\nto the passed View.\n\n * `mbContainer`: The container that holds the message and the button views.\n * `mbMessage`: A TextView that displays the message.\n * `mbButton`: A TextView that displays the button text.\n\nAs an example, this is the default layout that's used when attaching to an Activity.\n\n```xml\n\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@id/mbContainer\"\n    style=\"?attr/messageBarContainerStyle\"\u003e\n\n    \u003cTextView\n        android:id=\"@id/mbMessage\"\n        style=\"?attr/messageBarTextStyle\" /\u003e\n\n    \u003cTextView\n        android:id=\"@id/mbButton\"\n        style=\"?attr/messageBarButtonStyle\" /\u003e\n\u003c/LinearLayout\u003e\n```\n\nThe MessageBar is then attached by passing a parent view to the constructor.\n\nShowing a message\n-----------------\n\nA message is shown simple by calling `MessageBar#show(...)`. A few methods are\navailable here. It can either simply show a message or show a message and a\nbutton. When a button is shown, a Parcelable has to be passed that's then returned\nvia `MessageBar$OnMessageClickListener` if the button is clicked.\n\nExample:\n```java\nmMessageBar.show(\"This is a message\");\n```\n\n\nCredits\n=======\n\n * Roman Nurik for creating the [example][1] this library is based on.\n\n\nLicense\n=======\n\n    Copyright 2012 Simon Vig Therkildsen\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\n\n\n\n [1]: https://code.google.com/p/romannurik-code/source/browse/#git%2Fmisc%2Fundobar\n","funding_links":[],"categories":["CN","Java","Libs","etc"],"sub_categories":["[Simon Vig](https://github.com/SimonVT)","\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimonVT%2FMessageBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSimonVT%2FMessageBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimonVT%2FMessageBar/lists"}