50 lines
1.3 KiB
Java
50 lines
1.3 KiB
Java
|
package com.facetec.sdk;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.view.SurfaceView;
|
||
|
import android.view.View;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
final class j extends SurfaceView {
|
||
|
private int c;
|
||
|
private int e;
|
||
|
|
||
|
public j(Context context) {
|
||
|
this(context, null);
|
||
|
}
|
||
|
|
||
|
public j(Context context, AttributeSet attributeSet) {
|
||
|
this(context, attributeSet, 0);
|
||
|
}
|
||
|
|
||
|
public j(Context context, AttributeSet attributeSet, int i) {
|
||
|
super(context, attributeSet, i);
|
||
|
this.e = 0;
|
||
|
this.c = 0;
|
||
|
}
|
||
|
|
||
|
public final void setAspectRatio(int i, int i2) {
|
||
|
if (i < 0 || i2 < 0) {
|
||
|
throw new IllegalArgumentException("Size cannot be negative.");
|
||
|
}
|
||
|
this.e = i;
|
||
|
this.c = i2;
|
||
|
requestLayout();
|
||
|
}
|
||
|
|
||
|
@Override // android.view.SurfaceView, android.view.View
|
||
|
protected final void onMeasure(int i, int i2) {
|
||
|
int i3;
|
||
|
super.onMeasure(i, i2);
|
||
|
int size = View.MeasureSpec.getSize(i);
|
||
|
int size2 = View.MeasureSpec.getSize(i2);
|
||
|
int i4 = this.e;
|
||
|
if (i4 == 0 || (i3 = this.c) == 0) {
|
||
|
setMeasuredDimension(size, size2);
|
||
|
} else {
|
||
|
setMeasuredDimension(size, (i3 * size) / i4);
|
||
|
}
|
||
|
}
|
||
|
}
|