Codota Logo
SurfaceView.onSizeChanged
Code IndexAdd Codota 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)

  • 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: 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

  • 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