Skip to content

Instantly share code, notes, and snippets.

@weefbellington
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weefbellington/190ad9fb84ea3518c18b to your computer and use it in GitHub Desktop.
Save weefbellington/190ad9fb84ea3518c18b to your computer and use it in GitHub Desktop.
public class DataBindingComponent<DataType> implements Scene.Component {
private final Bindable target;
private final Data data;
public DataBindingComponent(Data data, Bindable<DataType> target) {
this.data = data;
this.target = target;
}
@Override
public void afterSetUp(Context context, Scene scene, View view) {
target.bind(data)
}
@Override
public void beforeTearDown(Context context, Scene scene, View view) {
//do we need to unbind here?
}
}
public interface Bindable<DataType> {
public void bind(Data data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment