@Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.color_button:
       colorDialog = new Dialog(this);
       colorDialog.setTitle(getString(R.string.select_color));
       colorDialog.setContentView(R.layout.color_dialog);
       colorDialog.findViewById(R.id.green_color_button).setOnClickListener(this);
       colorDialog.findViewById(R.id.yellow_color_button).setOnClickListener(this);
       colorDialog.findViewById(R.id.red_color_button).setOnClickListener(this);
       colorDialog.show();
       break;
     case R.id.green_color_button:
       currentColor = MainMenuActivity.COLOR_GREEN;
       ((ImageButton) findViewById(R.id.color_button))
           .setImageDrawable(getResources().getDrawable(R.drawable.greenstar));
       colorDialog.dismiss();
       break;
     case R.id.yellow_color_button:
       currentColor = MainMenuActivity.COLOR_YELLOW;
       ((ImageButton) findViewById(R.id.color_button))
           .setImageDrawable(getResources().getDrawable(R.drawable.yellowstar));
       colorDialog.dismiss();
       break;
     case R.id.red_color_button:
       currentColor = MainMenuActivity.COLOR_RED;
       ((ImageButton) findViewById(R.id.color_button))
           .setImageDrawable(getResources().getDrawable(R.drawable.redstar));
       colorDialog.dismiss();
       break;
     default:
       break;
   }
 }
 /** Called when activity is in the background. */
 @Override
 public void onPause() {
   super.onPause();
   currTimeMilli = System.currentTimeMillis();
   onePlayerEventDG.dismiss();
   twoPlayerEventDG.dismiss();
 }
        @Override
        public void onClick(View v) {
          switch (v.getId()) {
            case R.id.dialog_layout_add_truck_item_button_add:
              if (!CommonUtilities.isNetworkAvailable(mContext)) {
                Toast.makeText(mContext, "Network connection unavailable.", Toast.LENGTH_SHORT)
                    .show();
                break;
              }
              quantityToAdd = Double.parseDouble(addPartDialogQuantity.getText().toString());

              if (quantityToAdd <= 0) {
                Toast.makeText(mContext, "Quantity Can't Be Null!", Toast.LENGTH_SHORT).show();
                return;
              }

              if (!addPartDialog.isShowing()) addPartDialog.dismiss();

              new SubmitTruckItemTask().execute();
              break;
            case R.id.dialog_layout_add_truck_item_button_cancel:
              if (addPartDialog.isShowing()) addPartDialog.dismiss();
              break;
            default:
              // Nothing
              break;
          }
        }
 @Override
 public Object instantiateItem(ViewGroup container, int position) {
   View courseView = container.getChildAt(position);
   Course course = this.course.get(position);
   if (courseView == null) {
     if (course.getCourseType() == Course.TYPE) {
       courseView = mInflater.inflate(R.layout.item_dialog_schedule, container, false);
       TextView name = (TextView) courseView.findViewById(R.id.dialog_course_name);
       TextView teacher = (TextView) courseView.findViewById(R.id.dialog_course_teacher);
       TextView classroom = (TextView) courseView.findViewById(R.id.dialog_course_classroom);
       TextView weeks = (TextView) courseView.findViewById(R.id.dialog_course_weeks);
       TextView time = (TextView) courseView.findViewById(R.id.dialog_course_time);
       TextView timenum = (TextView) courseView.findViewById(R.id.dialog_course_time_num);
       TextView type = (TextView) courseView.findViewById(R.id.dialog_course_type);
       name.setText(course.course);
       teacher.setText(course.teacher);
       classroom.setText(course.classroom);
       time.setText(
           context.getResources().getStringArray(R.array.schedule_weekday)[course.hash_day]
               + " ~ "
               + course.begin_lesson
               + "-"
               + (course.begin_lesson + course.period - 1)
               + "节");
       String timeStr =
           context.getResources().getStringArray(R.array.schedule_time)[course.hash_lesson];
       if (course.period == 2) {
         timenum.setText(timeStr);
       } else {
         timenum.setText(timeStr.substring(0, timeStr.indexOf("~") + 1) + "下课");
       }
       type.setText(course.type);
       weeks.setText(course.rawWeek);
       container.addView(courseView);
     } else {
       courseView = mInflater.inflate(R.layout.item_dialog_affair, container, false);
       TextView name = (TextView) courseView.findViewById(R.id.dialog_course_name);
       TextView teacher = (TextView) courseView.findViewById(R.id.dialog_course_teacher);
       Button delete = (Button) courseView.findViewById(R.id.dialog_affair_delete);
       Button modify = (Button) courseView.findViewById(R.id.dialog_affair_modify);
       delete.setOnClickListener(
           (view -> {
             EventBus.getDefault().post(new AffairDeleteEvent(course));
             dialog.dismiss();
           }));
       modify.setOnClickListener(
           (view -> {
             dialog.dismiss();
             Affair affair = (Affair) course;
             EditAffairActivity.editAffairActivityStart(context, affair);
           }));
       name.setText(course.course);
       teacher.setText(course.teacher);
       container.addView(courseView);
     }
   }
   return courseView;
 }
