https://github.com/unfoldingword-dev/android-event-buffer
A very simple tool for registering one-way events on objects.
https://github.com/unfoldingword-dev/android-event-buffer
Last synced: about 1 year ago
JSON representation
A very simple tool for registering one-way events on objects.
- Host: GitHub
- URL: https://github.com/unfoldingword-dev/android-event-buffer
- Owner: unfoldingWord-dev
- License: mit
- Created: 2017-01-05T00:53:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T23:36:28.000Z (over 9 years ago)
- Last Synced: 2025-01-19T21:16:09.773Z (over 1 year ago)
- Language: Java
- Size: 56.6 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# android-event-buffer
A very simple tool for registering one-way events on objects.
##USAGE
The talker can be any class. Below is an example of a DialogFragment.
```java
public class MyTalker extends DialogFragment implements EventBuffer.OnEventTalker {
public static final int EVENT_HELLO_WORLD = 0;
private EventBuffer buffer = new EventBuffer();
@Override
public View onCreateView(LayoutInflator inflater, ViewGroup container, Bundle savedInstanceState) {
View v;
// do normal on-create stuff..
this.buffer.write(this, EVENT_HELLO_WORLD, null);
return v;
}
@Override
public void onDestroy() {
this.buffer.removeAllListeners();
super.onDestroy();
}
@Override
public EventBuffer getEventBuffer() {
return this.buffer;
}
}
```
The listener can be any class. Below is an example of an Activity.
> TODO: write example of listener.