package com.seewo.libvui.view;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;

/* JADX INFO: loaded from: classes.dex */
public class AutoFitScrollView extends ScrollView {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private boolean f1906b;

    public AutoFitScrollView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.f1906b = false;
    }

    @Override // android.widget.ScrollView, android.widget.FrameLayout, android.view.View
    protected void onMeasure(int i2, int i3) {
        int i4 = getResources().getDisplayMetrics().widthPixels;
        int iRound = Math.round((i4 / 1920.0f) * 760.0f);
        int iRound2 = Math.round((r6.heightPixels / 1080.0f) * 620.0f);
        if (Build.VERSION.SDK_INT < 24) {
            i2 = View.MeasureSpec.makeMeasureSpec(iRound, Integer.MIN_VALUE);
        }
        if (this.f1906b) {
            iRound2 = ((getResources().getConfiguration().screenHeightDp * getResources().getConfiguration().densityDpi) / 160) / 2;
        }
        super.onMeasure(i2, View.MeasureSpec.makeMeasureSpec(iRound2, Integer.MIN_VALUE));
    }

    public void setAutoMeasureEnable(boolean z) {
        this.f1906b = z;
        invalidate();
    }
}
