QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

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


package com.tencent.mtt.searchresult.view.input;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.tencent.common.utils.UrlUtils;
import com.tencent.mm.ui.widget.dialog.MMTipsBar;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.browser.hotword.search.SearchHotwordManager;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.search.facade.ITKDSearchHotwordRequestCallback;
import com.tencent.mtt.setting.PublicSettingManager;
import qb.a.g;

public class InputViewGifController {

    private QBWebImageView f71300a;

    private boolean f71301b;

    public static class InputViewGifControllerHolder {

        public static final InputViewGifController f71304a = new InputViewGifController();

        private InputViewGifControllerHolder() {
        }
    }

    private InputViewGifController() {
        this.f71301b = false;
    }

    public static InputViewGifController a() {
        return InputViewGifControllerHolder.f71304a;
    }

    private String b(String str) {
        return UrlUtils.getUrlParamValue(str, "searchlight");
    }

    private void c() {
        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                SearchHotwordManager.a().a(true, new ITKDSearchHotwordRequestCallback() {
                    @Override
                    public void a(boolean z) {
                        PublicSettingManager.a().setBoolean("serach_gif_hot_words_get", z);
                    }
                }, (String) null);
            }
        }, MMTipsBar.DURATION_SHORT);
    }

    private boolean c(String str) {
        String urlParamValue = UrlUtils.getUrlParamValue(str, "jump_from");
        if ("".equals(urlParamValue)) {
            urlParamValue = UrlUtils.getUrlParamValue(str, "entryScene");
            if ("".equals(urlParamValue)) {
                return false;
            }
        }
        int i = PublicSettingManager.a().getInt("serach_gif_totalShowTimes", 0);
        if (i == 3) {
            return false;
        }
        if (PublicSettingManager.a().getBoolean("serach_gif_" + urlParamValue, false)) {
            return false;
        }
        PublicSettingManager.a().setInt("serach_gif_totalShowTimes", i + 1);
        PublicSettingManager.a().setBoolean("serach_gif_" + urlParamValue, true);
        return true;
    }

    public void a(Context context) {
        this.f71300a = new QBWebImageView(context);
        this.f71300a.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        this.f71300a.setPlaceHolderDrawableId(g.f85882a);
        this.f71300a.setUrl("https://static.res.qq.com/nav/search/search_inputbox_blue_strip.gif");
        SimpleSkinBuilder.a((ImageView) this.f71300a).f();
    }

    public void a(ISearchResultInputView iSearchResultInputView) {
        iSearchResultInputView.a(this.f71300a);
        if (!this.f71301b) {
            c();
        }
        this.f71301b = false;
        PlatformStatUtils.a("SEARCH_INPUTVIEW_GIF_SHOW");
    }

    public boolean a(String str) {
        if (SkinManager.s().l()) {
            return false;
        }
        String b2 = b(str);
        if ("2".equals(b2)) {
            this.f71301b = true;
            PlatformStatUtils.a("SEARCH_GIF_SEARCHLIGHT_FLAG_2");
            return true;
        }
        if ("1".equals(b2)) {
            return c(str);
        }
        return false;
    }

    public void b() {
        QBWebImageView qBWebImageView = this.f71300a;
        if (qBWebImageView != null) {
            qBWebImageView.f();
            this.f71300a.j();
            this.f71300a = null;
        }
    }
}