Exemplo n.º 1
0
  public boolean onPause() {
    Log.d(FileUtil.TAG, "onPause");
    final Context context = getContext();
    boolean ret = false;

    for (BaseGraphView view : ViewUtil.views()) {
      if (view.getView().getContext() == context) {
        ret = view.onPause() || ret;
      }
    }
    return ret;
  }
Exemplo n.º 2
0
  public void close(Bitmap snapshot, final IGraphView.OnViewDetachedListener listener) {
    if (mView != null && mView.getView() != null) {
      final ViewGroup layout = (ViewGroup) mView.getView().getParent();
      final ImageView imageView = getImageViewForSurface();

      if (imageView != null) {
        imageView.setImageBitmap(snapshot);
        imageView.setVisibility(View.VISIBLE);
        layout.bringChildToFront(imageView);

        // remove SurfaceView delayed
        mView
            .getView()
            .post(
                new Runnable() {
                  @Override
                  public void run() {
                    mView.getView().removeCallbacks(this);
                    mView.onPause();
                    mView.stop(listener);
                    layout.removeAllViews();
                    mView = null;
                  }
                });
      } else {
        mView.onPause();
        mView.stop(listener);
        if (layout != null) {
          layout.removeAllViews();
        } else {
          mView.tearDown();
        }
        mView = null;
      }
    }
  }