Codota Logo
SurfaceView.getContext
Code IndexAdd Codota to your IDE (free)

How to use
getContext
method
in
android.view.SurfaceView

Best Java code snippets using android.view.SurfaceView.getContext (Showing top 6 results out of 315)

  • Common ways to obtain SurfaceView
private void myMethod () {
SurfaceView s =
  • Codota IconContext context;new SurfaceView(context)
  • Codota IconView view;(SurfaceView) view.findViewById(id)
  • Codota IconViewStub viewStub;(SurfaceView) viewStub.inflate()
  • Smart code suggestions by Codota
}
origin: pedroSG94/rtmp-rtsp-stream-client-java

public Camera2Base(SurfaceView surfaceView) {
 this.surfaceView = surfaceView;
 this.context = surfaceView.getContext();
 init(context);
}
origin: pedroSG94/rtmp-rtsp-stream-client-java

public Camera1ApiManager(SurfaceView surfaceView, GetCameraData getCameraData) {
 this.surfaceView = surfaceView;
 this.getCameraData = getCameraData;
 this.context = surfaceView.getContext();
 init();
}
origin: jiangdongguo/OkCamera

private void startAcceleratorSensor() {
  mAccelerSensor = SensorAccelerator.getSensorInstance();
  mAccelerSensor.startSensorAccelerometer(mSurfaceViewRf.get().getContext(), new SensorAccelerator.OnSensorChangedResult() {
    @Override
    public void onMoving(int x, int y, int z) {
    }
    @Override
    public void onStopped() {
      // 开始对焦
      cameraFocus();
    }
  });
}
origin: pedroSG94/rtmp-rtsp-stream-client-java

public Camera1Base(SurfaceView surfaceView) {
 context = surfaceView.getContext();
 cameraManager = new Camera1ApiManager(surfaceView, this);
 init();
}
origin: vbier/habpanelviewer

public MotionVisualizer(SurfaceView motionView, NavigationView navigationView, SharedPreferences preferences, int cameraRotation, int scaledSize) {
  mMotionView = motionView;
  mNavigationView = navigationView;
  mPreferences = preferences;
  mCameraRotation = cameraRotation;
  int newDeviceRotation = ((Activity) mMotionView.getContext()).getWindowManager().getDefaultDisplay().getRotation();
  setDeviceRotation(newDeviceRotation);
  mMotionView.setZOrderOnTop(true);
  mMotionView.getHolder().setFormat(PixelFormat.TRANSPARENT);
  mPaint.setColor(Color.WHITE);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setTextSize(scaledSize);
  Rect bounds = new Rect();
  mPaint.getTextBounds(mNavigationView.getContext().getString(R.string.motion), 0, 6, bounds);
  mMotionTextWidth = bounds.width();
  mPaint.getTextBounds(mNavigationView.getContext().getString(R.string.tooDark), 0, 8, bounds);
  mDarkTextWidth = bounds.width();
}
origin: jiangdongguo/OkCamera

private void startOrientationSensor() {
  mOriSensor = SensorOrientation.getInstance(mSurfaceViewRf.get().getContext());
  mOriSensor.startSensorOrientation(new SensorOrientation.OnChangedListener() {
    @Override
    public void onOrientatonChanged(int orientation) {
      // 假定某个范围,确定手机当前方向
      // mPhoneDegree = 0,正常垂直方向
      // mPhoneDegree = 90,向右水平方向 ...
      int rotate = 0;
      if ((orientation >= 0 && orientation <= 45) || (orientation > 315)) {
        rotate = 0;
      } else if (orientation > 45 && orientation <= 135) {
        rotate = 90;
      } else if (orientation > 135 && orientation <= 225) {
        rotate = 180;
      } else if (orientation > 225 && orientation <= 315) {
        rotate = 270;
      } else {
        rotate = 0;
      }
      if (rotate == orientation)
        return;
      mPhoneDegree = rotate;
      Log.i(TAG, "手机方向角度:" + mPhoneDegree);
    }
  });
  mOriSensor.enable();
}
android.viewSurfaceViewgetContext

Popular methods of SurfaceView

  • getHolder
  • <init>
  • onMeasure
  • onInitializeAccessibilityEvent
  • onInitializeAccessibilityNodeInfo
  • setLayoutParams
  • onKeyDown
  • setOnTouchListener
  • onDetachedFromWindow
  • setVisibility
  • getLayoutParams
  • onAttachedToWindow
  • getLayoutParams,
  • onAttachedToWindow,
  • onTouchEvent,
  • onSizeChanged,
  • setOnClickListener,
  • getHeight,
  • getWidth,
  • setKeepScreenOn,
  • onLayout,
  • setZOrderOnTop

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JComboBox (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now