@Override
  public void onPause() {
    super.onPause();

    mHandler.removeCallbacksAndMessages(null);
    pv_circular_determinate_in_out.setVisibility(View.GONE);
  }
  @Override
  public boolean handleMessage(Message msg) {
    switch (msg.what) {
      case MSG_START_PROGRESS:
        pv_circular.start();
        pv_circular_colors.start();
        pv_circular_inout.start();
        pv_circular_inout_colors.start();
        pv_circular_determinate_in_out.setProgress(0f);
        pv_circular_determinate_in_out.start();
        pv_circular_determinate.setProgress(0f);
        pv_circular_determinate.start();
        pv_linear.start();
        pv_linear_colors.start();
        pv_linear_determinate.setProgress(0f);
        pv_linear_determinate.start();
        pv_linear_query.setProgress(0f);
        pv_linear_query.start();
        pv_linear_buffer.setProgress(0f);
        pv_linear_buffer.setSecondaryProgress(0f);
        pv_linear_buffer.start();
        mHandler.sendEmptyMessageDelayed(MSG_STOP_PROGRESS, PROGRESS_INTERVAL);
        mHandler.sendEmptyMessageDelayed(MSG_UPDATE_PROGRESS, PROGRESS_UPDATE_INTERVAL);
        mHandler.sendEmptyMessageDelayed(MSG_UPDATE_QUERY_PROGRESS, START_QUERY_DELAY);
        mHandler.sendEmptyMessageDelayed(
            MSG_UPDATE_BUFFER_PROGRESS, BUFFER_PROGRESS_UPDATE_INTERVAL);
        break;
      case MSG_UPDATE_QUERY_PROGRESS:
        pv_linear_query.setProgress(pv_linear_query.getProgress() + 0.01f);

        if (pv_linear_query.getProgress() < 1f)
          mHandler.sendEmptyMessageDelayed(
              MSG_UPDATE_QUERY_PROGRESS, QUERY_PROGRESS_UPDATE_INTERVAL);
        else pv_linear_query.stop();
        break;
      case MSG_UPDATE_BUFFER_PROGRESS:
        pv_linear_buffer.setSecondaryProgress(pv_linear_buffer.getSecondaryProgress() + 0.01f);

        if (pv_linear_buffer.getSecondaryProgress() < 1f)
          mHandler.sendEmptyMessageDelayed(
              MSG_UPDATE_BUFFER_PROGRESS, BUFFER_PROGRESS_UPDATE_INTERVAL);
        break;
      case MSG_UPDATE_PROGRESS:
        pv_circular_determinate_in_out.setProgress(
            pv_circular_determinate_in_out.getProgress() + 0.01f);
        pv_circular_determinate.setProgress(pv_circular_determinate.getProgress() + 0.01f);

        pv_linear_determinate.setProgress(pv_linear_determinate.getProgress() + 0.01f);
        pv_linear_buffer.setProgress(pv_linear_buffer.getProgress() + 0.01f);
        if (pv_circular_determinate_in_out.getProgress() < 1f)
          mHandler.sendEmptyMessageDelayed(MSG_UPDATE_PROGRESS, PROGRESS_UPDATE_INTERVAL);
        else {
          pv_circular_determinate_in_out.stop();
          pv_circular_determinate.stop();
          pv_linear_determinate.stop();
          pv_linear_buffer.stop();
        }
        break;
      case MSG_STOP_PROGRESS:
        pv_circular.stop();
        pv_circular_colors.stop();
        pv_circular_inout.stop();
        pv_circular_inout_colors.stop();
        pv_linear.stop();
        pv_linear_colors.stop();
        mHandler.sendEmptyMessageDelayed(MSG_START_PROGRESS, START_DELAY);
        break;
    }
    return false;
  }