Android: ProgressWheel or implement another Progress

1

I try to implement a ProgressWheel but not that it is staying, I hope and you can help me.

  

MainActivity.java

else {
                progressWheel.setProgress(0.0f);

                progressWheel.setCallback(new ProgressWheel.ProgressCallback() {
                    @Override
                    public void onProgressUpdate(float progress) {
                        if(progress == 0) {
                            progressWheel.setProgress(1.0f);
                        } else if(progress == 1.0f) {
                            progressWheel.setProgress(0.0f);
                        }
                        interpolatedValue.setText(String.format("%.2f", progress));
                    }
                });
                if (txtCode.getText().toString().trim().matches("[0-9]*")){//compruebo que los datos que se ingresaron son numeros
                    int inputData = Integer.parseInt(txtCode.getText().toString());//convierto lo que en el editText a int

                    int parameters[] = {inputData};
                    CheckIn checkIn = null;//hago una instancia de DataCheckIn y la guado en una variable
                    try {
                        checkIn = new SearchData().execute(parameters).get();//le paso el folio como parametro a SearchData
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    } catch (ExecutionException e) {
                        e.printStackTrace();
                    }
                        if (checkIn != null && checkIn.getFolio() == inputData){
                            Intent intentIndex = new Intent(MainActivity.this, IndexActivity.class);//Creo un intent
                            startActivity(intentIndex);//inicio la actividad
                            finish();//se destruye la actividad
                        } else {
                            alertDialogBuilder.setTitle("ERROR..").setMessage("El codigo no se encontro").setCancelable(false).setPositiveButton("ACEPTAR", null).show(); //mensaje si no existe el checkin
                            txtCode.setText("");
                        } //./else
                } else {
                    alertDialogBuilder.setTitle("ERROR..").setMessage("El codigo no se encontro").setCancelable(false).setPositiveButton("ACEPTAR", null).show(); //mensaje si no existe el checkin
                    txtCode.setText("");
                } //./else
            } //./else*/
  

activity_main.xml

<com.pnikosis.materialishprogress.ProgressWheel
            android:id="@+id/progress_wheel"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_centerHorizontal="true"
            wheel:matProg_barColor="#5588FF"
            wheel:matProg_progressIndeterminate="true" />

The library you use is: Material-ish Progress

    
asked by Javier fr 14.12.2016 в 00:51
source

1 answer

0

For ProgressWheel

    <com.pnikosis.materialishprogress.ProgressWheel
        android:id="@+id/progress_wheel"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_below="@id/spinners"
        android:layout_centerHorizontal="true"
        wheel:matProg_barColor="#5588FF"
        wheel:matProg_progressIndeterminate="true" />

you do not need a callback!

Comment this part:

/* progressWheel.setProgress(0.0f);

                progressWheel.setCallback(new ProgressWheel.ProgressCallback() {
                    @Override
                    public void onProgressUpdate(float progress) {
                        if(progress == 0) {
                            progressWheel.setProgress(1.0f);
                        } else if(progress == 1.0f) {
                            progressWheel.setProgress(0.0f);
                        }
                        interpolatedValue.setText(String.format("%.2f", progress));
                    }
                }); */
    
answered by 14.12.2016 в 02:11