Exemplo n.º 1
0
 public static void cancelProgressDialog() {
   if (_progressDialog != null) {
     _progressDialog.hide();
     _progressDialog.dismiss();
     _progressDialog = null;
   }
 }
Exemplo n.º 2
0
  @Override
  protected void onPostExecute(String result) {
    //		Log.d(TAG,"url: " + s_url);
    //		Log.d(TAG,"Result: " + result);

    // Close Loading bar
    s_progressBar.hide();

    // Handle output of each post request
    if (result.equals("403")) {
      Toast.makeText(s_activity, "Please remove proxy for web.iiit.ac.in", Toast.LENGTH_SHORT)
          .show();
    } else if (result.equals("Incorrect Credentials")) {
      Toast.makeText(s_activity, "Incorrect Credentials", Toast.LENGTH_SHORT).show();
    } else if (result.indexOf("error") < 0) {
      if (s_sharedPref.contains(SHARED_PREF_USER_BILL) == false) {
        new GETBillInfo(s_activity, "").execute();
      }
      new GETMessRegistration(
              s_activity,
              url_mess_registration
                  + "&user="******"")),
              "Fetching Mess Registration...")
          .execute();
    }
    // Connection broken
    else {
      Toast.makeText(s_activity, connectionError, Toast.LENGTH_SHORT).show();
    }
    super.onPostExecute(result);
  }
Exemplo n.º 3
0
  @Override
  public void onBindViewHolder(final ViewHolder viewHolder, final int i) {

    if (mItems.get(i).isMe()) {
      viewHolder.exchange.setVisibility(View.VISIBLE);

    } else {
      viewHolder.exchange.setVisibility(View.GONE);
    }

    imageLoader.DisplayImage(mItems.get(i).getUrl(), viewHolder.imgThumbnail);
    viewHolder.name.setText(mItems.get(i).getUsername());
    viewHolder.points.setText(mItems.get(i).getpLead() + "");
    viewHolder.rank.setText((i + 1) + "");

    /* Picasso.with(context)
    .load(mItems.get(i).getimageurl())
    .placeholder(R.drawable.ic_collections_white_18dp) // optional
    .error(R.drawable.ic_error_white_18dp)
    .into(viewHolder.imgThumbnail);*/

    viewHolder.exchange.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {}
        });

    mProgressDialog.hide();
  }
