Search in sources :

Example 71 with ProgressBar

use of android.widget.ProgressBar in project android-app by spark.

the class Pin method reset.

public void reset() {
    if (analogReadView != null) {
        analogReadView.setVisibility(View.GONE);
        // Reset the values
        ProgressBar barGraph = Ui.findView(analogReadView, R.id.tinker_analog_read_progress);
        TextView readValue = Ui.findView(analogReadView, R.id.tinker_analog_read_value);
        barGraph.setMax(100);
        barGraph.setProgress(0);
        readValue.setText("0");
        analogReadView = null;
    }
    if (analogWriteView != null) {
        // Reset the values
        analogWriteView.setVisibility(View.GONE);
        final SeekBar seekBar = Ui.findView(analogWriteView, R.id.tinker_analog_write_seekbar);
        final TextView value = Ui.findView(analogWriteView, R.id.tinker_analog_write_value);
        seekBar.setProgress(0);
        value.setText("0");
        analogWriteView = null;
    }
    if (digitalWriteView != null) {
        digitalWriteView.setVisibility(View.GONE);
        digitalWriteView = null;
    }
    if (digitalReadView != null) {
        digitalReadView.setVisibility(View.GONE);
        digitalReadView = null;
    }
    if (!stopAnimating()) {
        ((View) view.getParent()).setBackgroundColor(0);
    }
    muted = false;
    analogValue = 0;
    digitalValue = DigitalValue.NONE;
}
Also used : SeekBar(android.widget.SeekBar) TextView(android.widget.TextView) ProgressBar(android.widget.ProgressBar) TextView(android.widget.TextView) View(android.view.View)

Example 72 with ProgressBar

use of android.widget.ProgressBar in project android-app by spark.

the class Pin method doShowAnalogValue.

private void doShowAnalogValue(int newValue) {
    if (analogWriteView != null) {
        analogWriteView.setVisibility(View.GONE);
        analogWriteView = null;
    }
    ViewGroup parent = (ViewGroup) view.getParent();
    if (pinBackgroundAnim != null) {
        pinBackgroundAnim.cancel();
    }
    if (analogReadView == null) {
        analogReadView = Ui.findView(parent, R.id.tinker_analog_read_main);
    }
    // If the view does not exist, inflate it
    if (analogReadView == null) {
        LayoutInflater inflater = (LayoutInflater) view.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        if (pinType == PinType.A) {
            analogReadView = inflater.inflate(R.layout.tinker_analog_read_left, parent, false);
            parent.addView(analogReadView);
        } else if (pinType == PinType.D) {
            analogReadView = inflater.inflate(R.layout.tinker_analog_read_right, parent, false);
            parent.addView(analogReadView, 0);
        }
    }
    analogReadView.setVisibility(View.VISIBLE);
    // Find the existing views and set the values
    ProgressBar barGraph = Ui.findView(analogReadView, R.id.tinker_analog_read_progress);
    TextView readValue = Ui.findView(analogReadView, R.id.tinker_analog_read_value);
    if (PinAction.ANALOG_READ.equals(configuredAction)) {
        barGraph.setProgressDrawable(view.getContext().getResources().getDrawable(R.drawable.progress_emerald));
    } else {
        barGraph.setProgressDrawable(view.getContext().getResources().getDrawable(R.drawable.progress_sunflower));
    }
    int max = 1;
    if (configuredAction == PinAction.ANALOG_READ) {
        max = ANALOG_READ_MAX;
    } else if (configuredAction == PinAction.ANALOG_WRITE) {
        max = ANALOG_WRITE_MAX;
    }
    barGraph.setMax(max);
    barGraph.setProgress(newValue);
    readValue.setText(String.valueOf(newValue));
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ProgressBar(android.widget.ProgressBar)

Example 73 with ProgressBar

use of android.widget.ProgressBar in project aplicativo by InCasa.

the class ServerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_server);
    final EditText ip_server = (EditText) findViewById(R.id.ip_server);
    final ProgressBar bar = (ProgressBar) findViewById(R.id.progressBar);
    Button btnOK = (Button) findViewById(R.id.btn_ok);
    if (getServer() != " ") {
        ip_server.setText(getServer());
    }
    btnOK.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            bar.setProgress(20);
            String ip = ip_server.getText().toString();
            if (TextUtils.isEmpty(ip)) {
                bar.setProgress(0);
            } else {
                testeServer(ip);
            }
        }
    });
}
Also used : EditText(android.widget.EditText) Button(android.widget.Button) ProgressBar(android.widget.ProgressBar) TextView(android.widget.TextView) View(android.view.View)

