Skip to content

Instantly share code, notes, and snippets.

@HarinTrivedi
Last active January 20, 2018 05:30
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 HarinTrivedi/a2fd1aa116b358655a8bdb9a76b4a3b2 to your computer and use it in GitHub Desktop.
Save HarinTrivedi/a2fd1aa116b358655a8bdb9a76b4a3b2 to your computer and use it in GitHub Desktop.
public abstract class BaseBindingActivity<T extends ViewDataBinding> extends AppCompatActivity {
public PreferenceUtils preferences;
T binding;
protected abstract int attachView();
protected abstract void initView();
protected abstract void initToolbar();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
preferences = new PreferenceUtils(this);
binding = DataBindingUtil.setContentView(this, attachView());
initToolbar();
initView();
}
}
package com.hlabexamples.commonmvp.base.mvp.view;
import android.databinding.ViewDataBinding;
/**
* Created by H.T. on 01/12/17.
*/
public interface BaseBindingView<T extends ViewDataBinding> extends BaseView {
T getBinding();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment