Class AutoFitTextureView

    • Constructor Detail

      • AutoFitTextureView

        public AutoFitTextureView​(Context context)
      • AutoFitTextureView

        public AutoFitTextureView​(Context context,
                                  AttributeSet attrs,
                                  int defStyle)
    • Method Detail

      • setAspectRatio

        public void setAspectRatio​(int width,
                                   int height)
        Sets the aspect ratio for this view. The size of the view will be measured based on the ratio calculated from the parameters. Note that the actual sizes of parameters don't matter, that is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
        Parameters:
        width - Relative horizontal size
        height - Relative vertical size
      • onMeasure

        protected void onMeasure​(int widthMeasureSpec,
                                 int heightMeasureSpec)
        Overrides:
        onMeasure in class View