Tabnine Logo
SurfaceView.onSizeChanged
Code IndexAdd Tabnine to your IDE (free)

How to use
onSizeChanged
method
in
android.view.SurfaceView

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

origin: codeestX/ENViews

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  mWidth = w;
  mHeight = h;
  mCenterX = w / 2;
  mCenterY = h / 2;
  mBaseLength = w / 10;
  mBgBaseLength = w / 8;
  for (int i = 0; i < 4 ;i++) {
    mCurrentRippleX[i] = - 2 * mBgBaseLength;
  }
  mPath.reset();
  mPath.moveTo(0, mCenterY + 2 * mBaseLength);
  mPath.lineTo(0, mCenterY);
  mPath.lineTo(mBaseLength / 4, mCenterY - mBaseLength);
  mPath.lineTo(mBaseLength / 4, mCenterY - 1.5f * mBaseLength);
  mPath.lineTo(mBaseLength * 3 / 4, mCenterY - 1.5f * mBaseLength);
  mPath.lineTo(mBaseLength * 3 / 4, mCenterY - mBaseLength);
  mPath.lineTo(mBaseLength, mCenterY);
  mPath.lineTo(mBaseLength, mCenterY + 2 * mBaseLength);
  mPath.close();
}
origin: OpenCVBlueprints/OpenCVBlueprints

@Override
public void onSizeChanged(int w,int h,int oldw,int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  sizeWidth = w;
  sizeHeight = h;
}
origin: lessthanoptimal/BoofAndroidDemo

@Override
protected void onSizeChanged (int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w,h,oldw,oldh);
  // the smallest side in the view area
  smallest = Math.min(w,h);
  this.surfaceWidth = w;
  this.surfaceHeight = h;
}
origin: InnoFang/Android-Code-Demos

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  mHeight = h;
  mWidth = w;
  mDialRadius = Math.min(mWidth, mHeight) / 2 - 100;
  mLen = 20F;
  mSecondsPointerLen = mDialRadius - 70;
  mMinutesPointerLen = mSecondsPointerLen - 50;
  mHourPointerLen = mMinutesPointerLen - 40;
}
origin: wuyr/CatchPiggy

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  mCenterX = w / 2;
  mCenterY = h / 2;
  //圆的最大半径取手机屏幕对角线的一半
  mMaxRadius = (int) Math.sqrt(Math.pow(mCenterX, 2) + Math.pow(mCenterY, 2));
}
origin: google-developer-training/android-advanced

/**
 * We cannot get the correct dimensions of views in onCreate because
 * they have not been inflated yet. This method is called every time the
 * size of a view changes, including the first time after it has been
 * inflated.
 *
 * @param w Current width of view.
 * @param h Current height of view.
 * @param oldw Previous width of view.
 * @param oldh Previous height of view.
 */
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  mViewWidth = w;
  mViewHeight = h;
  mFlashlightCone = new FlashlightCone(mViewWidth, mViewHeight);
  // Set font size proportional to view size.
  mPaint.setTextSize(mViewHeight / 5);
  mBitmap = BitmapFactory.decodeResource(
      mContext.getResources(), R.drawable.android);
  setUpBitmap();
}
origin: yanbober/MagicFloatView

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  //TODO default position.
  mTouchPoint.x = getMeasuredWidth() / 2;
  mTouchPoint.y = getMeasuredHeight() / 2;
  mRandomParticles = new ArrayList<>();
  for (int index=0 ;index<250; index++) {
    RandomParticle particle = new RandomParticle(getMeasuredWidth(), getMeasuredHeight());
    mRandomParticles.add(particle);
  }
}
origin: luozhanming/LuckyBoard

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  super.onSizeChanged(w, h, oldw, oldh);
  mButtonPath = new Path();
  mButtonPath.addCircle(getWidth() / 2, getHeight() / 2, (float) (blockSize * 0.75 / 2 - Util.dp2px(getContext(), 5)), Path.Direction.CCW);
  mButtonRegion = new Region();
  Region clip = new Region(0, 0, w, h);
  mButtonRegion.setPath(mButtonPath, clip);
}
android.viewSurfaceViewonSizeChanged

Popular methods of SurfaceView

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

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • Permission (java.security)
    Legacy security code; do not use.
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JTable (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 21 Best Atom Packages for 2021
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