public void onDestroy() { final Context context = getContext(); for (BaseGraphView view : ViewUtil.views()) { if (view.getView().getContext() == context) { view.stop(null); } } }
public boolean onResume() { final Context context = getContext(); boolean ret = false; for (BaseGraphView view : ViewUtil.views()) { if (view.getView().getContext() == context) { ret = view.onResume() || ret; } } return ret; }
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; }
public ImageView getImageViewForSurface() { if (mView == null || mView.getView() == null) { return null; } final ViewGroup layout = (ViewGroup) mView.getView().getParent(); if (layout != null) { for (int i = layout.getChildCount() - 1; i >= 0; i--) { final View lastView = layout.getChildAt(i); if (lastView.getClass() == ImageView.class) { return (ImageView) lastView; } } } return null; }
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; } } }
public int cmdViewHandle() { final GiCoreView v = mView != null ? mView.coreView() : null; return v != null ? v.viewAdapterHandle() : 0; }
public GiCoreView coreView() { return mView != null ? mView.coreView() : null; }
public Context getContext() { return mView != null ? mView.getView().getContext() : null; }
public ViewGroup getParent() { return mView != null ? (ViewGroup) mView.getView().getParent() : null; }
public View getView() { return mView != null ? mView.getView() : null; }
public void createDummyView(Context context, int width, int height) { final StdGraphView view = new StdGraphView(context, (BaseGraphView) null); view.layout(0, 0, width, height); mView = view; mView.coreView().onSize(BaseViewAdapter.getMainAdapter(mView), width, height); }