예제 #5
0
 @SuppressWarnings("unchecked")
 @Override
 public void handleMessage(Message msg) {
   // TODO Auto-generated method stub
   super.handleMessage(msg);
   switch (msg.what) {
     case IS_REQUSTING:
       mDialog = Utils.createLoadingDialog(mContext, "正在请求设备周围WiFi列表...");
       mDialog.show();
       break;
     case REQUST_TIMEOUT:
       if (mDialog != null) mDialog.dismiss();
       if (handler.hasMessages(REQUST_TIMEOUT)) {
         handler.removeMessages(REQUST_TIMEOUT);
       }
       Toast.makeText(mContext, "请求WiFi列表失败,请重试! ", Toast.LENGTH_SHORT).show();
       break;
     case R.id.requst_wifi_list_id:
       if (handler.hasMessages(REQUST_TIMEOUT)) {
         handler.removeMessages(REQUST_TIMEOUT);
         if (mDialog != null) mDialog.dismiss();
         int resultCode = msg.arg1;
         if (resultCode == 0) {
           showWiFiListDialog((ArrayList<HashMap<String, Object>>) msg.obj);
         } else {
           Toast.makeText(mContext, "设备附近暂时没有WiFi信号! ", Toast.LENGTH_SHORT).show();
         }
       } else {
         handler.removeMessages(R.id.requst_wifi_list_id);
       }
       break;
     case IS_SETTING:
       mDialog = Utils.createLoadingDialog(mContext, "正在配置设备WiFi网络...");
       mDialog.show();
       break;
     case SET_TIMEOUT:
       if (mDialog != null) mDialog.dismiss();
       if (handler.hasMessages(SET_TIMEOUT)) {
         handler.removeMessages(SET_TIMEOUT);
       }
       Toast.makeText(mContext, "配置设备WiFi网络超时,请重试! ", Toast.LENGTH_SHORT).show();
       break;
     case R.id.set_term_wifi_id:
       if (handler.hasMessages(SET_TIMEOUT)) {
         handler.removeMessages(SET_TIMEOUT);
         if (mDialog != null) mDialog.dismiss();
         int resultCode = msg.arg1;
         if (resultCode == 1) {
           Toast.makeText(mContext, "配置设备WiFi网络成功! ", Toast.LENGTH_SHORT).show();
         } else {
           Toast.makeText(mContext, "配置设备WiFi网络失败,请重试! ", Toast.LENGTH_SHORT).show();
         }
       } else {
         handler.removeMessages(R.id.set_term_wifi_id);
       }
       break;
   }
 }
 private void dismissDialogs() {
   if (mAdbDialog != null) {
     mAdbDialog.dismiss();
     mAdbDialog = null;
   }
   if (mEnableDialog != null) {
     mEnableDialog.dismiss();
     mEnableDialog = null;
   }
 }
