Exemplo n.º 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;
 }
Exemplo n.º 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;
  }
Exemplo n.º 3
0
  public void onWindowFocusChanged(boolean hasFocus) {

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