Search in sources :

Example 1 with ProgressBarCircularIndeterminate

use of com.gc.materialdesign.views.ProgressBarCircularIndeterminate in project MaterialDesignLibrary by navasmdc.

the class ProgressDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.progress_dialog);
    view = (RelativeLayout) findViewById(R.id.contentDialog);
    backView = (RelativeLayout) findViewById(R.id.dialog_rootView);
    backView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getX() < view.getLeft() || event.getX() > view.getRight() || event.getY() > view.getBottom() || event.getY() < view.getTop()) {
                dismiss();
            }
            return false;
        }
    });
    this.titleTextView = (TextView) findViewById(R.id.title);
    setTitle(title);
    if (progressColor != -1) {
        ProgressBarCircularIndeterminate progressBarCircularIndeterminate = (ProgressBarCircularIndeterminate) findViewById(R.id.progressBarCircularIndetermininate);
        progressBarCircularIndeterminate.setBackgroundColor(progressColor);
    }
}
Also used : OnTouchListener(android.view.View.OnTouchListener) ProgressBarCircularIndeterminate(com.gc.materialdesign.views.ProgressBarCircularIndeterminate) TextView(android.widget.TextView) View(android.view.View) MotionEvent(android.view.MotionEvent)

Aggregations

MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 OnTouchListener (android.view.View.OnTouchListener)1 TextView (android.widget.TextView)1 ProgressBarCircularIndeterminate (com.gc.materialdesign.views.ProgressBarCircularIndeterminate)1