예제 #7
0
  @SuppressWarnings("unchecked")
  public static void unzipArchive(
      Activity activity,
      File archive,
      String outputDir,
      Dialog mDialog,
      final TextView accion,
      final ProgressBar descomprimidos) {

    try {

      ZipFile zipfile = new ZipFile(archive);
      int total_elementos = 0;

      for (Enumeration e = zipfile.entries(); e.hasMoreElements(); ) {
        total_elementos = total_elementos + 1;
        ZipEntry entry = (ZipEntry) e.nextElement();
      }

      descomprimidos.setMax(total_elementos);

      int numero_elemento = 0;
      for (Enumeration e = zipfile.entries(); e.hasMoreElements(); ) {

        class OneShotTask implements Runnable {
          int finalnum;

          OneShotTask(int f) {
            finalnum = f;
          }

          public void run() {
            descomprimidos.setProgress(Integer.valueOf(finalnum));
          }
        }

        new Thread(new OneShotTask(numero_elemento)).start();

        ZipEntry entry = (ZipEntry) e.nextElement();
        numero_elemento = numero_elemento + 1;
        unzipEntry(zipfile, entry, outputDir);
      }

      mDialog.dismiss();

    } catch (Exception e) {
      Log.e("unzipper", "Error while extracting file " + archive);
      Toast.makeText(
              activity, "Error al extraer los datos. Reinicie la aplicaci—n.", Toast.LENGTH_LONG)
          .show();
      archive.delete();
      mDialog.dismiss();
    }
  }
예제 #8
0
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 1:
       setmap(urlstr);
       calssAdapter = new CalssAdapter(array, ReplyPhoto.this);
       calss.setAdapter(calssAdapter);
       break;
     case 2:
       Toast.makeText(ReplyPhoto.this, "获取分类失败,请检查网络", Toast.LENGTH_SHORT).show();
       break;
     case 3:
       Toast.makeText(ReplyPhoto.this, "暂无分类", Toast.LENGTH_SHORT).show();
       break;
     case 4:
       dialog.dismiss();
       Toast.makeText(ReplyPhoto.this, "失败", Toast.LENGTH_SHORT).show();
       break;
     case 5:
       dialog.dismiss();
       JSONObject jsonObject = JSON.parseObject(str);
       int a = jsonObject.getIntValue("ret");
       if (a == 200) {
         JSONObject jsonObject1 = jsonObject.getJSONObject("data");
         int b = jsonObject1.getIntValue("code");
         if (b == 0) {
           //                            Bimp.tempSelectBitmap.clear();
           Bimp.tempSelectBitmap.clear();
           Bimp.max = 0;
           Intent intent = new Intent("data.broadcast.action");
           sendBroadcast(intent);
           for (int i = 0; i < PublicWay.activityList.size(); i++) {
             if (null != PublicWay.activityList.get(i)) {
               PublicWay.activityList.get(i).finish();
             }
           }
           //                            finish();
           Intent intent1 = new Intent();
           intent1.setAction("com.servicedemo4");
           intent1.putExtra("getmeeage", "4");
           ReplyPhoto.this.sendBroadcast(intent1);
         } else {
           handlers.sendEmptyMessage(4);
         }
       } else {
         handlers.sendEmptyMessage(4);
       }
       break;
   }
 }
예제 #9
0
  @Override
  public void onPrepared(MediaPlayer mp) {

    if (isPrepare) {
      if (playType == PLAY_TYPE_LOD || playType == PLAY_TYPE_ONDEMAND) {
        // TODO 数据库操作 记忆续播
        MPConPlayManager cPm =
            MPConPlayUtils.findConnectionPlay(currentPosition, parentName, getChildName());
        if (cPm != null && cPm.getEpisodePos() == currentPosition && cPm.getPlayIndex() != 0) {
          mp.seekTo(cPm.getPlayIndex());
        }

        mHandler.sendEmptyMessage(SHOW_CONTROL_ANIMATION);
      }

      mp.start();
      isPrepare = false;

      if (mDialog != null && mDialog.isShowing()) {
        mDialog.dismiss();
      }
      // 判断是否是本地播放或在线点播
      if (playType == PLAY_TYPE_LOD || playType == PLAY_TYPE_ONDEMAND) {
        if (mp.isPlaying() && !mSeekBar.isPressed()) {

          mHandler.sendEmptyMessage(UPDATA_PLAY_TIME);
        }
      }

      mProgressBar.setVisibility(View.INVISIBLE);

      mPlayer.setScreenOnWhilePlaying(true);
    }
  }