Exemplo n.º 4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_registration);

    TextView titleFont = (TextView) findViewById(R.id.seatSuite);
    Typeface signPainter = Typeface.createFromAsset(getAssets(), "SignPainter-HouseScript.ttf");
    titleFont.setTypeface(signPainter);

    mProgressDialog = new ProgressDialog(this);
    mProgressDialog.setTitle("Creating");
    mProgressDialog.setMessage("Adding new user to database...");
    mProgressDialog.setCancelable(false);
    mProgressDialog.show();
    mProgressDialog.hide();

    Button nextButt = (Button) findViewById(R.id.next);

    nextButt.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            register();
          }
        });
  }
    protected void onPostExecute(final String response) {

      // jsonparse(response);and
      /*
       * Data currrentData = (Data)dataList.get(0);
       *
       * Toast.makeText(MainActivity.this, currrentData.email,
       * Toast.LENGTH_SHORT).show();
       */
      dialog.hide();
      asdasddass.this.responsed = response;
      try {
        asdasddass.this.processResult();
        System.out.println(" " + a[0] + " " + a[1] + " " + a[2]);
        exampleSeries.resetData(
            new GraphViewData[] {
              new GraphViewData(1, a[0]),
              new GraphViewData(2, a[1]),
              new GraphViewData(3, a[2]) // another frequency
            });
      } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
Exemplo n.º 6
0
  // When the GPS status changes
  public void onGpsStatusChanged(int event) {
    switch (event) {
      case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
        // If there's a previous location
        // and the time is outside of the timeout period
        if (!blockMessageShown
            && evade.locMan.lastLoc != null
            && SystemClock.elapsedRealtime() - evade.locMan.lastLocTime > TIMEOUT_DELAY) {
          // If the time is outside of the timeout period
          Toast.makeText(evade, "The aliens are blocking your transmissions.", Toast.LENGTH_SHORT)
              .show();
          evade.timer.cancel();
          blockMessageShown = true;
        }

        // If there's no previous location
        else if (evade.locMan.lastLoc == null) {
          // If we're within the acceptable wait range
          if (SystemClock.elapsedRealtime() - beginCheckTime < TIMEOUT_DELAY) {
            System.out.println("Waiting for a GPS fix");
          }
          // Otherwise, we need to timeout
          else {
            GPSTimeout();
            timeout = true;
          }
        }
        break;

      case GpsStatus.GPS_EVENT_FIRST_FIX:
        pro.hide();
        break;
    }
  }
Exemplo n.º 7
0
 protected void onPostExecute(String result) {
   super.onPostExecute(result);
   pd.hide();
   pd.dismiss();
   adapter = new CommNewsAdapter(CommunityNew.this, Memberslist);
   Members.setAdapter(adapter);
   getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
 }
Exemplo n.º 8
0
 @Override
 protected void onPostExecute(String result) {
   super.onPostExecute(result);
   progressDialog.hide();
   if (result != null) {
     drawPath(result);
   }
 }
Exemplo n.º 9
0
 @Override
 public void run() {
   progressDialog.hide();
   AlertDialog.Builder builder = new AlertDialog.Builder(CellDroidActivity.this);
   builder.setTitle("Bluetooth Failure");
   builder.setMessage(getResources().getString(R.string.bt_connection_fail_msg));
   builder.setPositiveButton("Ok", null);
   builder.create().show();
 }
        // @Override
        public void handleMessage(Message msg) {
          if (msg.what == 1) {
            _progressDlg.hide();

            getNumPuzzles();
            if (_seekBar != null) {
              _seekBar.setMax(_num);
            }

            play();
          } else if (msg.what == 2) {
            _progressDlg.setMessage(
                _parent.getString(R.string.msg_progress)
                    + String.format(" %d", (_cnt * 100) / _num)
                    + " %");
          } else if (msg.what == 3) {
            _progressDlg.hide();
            _tvPuzzleText.setText("An error occured during install");
          }
        }
Exemplo n.º 11
0
 // POST-EJECUCIÓN: Recoge lo que devuelve "doInBackground" y actua en funcion del resultado
 protected void onPostExecute(String result) {
   // Si el login es correcto, "result" sera "OK" y pasara a la siguiente activity
   if (result.equals("OK")) {
     // Avanzamos al main
     Intent nuevaActividad;
     nuevaActividad = new Intent(LoginActivity.this, MainActivity.class);
     startActivity(nuevaActividad);
   } else {
     err_login();
   } // En caso contrario sacara un error por pantalla
   pDialog.hide();
 }
Exemplo n.º 12
0
  @Override
  public void onDestroyView() {
    if (mProgressDialog != null) {
      mProgressDialog.hide();
      mProgressDialog = null;
    }

    if (mCurrentTask != null) {
      mCurrentTask.cancel(true);
    }
    mCurrentTask = null;
    super.onDestroyView();
  }
Exemplo n.º 13
0
  @Override
  protected void onPostExecute(Boolean result) {
    dialog.hide();
    dialog.dismiss();

    if (result) {
      fragment.setDBChange(true);
      NinjaToast.show(
          context, context.getString(R.string.toast_export_whitelist_successful) + path);
    } else {
      NinjaToast.show(context, R.string.toast_export_whitelist_failed);
    }
  }
Exemplo n.º 14
0
 /** Hides the progress dialog if it is shown. */
 void hideProgressDialogFragment() {
   mWaiting.set(false);
   if (mWaitDialog == null) {
     return;
   }
   // dismiss if finishing
   try {
     if (isFinishing()) mWaitDialog.dismiss();
     else mWaitDialog.hide();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  @Override
  protected void onPostExecute(LinkedList<VisitCard> visitCards) {
    super.onPostExecute(visitCards);
    if (!empty) {
      if (visitCards.size() > 0) {
        empNotification.setVisibility(View.GONE);
      }
      RowViewAdapter rowViewAdapter = new RowViewAdapter(context, visitCards);
      listView.setAdapter(rowViewAdapter);
      Intent changeToDetails = new Intent(context, DetailsActivity.class);
      listView.setOnItemClickListener(new ContactOnClickListener(changeToDetails, rowViewAdapter));
      listView.setOnItemLongClickListener(new ContactOnLongClickListener(rowViewAdapter, context));
      rowViewAdapter.notifyDataSetChanged();

      progressDialog.hide();
    } else {
      Intent insertSelfData = new Intent(context, InsertUserManually.class);
      insertSelfData.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      insertSelfData.putExtra("self", VisitCard.SELF);
      context.startActivity(insertSelfData);
      progressDialog.hide();
    }
  }
    @Override
    public void onTaskComplete(ApiBase result) {
      ApiBase response;
      try {
        response = (ApiBase) ApiResponseUtil.parseResponse(result, ApiBase.class);
        if (response != null) {
          dialog.hide();
        }
      } catch (ApiException e) {
        return;
      }

      Log.i("Cat", "toot success, smells bad");
    }
 @Override
 public void onSuccess(Venue venue, int id) {
   progressDlg.show();
   switch (id) {
     case R.id.btn_checkin:
       getApiClient().addCheckIn(venue.getId(), checkInCallbackcallback);
       break;
     case R.id.btn_mute:
       venue.setMuted(Venue.FLAG_MUTED);
       getDbManager().setMuted(venue);
       adapter.notifyDataSetChanged();
       progressDlg.hide();
       break;
   }
 }
Exemplo n.º 18
0
  public void comments_enter(View view) {
    progressDialog.setMessage("Please hold on");
    progressDialog.show();
    final TextView comments = (TextView) findViewById(R.id.devo_comments);
    comments1 = comments.getText().toString();
    final String devo_id = Devotional.devotional_id;

    if (comments1.equals("") || comments1.length() < 4) {
      progressDialog.hide();
      Toast.makeText(this, "Please enter a valid comment", Toast.LENGTH_LONG).show();
    } else {
      connectUrl = "http://www.samuelagbede.com/coza_social/insert_devotional_comments.php";

      StringRequest jor =
          new StringRequest(
              Request.Method.POST,
              connectUrl,
              new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                  Log.d("Comments Inserted", response);
                  progressDialog.hide();
                  Toast.makeText(Featured.this, "Comments entered successfully", Toast.LENGTH_LONG)
                      .show();
                  comments.setText(" ");
                }
              },
              new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                  Log.d("Error", error.toString());
                }
              }) {

            @Override
            protected Map<String, String> getParams() {
              Map<String, String> params = new HashMap<String, String>();
              params.put("username", username1);
              params.put("comments", comments1);
              params.put("email_add", email_address1);
              params.put("devotional", devo_id);

              return params;
            }
          };
      Singleton.getInstance(this).addToRequestQueue(jor);
    }
  }
 @Override
 public void onTaskComplete(ApiBase result) {
   dialog.hide();
   User response;
   try {
     response = (User) ApiResponseUtil.parseResponse(result, User.class);
     if (response != null) {
       Toast.makeText(context, R.string.remove_success, Toast.LENGTH_SHORT).show();
       Intent intent = new Intent(context, MainActivity.class);
       intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
       context.startActivity(intent);
     }
   } catch (ApiException e) {
     return;
   }
 }
