what-the-bank/sources/com/facetec/sdk/g.java

50 lines
1.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.facetec.sdk;
import android.content.Context;
import android.util.AttributeSet;
import android.view.TextureView;
import android.view.View;
/* loaded from: classes.dex */
final class g extends TextureView {
private int d;
private int e;
public g(Context context) {
this(context, null);
}
public g(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public g(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.d = 0;
this.e = 0;
}
public final void setAspectRatio(int i, int i2) {
if (i < 0 || i2 < 0) {
throw new IllegalArgumentException("Size cannot be negative.");
}
this.d = i;
this.e = i2;
requestLayout();
}
@Override // 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.d;
if (i4 == 0 || (i3 = this.e) == 0) {
setMeasuredDimension(size, size2);
} else {
setMeasuredDimension(size, (i3 * size) / i4);
}
}
}