예제 #10
0
 private void clearDialog() {
   Dialog dialog = dialogWrapper.getDialog();
   if (dialog != null) {
     dialog.dismiss();
     dialog = null;
   }
 }
예제 #11
0
  @Override
  protected void showFingerprintDialog() {
    if (!this.endpoint.isSSL()) {
      this.createInformationDialog(R.string.ssl_fingerprint, R.string.ssl_disabled).show();
    } else if (this.endpoint.getStatus() != Endpoint.Status.ACTIVE
        && this.endpoint.getStatus() != Endpoint.Status.ONLINE) {
      this.createInformationDialog(
              R.string.ssl_fingerprint, R.string.endpoint_offline_no_fingerprint)
          .show();
    } else {
      this.spinner =
          ProgressDialog.show(
              this, getString(R.string.ssl_fingerprint), getString(R.string.calculating), true);

      try {
        Agent.getInstance()
            .getClientService()
            .getPeerFingerprint(
                this.endpoint.getId(), new Messenger(new IncomingFingerprintHandler(this)));
      } catch (RemoteException e) {
        spinner.dismiss();

        this.createInformationDialog(R.string.ssl_fingerprint, R.string.ssl_fingerprint_error);
      }
    }
  }
 private void cleanupRenameDialog() {
   if (mRenameDialog != null) {
     mRenameDialog.dismiss();
     mRenameDialog = null;
   }
   mCurrentRenameGesture = null;
 }
  private void dismiss() {
    if (null == mDialog) {
      return;
    }

    mDialog.dismiss();
  }
 public void handleMessage(android.os.Message msg) {
   if (msg.what == 0x01) {
     dialog.dismiss();
     ToastUtils.makeToast(FeedBackActivity.this, "反馈成功");
     et_feedback_content.setText("");
   }
 };
예제 #15
0
 public void dismiss()
 {
   int i;
   if (c <= 1000L)
   {
     i = 1;
     if (i == 0) {
       break label33;
     }
     ManagerApp.a().d();
   }
   for (;;)
   {
     super.dismiss();
     return;
     i = 0;
     break;
     label33:
     k localk = new k("Roadblock.Cancel");
     localk.a("percentLikesLeft", Integer.valueOf(ManagerApp.n().a()));
     localk.a("otherId", d);
     localk.a("sku", h.b());
     localk.a("price", Float.valueOf(h.d()));
     localk.a("currency", h.a());
     localk.a("locale", com.tinder.utils.o.b());
     localk.a("roadblockVersion", Integer.valueOf(1));
     localk.a("timeRemaining", Long.valueOf(ManagerApp.n().b()));
     b.a(localk);
   }
 }