Exemplo n.º 20
0
 private void showDialog(String message, boolean error) {
   mProgressDialog.hide();
   if (error) {
     new AlertDialog.Builder(this)
         .setTitle("Error")
         .setMessage(message)
         .setPositiveButton(android.R.string.ok, null)
         .show();
   } else {
     new AlertDialog.Builder(this)
         .setTitle("Success")
         .setMessage(message)
         .setPositiveButton(
             android.R.string.ok,
             new DialogInterface.OnClickListener() {
               @Override
               public void onClick(DialogInterface dialog, int which) {
                 returnToPrevious();
               }
             })
         .show();
   }
 }
Exemplo n.º 21
0
  // Handle GPS Timeout
  public void GPSTimeout() {
    // pro.setMessage("Acquiring position from Network");
    System.out.println("GPS timed out");
    pro.hide();
    evade.locMan.stopLocationUpdating();

    // Ask for another attempt
    new AlertDialog.Builder(evade)
        .setTitle("Trouble Finding Location")
        .setMessage("The government agents can't locate you right now.\nTry again?")
        .setCancelable(true)
        .setPositiveButton(
            "Yes",
            new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int id) {
                // Start checking again
                checkForGPS();
                // Makes it so timeout will occur again if necessary
                timeout = false;
                dialog.dismiss();
              }
            })
        .setNegativeButton(
            "No",
            new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                Toast.makeText(
                        evade,
                        "Retry by returning to the main menu and relaunching Trickiest Part.",
                        Toast.LENGTH_LONG)
                    .show();
                dialog.dismiss();
              }
            })
        .show();
  }
