示例#1
0
 /** Handle buttons click on dirty or delete confirmation popup. */
 public void onClick(DialogInterface dialog, int which) {
   switch (currentDialog) {
     case DIALOG_DIRTY:
       switch (which) {
         case DialogInterface.BUTTON_POSITIVE:
           dialog.dismiss();
           this.dirtyQuit = true;
           this.save();
           break;
         case DialogInterface.BUTTON_NEGATIVE:
           dialog.dismiss();
           this.kill = true;
           this.finish();
           break;
         case DialogInterface.BUTTON_NEUTRAL:
           dialog.dismiss();
           break;
       }
       break;
     case DIALOG_DELETE:
       switch (which) {
         case DialogInterface.BUTTON_POSITIVE:
           dialog.dismiss();
           this.delete();
           break;
           // There is no listener bound to negative: default is dismiss.
       }
       break;
   }
 }
 public void onClick(DialogInterface dialog, int which) {
   switch (which) {
     case BUTTON_NEGATIVE:
       dialog.dismiss();
       break;
     case BUTTON_NEUTRAL:
       dialog.dismiss();
       listener.colorSelected(-1);
       break;
     case BUTTON_POSITIVE:
       listener.colorSelected(selectedColor);
       break;
   }
 }
示例#3
0
 @Override
 public void onClick(DialogInterface dialog, int which) {
   switch (which) {
     case DialogInterface.BUTTON_POSITIVE:
       timePicker.clearFocus();
       result = timePicker.getCurrentHour() + "-" + timePicker.getCurrentMinute();
       persistString(result);
       callChangeListener(result);
       dialog.dismiss();
       break;
     case DialogInterface.BUTTON_NEGATIVE:
       dialog.dismiss();
       break;
   }
 }
 public boolean onKey(DialogInterface dialoginterface, int i, KeyEvent keyevent) {
   if (i == 82 || i == 4) {
     if (keyevent.getAction() == 0 && keyevent.getRepeatCount() == 0) {
       dialoginterface = mDialog.getWindow();
       if (dialoginterface != null) {
         dialoginterface = dialoginterface.getDecorView();
         if (dialoginterface != null) {
           dialoginterface = dialoginterface.getKeyDispatcherState();
           if (dialoginterface != null) {
             dialoginterface.startTracking(keyevent, this);
             return true;
           }
         }
       }
     } else if (keyevent.getAction() == 1 && !keyevent.isCanceled()) {
       Object obj = mDialog.getWindow();
       if (obj != null) {
         obj = ((Window) (obj)).getDecorView();
         if (obj != null) {
           obj = ((View) (obj)).getKeyDispatcherState();
           if (obj != null
               && ((android.view.KeyEvent.DispatcherState) (obj)).isTracking(keyevent)) {
             mMenu.close(true);
             dialoginterface.dismiss();
             return true;
           }
         }
       }
     }
   }
   return mMenu.performShortcut(i, keyevent, 0);
 }
示例#5
0
 public final void onClick(DialogInterface dialoginterface, int i) {
   dialoginterface.dismiss();
   if (dk.d(a) != null && ei.a()[dk.d(a).getId()] == ei.e) {
     dk.d(a).setSelected(false);
     dk.a(a, -1);
   }
 }
示例#6
0
        @Override
        public void onClick(DialogInterface dialog, int which) {
          switch (which) {
            case DialogInterface.BUTTON_POSITIVE:
              // Yes button clicked
              //	webView.clearView();
              dialog.dismiss();
              finish();
              break;

            case DialogInterface.BUTTON_NEGATIVE:
              // No button clicked
              dialog.dismiss();
              break;
          }
        }
  @Override
  public void onClick(DialogInterface dialog, int which) {
    // checks if this button is the ok button or not
    if (which == -1) {
      // if just ok is pressed then get the selected first value
      Section section = lstSection.get(selectionVal);
      sectionId = String.valueOf(section.getSectionId());
      sectionName = section.getSectionName().toString();

      Prefs.addKey(SettingsActivity.this, Prefs.SECTION_ID, sectionId);
      Prefs.addKey(SettingsActivity.this, Prefs.SECTION_NAME, sectionName);

      txtSectionSelection.setText(mLanguageManager.getSelectedSection() + ": " + sectionName);

      Global.logd(TAG + " section name: " + sectionName);

      txtSectionSelection.setTextColor(getResources().getColor(R.color.black));

      dialog.dismiss();
    } else if (which != -1) {
      isSectionSelectionChanged = true;
      selectionVal = which;
      Section section = lstSection.get(which);
      sectionId = String.valueOf(section.getSectionId());
      sectionName = section.getSectionName().toString();
      Log.i(TAG, "value of sectionId : " + sectionId);

      Prefs.addKey(SettingsActivity.this, Prefs.SECTION_ID, sectionId);
      Prefs.addKey(SettingsActivity.this, Prefs.SECTION_NAME, sectionName);

      refreshData(dialog);
    }
  }
 @Override
 public void onDestroy() {
   super.onDestroy();
   if (mWarnInstallApps != null) {
     mWarnInstallApps.dismiss();
   }
 }