예제 #16
0
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case DOWN_UPDATE:
       mProgress.setProgress(progress);
       mProgressText.setText(tmpFileSize + "/" + apkFileSize);
       break;
     case DOWN_OVER:
       downloadDialog.dismiss();
       installApk();
       break;
     case DOWN_NOSDCARD:
       downloadDialog.dismiss();
       Toast.makeText(mContext, "无法下载安装文件,请检查SD卡是否挂载", Toast.LENGTH_SHORT).show();
       break;
   }
 };
        @Override
        public void onClick(View view) {
          mDialog.dismiss();

          switch (view.getId()) {
            case R.id.ly_01:
              mTxtSoundType.setText(GlobalSetting.CONTENT_MAP.get(Constants.Music.ITEM_01));
              SPUtils.put(
                  SettingActivity.this, Constants.SPKey.MUSIC_ITEM_KEY, Constants.Music.ITEM_01);
              break;
            case R.id.ly_02:
              mTxtSoundType.setText(GlobalSetting.CONTENT_MAP.get(Constants.Music.ITEM_02));
              SPUtils.put(
                  SettingActivity.this, Constants.SPKey.MUSIC_ITEM_KEY, Constants.Music.ITEM_02);
              break;
            case R.id.ly_03:
              mTxtSoundType.setText(GlobalSetting.CONTENT_MAP.get(Constants.Music.ITEM_03));
              SPUtils.put(
                  SettingActivity.this, Constants.SPKey.MUSIC_ITEM_KEY, Constants.Music.ITEM_03);
              break;
            case R.id.ly_04:
              mTxtSoundType.setText(GlobalSetting.CONTENT_MAP.get(Constants.Music.ITEM_04));
              SPUtils.put(
                  SettingActivity.this, Constants.SPKey.MUSIC_ITEM_KEY, Constants.Music.ITEM_04);
              break;
            default:
              break;
          }
        }
  public void show() {
    ButterKnife.inject(this, mDialog);

    mLevelPreviousButton.setOnClickListener(
        v -> {
          mChosenLevel = mChosenLevel - 1;
          updateDialog();
        });

    mLevelNextButton.setOnClickListener(
        v -> {
          mChosenLevel = mChosenLevel + 1;
          updateDialog();
        });

    mLevelConfirmButton.setOnClickListener(
        v -> {
          Exercise chosenExercise = mExercise.getSection().getExercises().get(mChosenLevel);

          RoutineStream.getInstance().setLevel(chosenExercise, mChosenLevel);

          mDialog.dismiss();
        });

    mLevelProgressBar.setWheelSize(12);
    mLevelProgressBar.setProgressColor(Color.parseColor("#009688")); // 00453E
    mLevelProgressBar.setProgressBackgroundColor(Color.parseColor("#00453E"));

    updateDialog();

    mDialog.show();
  }
  /** @brief ページ読み込み進行ハンドラ 100% に達したらページ修正、オートログインなどを実施する */
  @Override
  public void onProgressChanged(WebView wv, int progress) {
    Log.d(TAG, "onProgressChanged = " + progress + " " + wv.getUrl());
    if (progress < 100) {
      if (dlg == null) {
        dlg = new Dialog(view.getContext());
        dlg.setTitle("Loading...");
        dlg.show();
      }
    } else {
      if (dlg != null) {
        dlg.dismiss();
        dlg = null;
      }

      if (autoLogin(wv)) {
        return;
      }

      String url = wv.getUrl();
      if (url != null && url.startsWith(INNER_URL_PREFIX)) {
        fixPage(wv);
      }
    }
  }
        public void handleMessage(Message msg) {
          if (currenDialog != null) {
            currenDialog.dismiss();
          }

          switch (msg.what) {
            case 1:
              if (EasyLinkDeviceCenterActivity.findDeviceMap.containsKey(deviceOldName)) {
                EasyLinkDeviceCenterActivity.findDeviceMap.remove(deviceOldName);
              }
              Intent intent = new Intent();
              setResult(2, intent);
              finish();
              break;
            case 0:
              dialogBuilder
                  .setTitle(null)
                  .setMessage("Connect to " + IPAddress + " failed.")
                  .setPositiveButton(
                      "OK",
                      new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface arg0, int arg1) {
                          return;
                        }
                      });
              currenDialog = dialogBuilder.show();
              break;
          }
        };
예제 #21
0
 @Override
 public void handleSubInfoUpdate() {
   Dialog dialog = getDialog();
   if (dialog != null) {
     dialog.dismiss();
   }
 }
  protected void performGoogleTVSecondScreen() {
    if (hasAbleRemote(context) || hasGoogleTVRemote(context) || hasAllCast(context)) {
      dialog.dismiss();

      final String body = info.getDirectPlayUrl();

      final SenderAppAdapter adapter = new SenderAppAdapter(context);

      new AlertDialog.Builder(context)
          .setTitle(R.string.cast_fling_with_)
          .setCancelable(true)
          .setSingleChoiceItems(
              adapter,
              -1,
              new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                  adapter.respondToClick(which, "", body);

                  dialog.dismiss();
                }
              })
          .show();
    }
  }
