4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1

以下内容为反编译后的 GamePlayerVideoCommentFragment.java 源代码,内容仅作参考


package com.m4399.gamecenter.plugin.main.controllers.video;

import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Keep;
import android.support.constraint.ConstraintLayout;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.ContextThemeWrapper;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.JavascriptInterface;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.framework.database.tables.CachesTable;
import com.framework.net.ILoadPageEventListener;
import com.framework.rxbus.RxBus;
import com.framework.rxbus.annotation.Subscribe;
import com.framework.rxbus.annotation.Tag;
import com.framework.utils.ActivityStateUtils;
import com.framework.utils.JSONUtils;
import com.framework.utils.KeyboardUtils;
import com.framework.utils.UMengEventUtils;
import com.m4399.gamecenter.plugin.main.PluginApplication;
import com.m4399.gamecenter.plugin.main.R;
import com.m4399.gamecenter.plugin.main.controllers.web.GameCommentJsInterface;
import com.m4399.gamecenter.plugin.main.helpers.k;
import com.m4399.gamecenter.plugin.main.helpers.l;
import com.m4399.gamecenter.plugin.main.manager.authentication.ContentPublishAuthManagerProxy;
import com.m4399.gamecenter.plugin.main.manager.router.GameCenterRouterManager;
import com.m4399.gamecenter.plugin.main.manager.user.UserCenterManager;
import com.m4399.gamecenter.plugin.main.manager.v;
import com.m4399.gamecenter.plugin.main.models.gamedetail.GamePlayerVideoModel;
import com.m4399.gamecenter.plugin.main.utils.ar;
import com.m4399.gamecenter.plugin.main.utils.as;
import com.m4399.gamecenter.plugin.main.utils.t;
import com.m4399.gamecenter.plugin.main.views.PraiseView;
import com.m4399.gamecenter.plugin.main.widget.web.WebViewLayout;
import com.m4399.support.controllers.BaseActivity;
import com.m4399.support.controllers.BaseFragment;
import com.m4399.support.utils.HttpResultTipUtils;
import com.m4399.support.utils.ToastUtils;
import com.m4399.support.widget.dialog.CommonLoadingDialog;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;

public class GamePlayerVideoCommentFragment extends BaseFragment implements TextWatcher, GestureDetector.OnGestureListener, View.OnClickListener, View.OnTouchListener, ar {
    private String aoJ;
    private Button aoU;
    private LinearLayout aoV;
    private GameCommentJsInterface apa;
    private View bZZ;
    private as blr;
    private TextView caa;
    private String cab;
    private String cad;
    private int cae;
    private boolean caf;
    private boolean cak;
    private a cal;
    private int mCommentId;
    private int mCommentType;
    private EditText mEditText;
    private PraiseView mLikeAnimView;
    private int mReplyId;
    private int mVideoId;
    private WebViewLayout mWebView;
    private String cac = "";
    private int mGameId = 0;
    private int mPostId = 0;
    private boolean cag = false;
    private boolean cah = false;
    private int mThreadId = 0;
    private int mForumsId = 0;
    private int mQuanId = 0;
    private long cai = 0;
    private boolean caj = false;
    public int COMMENT_TYPE_NEW_COMMENT = 1;
    public int COMMENT_TYPE_REPLY_COMMENT = 2;
    GestureDetector ape = new GestureDetector(this);

    public interface a {
        void deleteComment();

        void doComment();

        void doLike();

        void doShare();

        void hideCommentFragment();
    }

    @Override
    public void afterTextChanged(Editable editable) {
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }

    @Override
    public boolean isSupportToolBar() {
        return false;
    }

    @Override
    public boolean onDown(MotionEvent motionEvent) {
        return false;
    }

