Skip to content

Instantly share code, notes, and snippets.

@stfalconaleks
Created October 6, 2017 08:03
Show Gist options
  • Save stfalconaleks/8185325fd9fd4e06e88fa7503ab2dc6d to your computer and use it in GitHub Desktop.
Save stfalconaleks/8185325fd9fd4e06e88fa7503ab2dc6d to your computer and use it in GitHub Desktop.
public abstract class BindingActivity<B extends ViewDataBinding, VM extends ActivityViewModel> extends AppCompatActivity {
private B binding;
private VM viewModel;
public B getBinding() {
return binding;
}
}
public abstract class ActivityViewModel<A extends AppCompatActivity>
extends BaseObservable {
protected A activity;
public ActivityViewModel(A activity) {
this.activity = activity;
}
public A getActivity() {
return activity;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment