Пример #1
0
 public static LoadingDialog getLoadingDialog(Context context) {
   loadingDialog = new LoadingDialog(context, R.style.LoadingDialog);
   loadingDialog.setContentView(R.layout.view_loading);
   loadingDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
   // 加载动画
   animation = AnimationUtils.loadAnimation(context, R.anim.anim_load);
   loadingDialog.setCancelable(true);
   return loadingDialog;
 }
Пример #2
0
  /**
   * [Summary] setMessage 提示内容
   *
   * @param strMessage
   * @return
   */
  public LoadingDialog setMessage(String strMessage) {
    TextView tvMsg = (TextView) loadingDialog.findViewById(R.id.dialog_loadingcontent);

    if (tvMsg != null) {
      tvMsg.setText(strMessage);
    }

    return loadingDialog;
  }
Пример #3
0
  public void onWindowFocusChanged(boolean hasFocus) {

    if (loadingDialog == null) {
      return;
    }
    ImageView loadImage = (ImageView) loadingDialog.findViewById(R.id.loading);
    // 使用ImageView显示动画
    loadImage.startAnimation(animation);
  }