예제 #23
0
 private void showDialog() {
   if (pd != null && pd.isShowing()) {
     pd.dismiss();
   }
   pd = CommonDialog.ProgressDialog(this);
   pd.show();
 }
예제 #24
0
  /** 成功时的回调方法 */
  @Override
  protected void deliverResponse(String response) {
    if (mDialog != null) mDialog.dismiss();

    mListener.onResponse(response);
    Log.d(VolleyHttpClient.TAG, String.format("GET-response:%s", response));
  }
예제 #25
0
 @Override
 public void dismiss() {
   super.dismiss();
   if (mCallBack != null) {
     mCallBack.handleDialogDismiss();
   }
 }
예제 #26
0
  // 录音完毕加载 ListView item
  private void finishRecord() {
    cancelTimer();
    stopRecording();
    if (recordIndicator != null) recordIndicator.dismiss();

    long intervalTime = System.currentTimeMillis() - startTime;
    if (intervalTime < MIN_INTERVAL_TIME) {
      MUIToast.toast(getContext(), R.string.time_too_short_toast);
      myRecAudioFile.delete();
      return;
    } else {
      if (myRecAudioFile != null && myRecAudioFile.exists()) {
        MediaPlayer mp = MediaPlayer.create(mContext, Uri.parse(myRecAudioFile.getAbsolutePath()));
        // 某些手机会限制录音,如果用户拒接使用录音,则需判断mp是否存在
        if (mp != null) {
          int duration = mp.getDuration() / 1000; // 即为时长 是s
          if (duration < 1) duration = 1;
          else if (duration > 60) duration = 60;

          mHandler
              .obtainMessage(
                  Api.UPLOAD_VOICE_CALLBACK, duration, 0, myRecAudioFile.getAbsolutePath())
              .sendToTarget();
        } else {
          MUIToast.toast(mContext, R.string.record_voice_permission_request);
        }
      }
    }
  }
예제 #27
0
 @Override
 public void onStop() {
   if (mDialog != null && mDialog.isShowing()) {
     mDialog.dismiss();
   }
   super.onPause();
 }
예제 #28
0
  private void updateFlicks(String sort_order) {
    if (mUtils.isDataAvaialable()) {
      dataState(DATA_STATE_CONNECTED);
      mAlertCancelledState = false;
      mNoDataTextView.setVisibility(View.GONE);
      if (mAlert != null && mAlert.isShowing()) mAlert.dismiss();

      if (!mIsDoneDownloadingData && mSharedPref != null) {
        mFlickDataFetchTask = new FlickDataFetchAsyncTask(getActivity(), sort_order, this);
        mFlickDataFetchTask.execute();
      }
    } else {
      if (!mAlertCancelledState) {
        dataAlert(DATA_STATE_DISCONNECTED);
      } else {
        Toast.makeText(
                mContext,
                getResources().getString(R.string.data_unavailable_msg),
                Toast.LENGTH_SHORT)
            .show();
      }
      mNoDataTextView.setVisibility(View.VISIBLE);
      dataState(DATA_STATE_DISCONNECTED);
      updateGridBasedOnDataConnectionState();
    }
  }
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      if (vandaAlert != null) {
        vandaAlert.dismiss();
      }
      if (isRunning) {
        VandaAlert.CreateOKorNODialog(
                this,
                "正在扫描本地视频,确定要离开吗?",
                new VandaAlert.OnOk() {
                  @Override
                  public void setOk(Dialog dialog) {
                    if (dialog != null) {
                      dialog.dismiss();
                      isRunning = false;
                      finish();
                    }
                  }

                  @Override
                  public void setCancel(Dialog dialog) {
                    if (dialog != null) {
                      dialog.dismiss();
                    }
                  }
                })
            .show();
      } else {
        finish();
      }
    }
    return super.onKeyDown(keyCode, event);
  }
예제 #30
0
 @Override
 public void dismiss() {
   if (getExtraAppFuture != null) {
     getExtraAppFuture.cancel(true);
   }
   super.dismiss();
 }