示例#9
0
文件: ao.java 项目: nhnam/ZaloRE
 public void onClick(DialogInterface paramDialogInterface, int paramInt) {
   while (true) {
     try {
       paramDialogInterface.dismiss();
       if (!c.au(true)) break;
       if ((z.a(am.a(this.TS)) instanceof MyInfoActivity)) {
         ((MyInfoActivity) z.a(am.a(this.TS))).oD();
         j localj = new j();
         localj.a(new ap(this, this.TN));
         localj.t(this.TN.ll(), this.TN.lm());
         return;
       }
       if ((z.a(am.a(this.TS)) instanceof UserDetailsActivity)) {
         ((UserDetailsActivity) z.a(am.a(this.TS))).oD();
         continue;
       }
     } catch (Exception localException) {
       localException.printStackTrace();
       return;
     }
     if ((z.c(am.a(this.TS)) != null)
         && (!z.c(am.a(this.TS)).isShowing())
         && (!z.a(am.a(this.TS)).isFinishing())) z.c(am.a(this.TS)).show();
   }
 }
 public void onClick(DialogInterface paramDialogInterface, int paramInt) {
   paramDialogInterface.dismiss();
   a.getAppData().p();
   paramDialogInterface = new el(ActivityLogin.e(a));
   paramDialogInterface.execute(new Object[0]);
   a.showLoadingDialog(paramDialogInterface);
 }
 @Background
 void task(String r, String num, DialogInterface dialog) {
   if (currentAddress == null) {
     return;
   }
   String addressCompl =
       currentAddress.getSubAdminArea() != null
           ? currentAddress.getSubAdminArea()
           : currentAddress.getLocality();
   List<Address> addresses =
       GPSUtils.getFromLocationName(getActivity(), r + ", " + num + " - " + (addressCompl));
   if (addresses.isEmpty()) {
     toast(getString(R.string.address_not_found));
     dialog.dismiss();
   } else {
     final Address address = addresses.get(0);
     street = address.getThoroughfare();
     if (!TextUtils.isEmpty(num) && StringUtils.isNumeric(num.substring(0, 1))) {
       number = num;
     } else {
       number = "";
     }
     updateUiAdapter(address);
   }
 }
 @Background
 void dialogNumberTask(String num1, DialogInterface dialog) {
   List<Address> addresses =
       GPSUtils.getFromLocationName(
           getActivity(),
           street
               + ", "
               + num1
               + " - "
               + (currentAddress.getSubAdminArea() != null
                   ? currentAddress.getSubAdminArea()
                   : currentAddress.getLocality()));
   if (addresses.isEmpty()) {
     toast(getString(R.string.address_not_found));
     dialog.dismiss();
   } else {
     final Address address = addresses.get(0);
     street = address.getThoroughfare();
     if (!num1.isEmpty() && StringUtils.isNumeric(num1.substring(0, 1))) {
       number = num1;
     } else {
       number = "";
     }
     updateUiAdapter(address);
   }
 }
 @Override
 public void onClick(DialogInterface dialog, int which) {
   dialog.dismiss();
   if ((0 > which) || (TextSizeSetting.VALUES.size() <= which)) {
     return;
   }
   textSize(TextSizeSetting.VALUES.get(which));
 }
  /**
   * Given a dialog, this method dismisses it, then it creates a new AsyncDumper and starts
   * executing it passing all the selected items in the given dialog.
   *
   * @param dialog The DialogInterface to dismiss
   */
  private void onConfirm(DialogInterface dialog) {
    dialog.dismiss();

    // If no items selected, no need to continue
    if (selected.isEmpty()) return;

    // TODO: Run a new AsyncDumper
  }
 public void onClick(DialogInterface paramDialogInterface, int paramInt) {
   gh.a(a, paramInt);
   gh.b(a, a.b[gh.a(a)]);
   if (gh.b(a) != null) {
     gh.b(a).a(gh.c(a), a.c[gh.a(a)]);
   }
   paramDialogInterface.dismiss();
 }
示例#16
0
 public void onClick(DialogInterface paramDialogInterface, int paramInt) {
   paramDialogInterface.dismiss();
   if (bd.a(a.b())) {
     ag.a(a, a.getString(2131427727, new Object[] {b}), 1);
     return;
   }
   a.a(a, b, c);
 }
 @Override
 public void onClick(DialogInterface dialog, int which) {
   if (mCallback != null) {
     mNumberPicker.clearFocus();
     mCallback.onNumberSet(mDialogId, mNumberPicker.getValue());
     dialog.dismiss();
   }
 }
 @Override
 public void onClick(DialogInterface dialog, int which) {
   if (which == DialogInterface.BUTTON_POSITIVE) {
     notifyItemsSelected();
   } else {
     notifyDialogCancelled();
   }
   dialog.dismiss();
 }
