Tabnine Logo
SurfaceView.getContext
Code IndexAdd Tabnine 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)

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

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • getApplicationContext (Context)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now