Example 74 with ProgressBar

use of android.widget.ProgressBar in project SeeSik by GHHM.

the class DailyEvaluation method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    res = getResources();
    context = getActivity().getApplicationContext();
    growAnim = AnimationUtils.loadAnimation(context, R.anim.grow);
    recommendText = (TextView) view.findViewById(R.id.recommendText);
    db = MainActivity.getDBInstance();
    double na, chol, fat, sugar;
    na = db.getNa();
    chol = db.getChol();
    fat = db.getFat();
    sugar = db.getSugar();
    recommendText.setText("Na: " + (int) na + "/2000(mg)\nchol: " + (int) chol + "/600(mg)\nfat: " + (int) fat + "/15(g)\nsugar: " + (int) sugar + " /50(g)");
    ProgressBar naBar = (ProgressBar) view.findViewById(R.id.naBar);
    naBar.setIndeterminate(false);
    naBar.setProgress((int) na);
    naBar.setAnimation(growAnim);
    ProgressBar cholBar = (ProgressBar) view.findViewById(R.id.cholBar);
    cholBar.setIndeterminate(false);
    cholBar.setProgress((int) chol);
    cholBar.setAnimation(growAnim);
    ProgressBar fatBar = (ProgressBar) view.findViewById(R.id.fatBar);
    fatBar.setIndeterminate(false);
    fatBar.setProgress((int) fat);
    fatBar.setAnimation(growAnim);
    ProgressBar sugarBar = (ProgressBar) view.findViewById(R.id.sugarBar);
    sugarBar.setIndeterminate(false);
    sugarBar.setProgress((int) sugar);
    sugarBar.setAnimation(growAnim);
}
Also used : ProgressBar(android.widget.ProgressBar)

Example 75 with ProgressBar

use of android.widget.ProgressBar in project LoadingBar by dengyuhan.

the class ProgressbarHorizontalFactory method onCreateView.

@Override
public View onCreateView(ViewGroup parent) {
    View loadingView = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_progressbar_horizontal, parent, false);
    ProgressBar pb = (ProgressBar) loadingView.findViewById(R.id.pb);
    //模拟一下
    ObjectAnimator.ofInt(pb, "progress", 0, 100).setDuration(duration).start();
    return loadingView;
}
Also used : View(android.view.View) ProgressBar(android.widget.ProgressBar)

Aggregations

ProgressBar (android.widget.ProgressBar)193 TextView (android.widget.TextView)66 View (android.view.View)63 ImageView (android.widget.ImageView)41 LinearLayout (android.widget.LinearLayout)30 Context (android.content.Context)18 ViewGroup (android.view.ViewGroup)16 WindowManager (android.view.WindowManager)14 FrameLayout (android.widget.FrameLayout)14 Drawable (android.graphics.drawable.Drawable)13 Dialog (android.app.Dialog)12 Button (android.widget.Button)12 RelativeLayout (android.widget.RelativeLayout)12 LayoutInflater (android.view.LayoutInflater)11 SuppressLint (android.annotation.SuppressLint)10 LayoutParams (android.widget.LinearLayout.LayoutParams)9 Intent (android.content.Intent)8 LayoutParams (android.view.ViewGroup.LayoutParams)8 AlertDialog (android.app.AlertDialog)7 TypedArray (android.content.res.TypedArray)7