public class MatrixManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentRotation |
protected ScaleType |
currentScaleType |
protected android.graphics.Point |
intrinsicVideoSize |
protected static int |
QUARTER_ROTATION |
protected java.lang.ref.WeakReference<android.view.View> |
requestedModificationView |
protected java.lang.Integer |
requestedRotation |
protected ScaleType |
requestedScaleType |
| Constructor and Description |
|---|
MatrixManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyCenter(android.view.View view)
Applies the
ScaleType.CENTER to the specified matrix. |
protected void |
applyCenterCrop(android.view.View view)
Applies the
ScaleType.CENTER_CROP to the specified matrix. |
protected void |
applyCenterInside(android.view.View view)
Applies the
ScaleType.CENTER_INSIDE to the specified matrix. |
protected void |
applyFitCenter(android.view.View view)
Applies the
ScaleType.FIT_CENTER to the specified matrix. |
protected void |
applyRequestedModifications()
Applies any scale or rotation that was requested before the MatrixManager was
ready to apply those modifications.
|
int |
getCurrentRotation() |
ScaleType |
getCurrentScaleType() |
boolean |
ready() |
void |
reset() |
void |
rotate(android.view.View view,
int rotation) |
boolean |
scale(android.view.View view,
ScaleType scaleType)
Performs the requested scaling on the
view's matrix |
void |
setIntrinsicVideoSize(int width,
int height) |
protected void |
setScale(android.view.View view,
float xScale,
float yScale)
Applies the specified scale modification to the view
|
protected static final int QUARTER_ROTATION
@NonNull protected android.graphics.Point intrinsicVideoSize
protected int currentRotation
@NonNull protected ScaleType currentScaleType
@Nullable protected java.lang.Integer requestedRotation
@Nullable protected ScaleType requestedScaleType
@NonNull protected java.lang.ref.WeakReference<android.view.View> requestedModificationView
public void reset()
public boolean ready()
public void setIntrinsicVideoSize(int width,
int height)
public int getCurrentRotation()
@NonNull public ScaleType getCurrentScaleType()
public void rotate(@NonNull
android.view.View view,
int rotation)
public boolean scale(@NonNull
android.view.View view,
@NonNull
ScaleType scaleType)
view's matrixview - The View to alter the matrix to achieve the requested scale typescaleType - The type of scaling to use for the specified viewprotected void applyCenter(@NonNull
android.view.View view)
ScaleType.CENTER to the specified matrix. This will
perform no scaling as this just indicates that the video should be centered
in the Viewview - The view to apply the transformation toprotected void applyCenterCrop(@NonNull
android.view.View view)
ScaleType.CENTER_CROP to the specified matrix. This will
make sure the smallest side fits the parent container, cropping the otherview - The view to apply the transformation toprotected void applyCenterInside(@NonNull
android.view.View view)
ScaleType.CENTER_INSIDE to the specified matrix. This will
only perform scaling if the video is too large to fit completely in the view
in which case it will be scaled to fitview - The view to apply the transformation toprotected void applyFitCenter(@NonNull
android.view.View view)
ScaleType.FIT_CENTER to the specified matrix. This will
scale the video so that the largest side will always match the viewview - The view to apply the transformation toprotected void setScale(@NonNull
android.view.View view,
float xScale,
float yScale)
view - The view to scalexScale - The scale to apply to the x axisyScale - The scale to apply to the y axisprotected void applyRequestedModifications()