package com.tencent.mm.pluginsdk.ui.tools;

import android.view.View;
import android.widget.RelativeLayout.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.pluginsdk.ui.tools.p.1;
import com.tencent.mm.sdk.platformtools.BackwardSupportUtil.b;
import com.tencent.mm.sdk.platformtools.ab;

class p$1$1 implements Runnable {
    final /* synthetic */ View mqd;
    final /* synthetic */ 1 vvB;

    p$1$1(1 1, View view) {
        this.vvB = 1;
        this.mqd = view;
    }

    public final void run() {
        AppMethodBeat.i(70412);
        int height = (this.mqd.getResources().getDisplayMetrics().heightPixels - this.mqd.getHeight()) >>> 1;
        int height2 = (int) ((((double) height) / 1.618d) - ((double) (this.vvB.vvA.getHeight() >>> 1)));
        if (height2 >= 0) {
            if (p.access$000() < 0) {
                p.access$002(b.b(this.mqd.getContext(), 20.0f));
            }
            if ((this.vvB.vvA.getHeight() + height2) + p.access$000() > height) {
                height = height2 - (((this.vvB.vvA.getHeight() + height2) + p.access$000()) - height);
            } else {
                height = height2;
            }
            LayoutParams layoutParams = (LayoutParams) this.vvB.vvA.getLayoutParams();
            if (height > 0 && height != layoutParams.bottomMargin) {
                ab.i("VideoSightHelper", "setting tip marginBottom ".concat(String.valueOf(height)));
                layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin, layoutParams.rightMargin, height);
                this.vvB.vvA.setLayoutParams(layoutParams);
            }
        }
        AppMethodBeat.o(70412);
    }
}
