{"id":19904301,"url":"https://github.com/coding-dream/eventbus","last_synced_at":"2025-05-03T00:31:35.568Z","repository":{"id":179904073,"uuid":"77202008","full_name":"coding-dream/EventBus","owner":"coding-dream","description":"个人定制版EventBus，去除注解","archived":false,"fork":false,"pushed_at":"2017-02-23T03:26:18.000Z","size":148,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T09:03:39.323Z","etag":null,"topics":["eventbus","observable","observer"],"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/coding-dream.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-23T06:02:37.000Z","updated_at":"2022-03-28T04:08:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"dcb8635c-1525-4659-aa61-83da3aeeff71","html_url":"https://github.com/coding-dream/EventBus","commit_stats":null,"previous_names":["coding-dream/eventbus"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding-dream%2FEventBus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding-dream%2FEventBus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding-dream%2FEventBus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding-dream%2FEventBus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coding-dream","download_url":"https://codeload.github.com/coding-dream/EventBus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252126546,"owners_count":21698964,"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":["eventbus","observable","observer"],"created_at":"2024-11-12T20:27:46.914Z","updated_at":"2025-05-03T00:31:35.556Z","avatar_url":"https://github.com/coding-dream.png","language":"Java","readme":"## EventBus\n带你一步步实现专属自己的事件总线，使用简洁，事件接收默认即为 UI线程\n\n去除原有EventBus注解功能，效率更好高\n\n## 方式一\n\n\n ```\n  public class MainActivity extends AppCompatActivity implements Subscriber{\n\n      private Subscriber subscriber;\n\n      @Override\n      protected void onCreate(Bundle savedInstanceState) {\n          super.onCreate(savedInstanceState);\n          setContentView(R.layout.activity_main);\n\n          EventBus.getDefault().register(this);\n\n          Intent intent = new Intent();\n          intent.setClass(this, TwoActivity.class);\n          startActivity(intent);\n\n\n      }\n\n\n      @Override\n      protected void onDestroy() {\n          super.onDestroy();\n\n          EventBus.getDefault().unregister(this);\n      }\n\n      @Override\n      public void receive(Object object) {\n          Toast.makeText(MainActivity.this, subscriber + \"Jam 收到消息了:\" + object, Toast.LENGTH_SHORT).show();\n      }\n\n\n\n  }\n\n\n ```\n\n\n## 方式二\n\n```\n Subscriber subscriber = EventBus.getDefault().register(new Subscriber() {\n             @Override\n             public void receive(Object object) {\n                 Toast.makeText(MainActivity.this, subscriber + \"Tom 收到消息了:\" + object, Toast.LENGTH_SHORT).show();\n             }\n         },\"tag1\");\n\n```\n\n\n\n## 消息发送\n\n```\npublic class TwoActivity extends AppCompatActivity {\n\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_two);\n\n\n        EventBus.getDefault().notifyDataChange(\"fucking\");\n        EventBus.getDefault().notifyDataChange(\"hello\",\"tag1\");\n\n    }\n}\n\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoding-dream%2Feventbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoding-dream%2Feventbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoding-dream%2Feventbus/lists"}