Loading
Loading copied to clipboard
Needn't define it in XML file?
I want to use it like this?
NewtonCradleLoading newtonCradleLoading = new NewtonCradleLoading(getActivity())
newtonCradleLoading.start();
could it happen?
systemt throws an erro: Attempt to invoke virtual method 'void com.victor.loading.newton.CradleBall.startAnimation(android.view.animation.Animation)' on a null object reference
View must be defined in xml file or add into layout by code.
Yeah,I have solved it. I think it's better to encapsulate this view into dialog,so that every time we just need use in java rather in xml.
public void showLoadingDialog() {
if (loadingDialog == null) {
loadingDialog = new LoadingDialog(this);
}
loadingDialog.showLoading();
}
public void stopLoadingDialog() {
if (loadingDialog != null) {
loadingDialog.stopLoading();
}
}