Exemplo n.º 22
0
 public void hideProgressDownload() {
   if (downloadCurrentState != null) downloadCurrentState.hide();
 }
Exemplo n.º 23
0
 private void hidePdialog() {
   if (pDialog.isShowing()) pDialog.hide();
   pDialog.dismiss();
 }
  private void placeOrder() {
    EditText[] entries =
        new EditText[] {
          phoneNumberField,
          address1Field,
          address2Field,
          cityField,
          stateField,
          zipCodeField,
          countryField
        };
    for (EditText entry : entries) {
      entry.setEnabled(false);
    }

    user.setFirstName(firstNameField.getText().toString());
    user.setLastName(lastNameField.getText().toString());
    user.setPhone(phoneNumberField.getText().toString());
    user.setAddress1(address1Field.getText().toString());
    user.setAddress2(address2Field.getText().toString());
    user.setCity(cityField.getText().toString());
    user.setState(stateField.getText().toString());
    user.setZipCode(zipCodeField.getText().toString());
    Country selectedCountry = Countries.getCountryForName(countryField.getText().toString());
    if (selectedCountry != null) {
      user.setCountry(selectedCountry.getCode());
    }

    ProgressDialog progressDialog =
        ProgressDialog.show(getActivity(), "Please wait...", "Placing Order", true);

    RoboVMWebService.getInstance()
        .placeOrder(
            user,
            (response) -> {
              progressDialog.hide();
              progressDialog.dismiss();
              for (EditText entry : entries) {
                entry.setEnabled(true);
              }

              if (response.isSuccess()) {
                RoboVMWebService.getInstance().getBasket().clear();

                Toast.makeText(getActivity(), "Your order has been placed!", Toast.LENGTH_LONG)
                    .show();

                if (orderPlacedListener != null) {
                  orderPlacedListener.run();
                }
              } else {
                List<ValidationError> errors = response.getErrors();
                String alertMessage = "An unexpected error occurred! Please try again later!";

                if (errors != null) { // We handle only the first error.
                  ValidationError error = errors.get(0);

                  String message = error.getMessage();
                  String field = error.getField();
                  if (field == null) {
                    alertMessage = message;
                  } else {
                    switch (field) {
                      case "firstName":
                        alertMessage = "First name is required";
                        break;
                      case "lastName":
                        alertMessage = "Last name is required";
                        break;
                      case "address1":
                        alertMessage = "Address is required";
                        break;
                      case "city":
                        alertMessage = "City is required";
                        break;
                      case "zipCode":
                        alertMessage = "ZIP code is required";
                        break;
                      case "phone":
                        alertMessage = "Phone number is required";
                        break;
                      case "country":
                        alertMessage = "Country is required";
                        break;
                      default:
                        alertMessage = message;
                        break;
                    }
                  }
                }
                Toast.makeText(getActivity(), alertMessage, Toast.LENGTH_LONG).show();
              }
            });
  }
Exemplo n.º 25
0
 public void onLoginFailed(ProgressDialog progressDialog) {
   Toast.makeText(getBaseContext(), "Login failed", Toast.LENGTH_LONG).show();
   _loginButton.setEnabled(true);
   progressDialog.hide();
   return;
 }
Exemplo n.º 26
0
 public void run() {
   progressDialog.hide();
   connectButton.setEnabled(false);
   disconnectButton.setEnabled(true);
 }
 private void hideProgressDialog() {
   if (mProgressDialog != null && mProgressDialog.isShowing()) {
     mProgressDialog.hide();
   }
 }
Exemplo n.º 28
0
 public void hideProgress() {
   if (progressCurrentState != null) progressCurrentState.hide();
 }
Exemplo n.º 29
0
 private void hidepDialog() {
   // if (pDialog.isShowing())
   pDialog.hide();
 }
Exemplo n.º 30
0
 public void hide() {
   if (progressCurrentState != null) progressCurrentState.hide();
   if (toastCurrentState != null) toastCurrentState.cancel();
 }