package d.f.a.s2;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ifpdos.debugmenu.event.ActivityEvent;

/* JADX INFO: compiled from: MacQRView.java */
/* JADX INFO: loaded from: classes.dex */
public class g extends LinearLayout {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Context f3411b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public ImageView f3412e;

    public g(Context context, ActivityEvent.ShowQRCode showQRCode) {
        super(context);
        this.f3411b = getContext();
        setGravity(1);
        setOrientation(1);
        setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
        if (showQRCode.mBitmap != null) {
            ImageView imageView = new ImageView(this.f3411b);
            this.f3412e = imageView;
            imageView.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
            this.f3412e.setImageBitmap(showQRCode.mBitmap);
            addView(this.f3412e);
        }
        if (showQRCode.mTips != null) {
            TextView textView = new TextView(this.f3411b);
            textView.setText(showQRCode.mTips);
            textView.setLayoutParams(new ViewGroup.LayoutParams(-1, -2));
            textView.setTextColor(-16711936);
            textView.setGravity(17);
            addView(textView);
        }
    }
}
