congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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