    @Override
    public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
        return false;
    }

    @Override
    public void onLongPress(MotionEvent motionEvent) {
    }

    @Override
    public void onShowPress(MotionEvent motionEvent) {
    }

    @Override
    public boolean onSingleTapUp(MotionEvent motionEvent) {
        return false;
    }

    @Override
    protected int getLayoutID() {
        return R.layout.m4399_fragment_video_list_comment;
    }

    @Override
    protected void initView(ViewGroup viewGroup, Bundle bundle) {
        this.caj = true;
        xD();
        this.mainView.findViewById(R.id.zone_bottom_bar).setBackgroundColor(getResources().getColor(R.color.bai_ffffff));
        this.mCommentType = this.COMMENT_TYPE_NEW_COMMENT;
        this.aoV = (LinearLayout) this.mainView.findViewById(R.id.comment_edit_layout);
        this.bZZ = this.mainView.findViewById(R.id.zone_bottom_bar);
        this.mEditText = (EditText) this.mainView.findViewById(R.id.comment_detail_edit);
        this.mEditText.addTextChangedListener(this);
        this.caa = (TextView) this.mainView.findViewById(R.id.zone_forward);
        this.mLikeAnimView = (PraiseView) this.mainView.findViewById(R.id.zone_like_layout);
        this.mLikeAnimView.setOnClickListener(this);
        bindBottomPraiseView(this.caf, false, this.cae);
        this.aoU = (Button) this.mainView.findViewById(R.id.comment_detail_confirm_btn);
        this.mWebView = (WebViewLayout) this.mainView.findViewById(R.id.web_layout);
        this.mWebView.setFocusable(false);
        this.mWebView.setFocusableInTouchMode(false);
        if (this.mWebView.getWebView() != null) {
            this.mWebView.getWebView().setFocusableInTouchMode(false);
        }
        if (this.mWebView.getWebView() != null) {
            this.mWebView.getWebView().setOnTouchListener(this);
        }
        v.getInstance().loadTemplate(3, this.mWebView, null, new v.b(getContext(), this.mWebView, 3));
        RxBus.register(this);
        Hr();
        this.mainView.findViewById(R.id.zone_coment_layout).setOnClickListener(this);
        this.mainView.findViewById(R.id.zone_repost_layout).setOnClickListener(this);
        this.mainView.findViewById(R.id.comment_edit_layout).setOnClickListener(this);
        this.mainView.findViewById(R.id.zone_repost_layout).setVisibility(0);
        View findViewById = this.mainView.findViewById(R.id.touch_back);
        ViewGroup.LayoutParams layoutParams = findViewById.getLayoutParams();
        layoutParams.height = (int) (t.getDeviceWidthPixels(getContext()) * 0.5625f);
        findViewById.setLayoutParams(layoutParams);
        animationShift(true);
        if (this.cag) {
            return;
        }
        this.mainView.findViewById(R.id.zone_repost_layout).setVisibility(8);
    }

    public void animationShift(boolean z) {
        if (getContext() == null || getContext().isFinishing()) {
            return;
        }
        this.mWebView.setAlpha(1.0f);
        this.bZZ.setAlpha(1.0f);
        Animation loadAnimation = AnimationUtils.loadAnimation(getContext(), z ? R.anim.m4399_video_comment_slide_in_from_bottom : R.anim.m4399_video_comment_slide_out_from_bottom);
        if (!z) {
            Hn();
        }
        this.mWebView.startAnimation(loadAnimation);
    }

    private void Hn() {
        ObjectAnimator duration = ObjectAnimator.ofFloat(this.mWebView, "alpha", 1.0f, 0.0f).setDuration(400L);
        ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.bZZ, "alpha", 1.0f, 0.0f).setDuration(400L);
        duration.start();
        duration2.start();
    }

    public void bindBottomPraiseView(boolean z, boolean z2, int i) {
        PraiseView praiseView = this.mLikeAnimView;
        if (praiseView == null) {
            return;
        }
        praiseView.bindView(z, z2, i, R.mipmap.m4399_png_zone_detail_icon_praise, R.mipmap.m4399_png_zone_detail_icon_praise_hl, "animation/zone_list_like_btn", "animation/zone_list_like_btn/data.json", "", null);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        WebViewLayout webViewLayout = this.mWebView;
        if (webViewLayout != null) {
            webViewLayout.stopLoading();
            this.mWebView.removeAllViews();
            this.mWebView.onDestroy();
            this.mWebView = null;
        }
        GameCommentJsInterface gameCommentJsInterface = this.apa;
        if (gameCommentJsInterface != null) {
            gameCommentJsInterface.onDestroy();
        }
        RxBus.unregister(this);
    }

    private void xD() {
        if (this.blr != null || getContext() == null || com.m4399.gamecenter.plugin.main.utils.a.getActivity(getContext()) == null) {
            return;
        }
        this.blr = new as(getContext());
        this.blr.setKeyboardHeightObserver(this);
        this.mainView.findViewById(R.id.container_f).post(new Runnable() {
            @Override
            public void run() {
                GamePlayerVideoCommentFragment.this.blr.start();
            }
        });
    }

    @Override
    public void onKeyboardHeightChanged(int i, int i2, Context context) {
        boolean z = true;
        this.cak = i > 0;
        ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) this.aoV.getLayoutParams();
        layoutParams.bottomMargin = this.cak ? i : 0;
        this.aoV.setLayoutParams(layoutParams);
        if (i <= 0 && TextUtils.isEmpty(this.mEditText.getText())) {
            z = false;
        }
        ci(z);
    }

    private void ci(boolean z) {
        if (z) {
            return;
        }
        this.mEditText.clearFocus();
        this.mEditText.setHint(getString(R.string.gamehub_post_add_content_hint));
        this.mCommentType = this.COMMENT_TYPE_NEW_COMMENT;
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        if (charSequence.toString().trim().length() > 0) {
            this.aoU.setTextColor(-1);
            this.aoU.setEnabled(true);
            this.aoU.setBackgroundResource(R.drawable.m4399_xml_selector_green_btn_round_corner_background);
            this.aoU.setOnClickListener(this);
            return;
        }
        this.aoU.setTextColor(getResources().getColor(R.color.bai_66ffffff));
        this.aoU.setBackgroundResource(R.drawable.m4399_shape_bg_lv_54ba3d_3dp);
        this.aoU.setEnabled(false);
        this.aoU.setOnClickListener(null);
    }

    @Override
    public boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
        if (Math.abs(motionEvent.getY() - motionEvent2.getY()) <= 20.0f) {
            return false;
        }
        hideKeyboard();
        Ho();
        return false;
    }

    private void Ho() {
        EditText editText = this.mEditText;
        if (editText == null || !TextUtils.isEmpty(editText.getText().toString())) {
            return;
        }
        this.aoV.setVisibility(8);
        this.mainView.findViewById(R.id.zone_bottom_bar).setVisibility(0);
    }

    public void hideKeyboard() {
        if (this.cak) {
            KeyboardUtils.hideKeyboard(getContext(), this.mEditText);
            Observable.timer(150L, TimeUnit.MILLISECONDS).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {
                @Override
                public void call(Long l) {
                    if (GamePlayerVideoCommentFragment.this.mEditText == null || !TextUtils.isEmpty(GamePlayerVideoCommentFragment.this.mEditText.getText().toString())) {
                        return;
                    }
                    GamePlayerVideoCommentFragment.this.mEditText.setHint(GamePlayerVideoCommentFragment.this.getString(R.string.gamehub_post_add_content_hint));
                    GamePlayerVideoCommentFragment gamePlayerVideoCommentFragment = GamePlayerVideoCommentFragment.this;
                    gamePlayerVideoCommentFragment.mCommentType = gamePlayerVideoCommentFragment.COMMENT_TYPE_NEW_COMMENT;
                    GamePlayerVideoCommentFragment.this.aoJ = null;
                }
            });
        }
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.comment_detail_confirm_btn) {
            int i = this.mCommentType;
            if (i == this.COMMENT_TYPE_NEW_COMMENT) {
                Hp();
            } else if (i == this.COMMENT_TYPE_REPLY_COMMENT) {
                mK();
            }
            com.m4399.gamecenter.plugin.main.helpers.t.onClickEvent("comment_video", Integer.valueOf(this.mVideoId), this.cab, "video_type", this.cac, "game_id", Integer.valueOf(this.mGameId), "postid", Integer.valueOf(this.mPostId), "trace", getContext().getPageTracer().getFullTrace());
            return;
        }
        if (id == R.id.zone_coment_layout) {
            bw(getString(R.string.gamehub_post_add_content_hint));
            this.aoV.setVisibility(0);
            return;
        }
        if (id == R.id.zone_repost_layout) {
            a aVar = this.cal;
            if (aVar != null) {
                aVar.doShare();
                UMengEventUtils.onEvent("ad_youpai_video_play_comment_page", "分享");
                return;
            }
            return;
        }
        if (id == R.id.zone_like_layout) {
            a aVar2 = this.cal;
            if (aVar2 != null) {
                aVar2.doLike();
                return;
            }
            return;
        }
        if (id == R.id.comment_edit_layout) {
            this.mEditText.requestFocus();
        }
    }

    private void Hp() {
        hideKeyboard();
        UserCenterManager.checkIsLogin(getContext(), new com.m4399.gamecenter.plugin.main.listeners.f<Boolean>() {
            @Override
            public void onChecking() {
            }

            @Override
            public void onCheckFinish(Boolean bool, Object... objArr) {
                if (bool.booleanValue()) {
                    ContentPublishAuthManagerProxy.INSTANCE.getInstance().check(GamePlayerVideoCommentFragment.this.getContext(), "common_comment_comment", new com.m4399.gamecenter.plugin.main.listeners.f<Integer>() {
                        @Override
                        public void onChecking() {
                        }

                        @Override
                        public void onCheckFinish(Integer num, Object... objArr2) {
                            GamePlayerVideoCommentFragment.this.Hq();
                        }
                    });
                }
            }
        });
    }

    public void Hq() {
        if (ActivityStateUtils.isDestroy((Activity) getContext())) {
            return;
        }
        final CommonLoadingDialog commonLoadingDialog = new CommonLoadingDialog(getContext());
        if (this.cag && this.cah) {
            final com.m4399.gamecenter.plugin.main.providers.g.e eVar = new com.m4399.gamecenter.plugin.main.providers.g.e();
            eVar.setThreadId(this.mThreadId);
            eVar.setForumId(this.mForumsId);
            eVar.setQuanId(this.mQuanId);
            eVar.setActivityId(this.cai);
            eVar.setContent(this.mEditText.getText().toString().trim());
            eVar.loadData(new ILoadPageEventListener() {
                @Override
                public void onBefore() {
                    commonLoadingDialog.show(R.string.comment_game_pushing);
                }

                @Override
                public void onSuccess() {
                    if (GamePlayerVideoCommentFragment.this.cal != null) {
                        GamePlayerVideoCommentFragment.this.cal.doComment();
                    }
                    GamePlayerVideoCommentFragment.this.resetInputEditText();
                    commonLoadingDialog.dismiss();
                    k.executeJs(GamePlayerVideoCommentFragment.this.mWebView, k.createVideoAddCommentJsonJs(eVar.getCallbackJsonString()));
                    RxBus.get().post("tag.player.video.comment.success", String.valueOf(GamePlayerVideoCommentFragment.this.mVideoId));
                }

                @Override
                public void onFailure(Throwable th, int i, String str, int i2, JSONObject jSONObject) {
                    commonLoadingDialog.dismiss();
                    String string = JSONUtils.getString("error", jSONObject);
                    if (!TextUtils.isEmpty(string)) {
                        str = string;
                    }
                    ToastUtils.showToast(GamePlayerVideoCommentFragment.this.getContext(), HttpResultTipUtils.getFailureTip(PluginApplication.getContext(), th, i, str));
                }
            });
            return;
        }
        final com.m4399.gamecenter.plugin.main.providers.g.f fVar = new com.m4399.gamecenter.plugin.main.providers.g.f();
        fVar.setCommentType(this.cag ? 3 : 4);
        if (this.cag) {
            fVar.setVideoName(this.cad);
            fVar.setVideoUid(this.cab);
        }
        fVar.setCommentAction(1);
        fVar.setCommentTargetId(this.mVideoId);
        fVar.setCommentContent(this.mEditText.getText().toString().trim());
        fVar.loadData(new ILoadPageEventListener() {
            @Override
            public void onBefore() {
                commonLoadingDialog.show(R.string.comment_game_pushing);
            }

            @Override
            public void onSuccess() {
                if (GamePlayerVideoCommentFragment.this.cal != null) {
                    GamePlayerVideoCommentFragment.this.cal.doComment();
                }
                GamePlayerVideoCommentFragment.this.resetInputEditText();
                commonLoadingDialog.dismiss();
                k.executeJs(GamePlayerVideoCommentFragment.this.mWebView, k.createVideoAddCommentJsonJs(fVar.getCallbackJsonString()));
                UMengEventUtils.onEvent("ad_youpai_video_play_comment_page", "写评论");
                RxBus.get().post("tag.player.video.comment.success", String.valueOf(GamePlayerVideoCommentFragment.this.mVideoId));
            }

            @Override
            public void onFailure(Throwable th, int i, String str, int i2, JSONObject jSONObject) {
                commonLoadingDialog.dismiss();
                ToastUtils.showToast(GamePlayerVideoCommentFragment.this.getContext(), HttpResultTipUtils.getFailureTip(PluginApplication.getContext(), th, i, str));
            }
        });
    }

    private void mK() {
        UserCenterManager.checkIsLogin(getContext(), new com.m4399.gamecenter.plugin.main.listeners.f<Boolean>() {
            @Override
            public void onChecking() {
            }

            @Override
            public void onCheckFinish(Boolean bool, Object... objArr) {
                if (bool.booleanValue()) {
                    ContentPublishAuthManagerProxy.INSTANCE.getInstance().check(GamePlayerVideoCommentFragment.this.getContext(), "common_comment_reply", new com.m4399.gamecenter.plugin.main.listeners.f<Integer>() {
                        @Override
                        public void onChecking() {
                        }

                        @Override
                        public void onCheckFinish(Integer num, Object... objArr2) {
                            k.executeJs(GamePlayerVideoCommentFragment.this.mWebView, "javascript:m_videoComment.newReply(" + GamePlayerVideoCommentFragment.this.replyParams(GamePlayerVideoCommentFragment.this.mEditText.getText().toString().replaceAll("\n", "<br>"), GamePlayerVideoCommentFragment.this.aoJ) + ")");
                        }
                    });
                }
            }
        });
    }

    public String replyParams(String str, String str2) {
        if (TextUtils.isEmpty(str2)) {
            str2 = "";
        }
        return "{\"message\" : \"" + str + "\", \"data\" : '" + str2 + "'}";
    }

    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {
        return this.ape.onTouchEvent(motionEvent);
    }

    @Keep
    @Subscribe(tags = {@Tag("tag.player.video.praise.data")})
    public void onRcvVideoPraiseData(GamePlayerVideoModel gamePlayerVideoModel) {
        int videoId = gamePlayerVideoModel.getVideoId();
        int i = this.mVideoId;
        if (videoId != i || i == 0) {
            return;
        }
        setVideoInfo(i, gamePlayerVideoModel.getPtUid(), gamePlayerVideoModel.getVideoTitle(), gamePlayerVideoModel.getLikeNum(), gamePlayerVideoModel.getIsLike() == 1, gamePlayerVideoModel.getVideoType().getText(), gamePlayerVideoModel.getGameModelId(), gamePlayerVideoModel.getPostId());
    }

    @Keep
    @Subscribe(tags = {@Tag("tag.comment.reply")})
    public void setReplay(Bundle bundle) {
        String string = bundle.getString("intent.extra.comment.reply.hint");
        if (TextUtils.isEmpty(string) || string.equalsIgnoreCase(getString(R.string.video_comment_hint))) {
            this.mCommentType = this.COMMENT_TYPE_NEW_COMMENT;
            string = getString(R.string.gamehub_post_add_content_hint);
        } else {
            this.mCommentType = this.COMMENT_TYPE_REPLY_COMMENT;
        }
        this.aoJ = bundle.getString("intent.extra.comment.reply.json");
        this.mEditText.setText("");
        this.aoV.setVisibility(0);
        this.mainView.findViewById(R.id.zone_bottom_bar).setVisibility(4);
        if (this.caj) {
            bw(string);
        }
    }

    @Keep
    @Subscribe(tags = {@Tag("tag.comment.reply.request"), @Tag("tag.weekly.comment,reply.request")})
    public void onNetworkRequestLifecycle(Bundle bundle) {
        KeyboardUtils.hideKeyboard(getContext(), this.mEditText);
        if (l.ACTION_STATE_SUCCESS.equals(bundle.getString("state"))) {
            resetInputEditText();
            UMengEventUtils.onEvent("ad_youpai_video_play_comment_page", "回复评论");
        }
    }

    private void bw(final String str) {
        Observable.timer(300L, TimeUnit.MILLISECONDS).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {
            @Override
            public void call(Long l) {
                if (ActivityStateUtils.isDestroy((Activity) GamePlayerVideoCommentFragment.this.getActivity()) || !GamePlayerVideoCommentFragment.this.caj) {
                    return;
                }
                KeyboardUtils.showKeyboard(GamePlayerVideoCommentFragment.this.mEditText, GamePlayerVideoCommentFragment.this.getContext());
                if (GamePlayerVideoCommentFragment.this.aoV.getVisibility() == 4) {
                    GamePlayerVideoCommentFragment.this.aoV.setVisibility(0);
                }
                GamePlayerVideoCommentFragment.this.mEditText.requestFocus();
                GamePlayerVideoCommentFragment.this.mEditText.setHint(str);
            }
        });
    }

    private void Hr() {
        if (this.apa == null) {
            this.apa = new GameCommentJsInterface(this.mWebView, getContext()) {
                @Override
                @JavascriptInterface
                public void onJsToProfileDetailsByPtUid(final String str) {
                    if (TextUtils.isEmpty(str)) {
                        return;
                    }
                    Observable.just(null).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Object>() {
                        @Override
                        public void call(Object obj) {
                            if (AnonymousClass9.this.mContext instanceof BaseActivity) {
                                ((BaseActivity) AnonymousClass9.this.mContext).getWindow().clearFlags(1024);
                            } else if (AnonymousClass9.this.mContext instanceof ContextThemeWrapper) {
                                Context baseContext = ((ContextThemeWrapper) AnonymousClass9.this.mContext).getBaseContext();
                                if (baseContext instanceof Activity) {
                                    ((Activity) baseContext).getWindow().clearFlags(1024);
                                }
                            }
                            Bundle bundle = new Bundle();
                            bundle.putString("intent.extra.goto.user.homepage.user.ptuid", str);
                            bundle.putString("intent.extra.tab.index", "video");
                            GameCenterRouterManager.getInstance().openUserHomePage(AnonymousClass9.this.mContext, bundle);
                        }
                    });
                }
            };
            this.mWebView.addJavascriptInterface(this.apa, "android");
        }
        if (this.cag) {
            this.apa.addWebRequestParam("positionPage", Integer.valueOf(this.cah ? 16 : 5));
            this.apa.addWebRequestParam(CachesTable.COLUMN_KEY, Integer.valueOf(this.cah ? this.mThreadId : this.mVideoId));
            this.apa.addWebRequestParam("commentId", Integer.valueOf(this.mCommentId));
            this.apa.addWebRequestParam("replyId", Integer.valueOf(this.mReplyId));
            this.apa.addWebRequestParam("videoName", this.cad);
            this.apa.addWebRequestParam("videoUid", this.cab);
        } else {
            this.apa.addWebRequestParam("positionPage", 9);
            this.apa.addWebRequestParam(CachesTable.COLUMN_KEY, Integer.valueOf(this.mVideoId));
            this.apa.addWebRequestParam("commentId", Integer.valueOf(this.mCommentId));
            this.apa.addWebRequestParam("replyId", Integer.valueOf(this.mReplyId));
        }
        this.apa.setActionListener(new GameCommentJsInterface.a() {
            @Override
            public void onDeleteComment() {
                Observable.just("").observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<String>() {
                    @Override
                    public void call(String str) {
                        if (GamePlayerVideoCommentFragment.this.cal != null) {
                            GamePlayerVideoCommentFragment.this.cal.deleteComment();
                        }
                    }
                });
            }
        });
    }

    public void setVideoInfo(int i, String str, String str2, int i2, boolean z, String str3, int i3, int i4) {
        this.mVideoId = i;
        this.cab = str;
        this.cad = str2;
        this.caf = z;
        this.cae = i2;
        this.cac = str3;
        this.mGameId = i3;
        this.mPostId = i4;
        bindBottomPraiseView(z, false, i2);
    }

    public void setCommentId(int i) {
        this.mCommentId = i;
    }

    public void setReplyId(int i) {
        this.mReplyId = i;
    }

    public int getVideoId() {
        return this.mVideoId;
    }

    public void resetInputEditText() {
        this.aoJ = null;
        com.m4399.gamecenter.plugin.main.utils.e.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (GamePlayerVideoCommentFragment.this.mEditText != null) {
                    GamePlayerVideoCommentFragment.this.mEditText.setText("");
                    GamePlayerVideoCommentFragment.this.mEditText.clearFocus();
                    GamePlayerVideoCommentFragment.this.mEditText.setHint(GamePlayerVideoCommentFragment.this.getString(R.string.gamehub_post_add_content_hint));
                }
            }
        });
        Ho();
        this.mCommentType = this.COMMENT_TYPE_NEW_COMMENT;
    }

    public void refreshComment() {
        this.mReplyId = 0;
        this.mCommentId = 0;
        Hr();
        this.mWebView.loadUrl("javascript:m_common.reload()");
    }

    public void loadPreView() {
        this.mWebView.loadUrl("javascript:m_common.clearPage()");
    }

    public void judgeShowKeyboard() {
        WebViewLayout webViewLayout = this.mWebView;
        if (webViewLayout != null) {
            webViewLayout.loadUrl("javascript:window.m_videoComment.showVideoComment()");
        }
    }

    public void setIsVideoPost(boolean z) {
        this.cah = z;
    }

    public void setThreadId(int i) {
        this.mThreadId = i;
    }

    public void setForumsId(int i) {
        this.mForumsId = i;
    }

    public void setQuanId(int i) {
        this.mQuanId = i;
    }

    public void setActivityId(long j) {
        this.cai = j;
    }

    public void setIsGamePlayerVideo(boolean z) {
        this.cag = z;
    }

    public void setOnActionListener(a aVar) {
        this.cal = aVar;
    }

    public void actionTouchVideo() {
        EditText editText;
        if (this.cal != null && !this.cak && (editText = this.mEditText) != null && TextUtils.isEmpty(editText.getText().toString())) {
            this.cal.hideCommentFragment();
        }
        hideKeyboard();
        Ho();
    }

    public void setFragmentShow(boolean z) {
        this.caj = z;
    }

    @Override
    public void onResume() {
        super.onResume();
        GameCommentJsInterface gameCommentJsInterface = this.apa;
        if (gameCommentJsInterface != null) {
            gameCommentJsInterface.onResume();
        }
    }
}