Example #1
0
 protected void showLoadingPage() {
   if (mLoadDialogView == null) {
     GDLoadingDialogView.Builder builder =
         new GDLoadingDialogView.Builder(this, R.layout.no_network_error_view);
     mLoadDialogView = builder.create();
     mLoadDialogView.ShowDialog();
   } else {
     if (!mLoadDialogView.isShowing()) mLoadDialogView.ShowDialog();
   }
   mLoadDialogView.showLoadingInfo();
   mLoadDialogView.setCancelable(true);
 }
Example #2
0
 public void showErrorMsg(String error) {
   mHandler.removeCallbacks(mTimeoutTask);
   mHandler.removeCallbacks(mNoResponseTask);
   if (mLoadDialogView == null) showLoadingPage();
   if (!mLoadDialogView.isShowing()) mLoadDialogView.ShowDialog();
   mLoadDialogView.showLoadErrorInfo(error);
   if (mPageContent != null && mPageContent.getVisibility() == View.VISIBLE) {
     mHandler.postDelayed(
         new Runnable() {
           @Override
           public void run() {
             hideloadingPage();
           }
         },
         1000);
   } else {
     mLoadDialogView.setCancelable(true);
   }
 }
Example #3
0
  private void handCanNotConnectToServer() {
    mHandler.removeCallbacks(mTimeoutTask);
    mHandler.removeCallbacks(mNoResponseTask);
    if (mLoadDialogView != null) {
      mLoadDialogView.showNetWorkErrorInfo();
      mLoadDialogView.setCancelable(true);
    }
    if (mPageContent != null && mPageContent.getVisibility() == View.VISIBLE) {
      mHandler.postDelayed(
          new Runnable() {

            @Override
            public void run() {
              hideloadingPage();
            }
          },
          1000);
    }
  }
Example #4
0
 @Override
 public void run() {
   if (mLoadDialogView != null && mLoadDialogView.isShowing()) handCanNotConnectToServer();
 }
Example #5
0
 protected void onStop() {
   super.onStop();
   if (mLoadDialogView != null) mLoadDialogView.dismiss();
 };
Example #6
0
 protected void hideloadingPage() {
   mHandler.removeCallbacks(mNoResponseTask);
   if (mLoadDialogView != null && mLoadDialogView.isShowing()) {
     mLoadDialogView.hideDialog();
   }
 }