Esempio n. 1
0
 @Override
 protected void onPostExecute(Boolean result) {
   super.onPostExecute(result);
   materialDialog.dismiss();
   myRecycerAdapter = new ScoreAdapter(scoreList);
   recyclerView.setAdapter(myRecycerAdapter);
 }
 public void showCityDialog(int laseRegionCode) {
   RegionView view =
       new RegionView(
           this,
           region -> {
             getPresenter().finishAddCity(region);
             dialog.dismiss();
           },
           laseRegionCode);
   dialog = new MaterialDialog.Builder(this).title("选择感兴趣的地区").customView(view, false).show();
 }
Esempio n. 3
0
  @Override
  public void connect(String address) {

    if (dialog != null && dialog.isShowing()) {
      dialog.dismiss();
    }

    currentBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    if (currentBluetoothAdapter == null) {
      DisplayUtilities.ShowLargeMessage(
          this.context.getString(R.string.bluetooth_not_supported), "", view, true, null);
      return;
    }

    if (currentBluetoothAdapter.isEnabled()) {
      createConnection(address);
    } else {
      DisplayUtilities.ShowLargeMessage(
          this.context.getString(R.string.bluetooth_cant_connect), "", view, false, null);
    }
  }
Esempio n. 4
0
        public void onReceive(Context context, Intent intent) {

          String action = intent.getAction();

          if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
            if (dialog != null) {
              dialog.dismiss();
            }
          } else if (BluetoothDevice.ACTION_FOUND.equals(action)) {

            BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
            devices.add(device);

            String discoveryName = device.getName();
            /* if (discoveryNameService != null)
            {
                discoveryName = discoveryNameService.foundDevice(device.getAddress(), device.getName());
            }*/
            BTArrayAdapter.add(discoveryName + "\n" + device.getAddress());
            BTArrayAdapter.notifyDataSetChanged();
          }
        }
Esempio n. 5
0
 public static void HideProgress() {
   if (pd != null) {
     pd.dismiss();
   }
 }
Esempio n. 6
0
 @Override
 public void hideProgress() {
   if (progressDialog != null && progressDialog.isShowing() && !isFinishing()) {
     progressDialog.dismiss();
   }
 }
 @Override
 public void onActivityDestroy() {
   super.onActivityDestroy();
   if (mDialog != null && mDialog.isShowing()) mDialog.dismiss();
 }
Esempio n. 8
0
 @Override
 public void onRequestSuccess(Response response) {
   super.onRequestSuccess(response);
   dialog.dismiss();
   clean();
 }
Esempio n. 9
0
 @Override
 public void onRequestFailure(SpiceException spiceException) {
   super.onRequestFailure(spiceException);
   dialog.dismiss();
   clean();
 }