package com.tencent.mm.plugin.remittance.ui;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.view.MenuItem;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.base.h;
import com.tencent.mm.ui.base.n.d;
import com.tencent.ytcommon.BuildConfig;

class RemittanceResultNewUI$3 implements d {
    final /* synthetic */ RemittanceResultNewUI pWO;

    RemittanceResultNewUI$3(RemittanceResultNewUI remittanceResultNewUI) {
        this.pWO = remittanceResultNewUI;
    }

    public final void onMMMenuItemSelected(MenuItem menuItem, int i) {
        AppMethodBeat.i(45117);
        ClipboardManager clipboardManager = (ClipboardManager) ah.getContext().getSystemService("clipboard");
        CharSequence charSequence = BuildConfig.FLAVOR;
        if (bo.gW(RemittanceResultNewUI.c(this.pWO), 2131827031)) {
            charSequence = RemittanceResultNewUI.d(this.pWO).getText().toString().trim();
        } else if (bo.gW(RemittanceResultNewUI.c(this.pWO), 2131827109)) {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(RemittanceResultNewUI.e(this.pWO).getText().toString().trim() + " ");
            String trim = RemittanceResultNewUI.b(this.pWO).getText().toString().trim();
            if (trim.endsWith(this.pWO.getString(2131296805))) {
                stringBuilder.append(trim.substring(0, trim.length() - 4));
            } else {
                stringBuilder.append(trim);
            }
            charSequence = stringBuilder.toString();
        }
        clipboardManager.setPrimaryClip(ClipData.newPlainText(null, charSequence));
        h.bQ(this.pWO, this.pWO.getString(2131296876));
        AppMethodBeat.o(45117);
    }
}