示例#19
0
 public void onClick(DialogInterface dialoginterface, int i) {
   HashMap hashmap = new HashMap();
   hashmap.put("sourceEvent", a.a);
   c.a("userConfirmed", hashmap, c.d, c.c, c.e, b + 1);
   dialoginterface.dismiss();
   if (o.u(c) != null && c.getCurrentBinding() == 3) {
     o.u(c).start();
   }
 }
 @Override
 public void onClick(DialogInterface dialog, int id) {
   switch (id) {
     case DialogInterface.BUTTON_POSITIVE:
       dialog.dismiss();
       listener.onAccept(this);
       break;
   }
 }
 public void onClick(DialogInterface paramDialogInterface, int paramInt) {
   if (AppRunner.r(c, a) == null) {
     b.setOnDismissListener(null);
     b.dismiss();
     AppRunner.t(c, a).setOnDismissListener(new lm(this));
     return;
   }
   AppRunner.a(c, a, a);
   paramDialogInterface.dismiss();
 }
 @Override
 public void onClick(DialogInterface dialog, int which) {
   dialog.dismiss();
   if (isExistingStopSelected()) {
     addToSelectedCollection(stopId);
   } else {
     createCollection(collectionName.getText(), stopId);
   }
   refreshMainActivity();
 }
示例#23
0
 @Override
 public void onClick(DialogInterface dialog, int which) {
   if (which == -1) {
     if (mAdapter != null) {
       mAdapter.deleteSelectedAlarms();
       mActionMode.finish();
     }
   }
   dialog.dismiss();
   mInDeleteConfirmation = false;
 }
 /**
  * @see android.content.DialogInterface.OnClickListener#onClick(android.content.DialogInterface,
  *     int)
  */
 public void onClick(DialogInterface dialog, int which) {
   switch (which) {
     case DialogInterface.BUTTON_NEGATIVE:
       dialog.dismiss();
       return;
     case DialogInterface.BUTTON_POSITIVE:
       mDb.deleteGoogleSyncResults();
       fillList();
       return;
   }
 }
示例#25
0
 public final void onClick(DialogInterface paramDialogInterface, int paramInt) {
   boolean bool = true;
   if (iDl != null) {
     bool = iDl.i(iDm.getText().toString().trim());
   }
   if (bool) {
     paramDialogInterface.dismiss();
     if ((val$context instanceof MMActivity)) {
       ad.g(new u(this));
     }
   }
 }
  public void refreshData(DialogInterface dialog) {
    txtSectionSelection.setText(
        mLanguageManager.getSelectedSection() + ": " + Prefs.getKey(Prefs.SECTION_NAME));

    WaiterPadApplication.LOG.debug("menu obtained .. ");
    dialog.dismiss();
    Intent intent = new Intent(SettingsActivity.this, TableListActivity.class);
    startActivity(intent);
    // activity out animation
    Global.activityFinishAnimationLeftToRight(SettingsActivity.this);
    finish();
  }
        @Override
        public void onClick(DialogInterface dialog, int which) {
          switch (which) {
            case DialogInterface.BUTTON_POSITIVE:
              dialog.dismiss();
              break;

            case DialogInterface.BUTTON_NEGATIVE:
              startAuthentication();
              break;
          }
        }
  @Override
  public void onClick(DialogInterface dialog, int which) {
    dialog.dismiss();

    if (which == DialogInterface.BUTTON_POSITIVE) {
      if (dFrag instanceof ConfirmDialogFragment) {
        DictionaryFactory.delete(dict);

        fireDictionaryEvent(dict, BaseFragment.EVENT_DELETED);
      }
    }
  }
示例#29
0
 public void onClick(DialogInterface dialog, int which) {
   if (which == AlertDialog.BUTTON_POSITIVE) {
     ((ApplicationEx) getContext().getApplicationContext())
         .getCatalogStorage()
         .requestTask(DownloadIconsTask.getInstance());
   }
   if (which == AlertDialog.BUTTON_NEGATIVE) {
     if (mChangeSettingsEnabled) {
       GlobalSettings.setCountryIconsEnabled(getContext(), false);
     }
     dialog.dismiss();
   }
 }
 public void handleMessage(Message paramMessage) {
   switch (what) {
     case 0:
     default:
       return;
     case -3:
     case -2:
     case -1:
       ((DialogInterface.OnClickListener) obj).onClick((DialogInterface) mDialog.get(), what);
       return;
   }
   ((DialogInterface) obj).dismiss();
 }