admin
2022-08-09 399ac289f80b7a40aa4210341db6b447cacdcf14
app/src/main/java/com/tejia/lijin/app/ui/dialog/UserProtocolDialog.java
@@ -4,6 +4,7 @@
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
@@ -11,6 +12,7 @@
import android.widget.FrameLayout;
import android.widget.TextView;
import com.tejia.lijin.app.ui.SimpleBrowserActivity;
import com.wpc.library.util.SystemCommon;
import com.wpc.library.util.common.StringUtils;
import com.tejia.lijin.app.R;
@@ -103,13 +105,19 @@
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            final UserProtocolDialog dialog = new UserProtocolDialog(context, R.style.Dialog);
            dialog.setCanceledOnTouchOutside(true);
            dialog.setCanceledOnTouchOutside(false);
            final View layout = inflater.inflate(R.layout.dialog_user_protocol, null);
            dialog.addContentView(layout, new FrameLayout.LayoutParams(
                    FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
                    FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
            TextView tv_title = layout.findViewById(R.id.tv_title);
            TextView tv_content = layout.findViewById(R.id.tv_content);
            tv_content.setText(TextViewUtil.getClickableHtml(webviewData, context, Color.rgb(23, 106, 230)));
            tv_content.setText(TextViewUtil.getClickableHtml(webviewData, context, Color.rgb(23, 106, 230), new TextViewUtil.URLClickListener() {
                @Override
                public void onClick(String url) {
                    context.startActivity(new Intent(context, SimpleBrowserActivity.class).putExtra("url", url));
                }
            }));
            tv_content.setMovementMethod(LinkMovementMethod.getInstance());
            tv_content.setClickable(false);
            tv_content.setHighlightColor(context.getResources().getColor(android.R.color.transparent));
@@ -127,10 +135,6 @@
                    tv_positive.setText(positiveButtonText);
                tv_positive.setOnClickListener(new View.OnClickListener() {
                    public void onClick(View v) {
                        try {
                            ShoppingApi.userProtocolListener(context, UserUtil.getUid(context) , 1, null);
                        } catch (Exception e) {
                        }
                        positiveButtonClickListener.onClick(dialog,
                                DialogInterface.BUTTON_POSITIVE);
                    }
@@ -141,10 +145,6 @@
                    tv_negative.setText(negativeButtonText);
                tv_negative.setOnClickListener(new View.OnClickListener() {
                    public void onClick(View v) {
                        try {
                            ShoppingApi.userProtocolListener(context, UserUtil.getUid(context), 0, null);
                        } catch (Exception e) {
                        }
                        negativeButtonClickListener.onClick(dialog,
                                DialogInterface.BUTTON_NEGATIVE);