导航菜单

页面标题

页面副标题

Oolka v2.4.42 - FAQDetailsActivity.java 源代码

正在查看: Oolka v2.4.42 应用的 FAQDetailsActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.freshchat.consumer.sdk.activity;

import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.freshchat.consumer.sdk.Freshchat;
import com.freshchat.consumer.sdk.FreshchatWebViewListener;
import com.freshchat.consumer.sdk.R;
import com.freshchat.consumer.sdk.activity.ds;
import com.freshchat.consumer.sdk.service.Status;
import com.freshchat.consumer.sdk.util.cn;
import java.lang.ref.WeakReference;
import java.util.Locale;

public class FAQDetailsActivity extends ct<com.freshchat.consumer.sdk.l.s> implements ds.b {
    private ds ap;
    private View n;
    private boolean x = false;
    private String a = "about:blank";
    private final View.OnClickListener ah = new dc(this);
    private final View.OnClickListener D = new dd(this);
    private final WebViewClient C = new de(this);

    private void M() {
        b(((com.freshchat.consumer.sdk.l.s) this.eZ).kS());
    }

    private void N() {
        Toast.makeText((Context) this, R.string.freshchat_faq_failed_to_load, 0).show();
        finish();
    }

    private void cw() {
        if (((com.freshchat.consumer.sdk.l.s) this.eZ).ma()) {
            n();
        }
    }

    public void cx() {
        o();
        if (((com.freshchat.consumer.sdk.l.s) this.eZ).e()) {
            cy();
        }
    }

    private void cy() {
        a(false, this.ah);
        ((TextView) findViewById(R.id.freshchat_contact_us_btn)).setText(R.string.freshchat_faq_not_helpful_contact_us);
    }

    private void n() {
        Animation loadAnimation = AnimationUtils.loadAnimation(this, R.anim.freshchat_slide_up);
        this.n.bringToFront();
        this.n.startAnimation(loadAnimation);
        com.freshchat.consumer.sdk.b.o.c(this.n);
    }

    public void o() {
        if (com.freshchat.consumer.sdk.b.o.l(this.n)) {
            this.n.startAnimation(AnimationUtils.loadAnimation(this, R.anim.freshchat_slide_down));
            com.freshchat.consumer.sdk.b.o.d(this.n);
        }
    }

    private void p() {
        if (getSupportActionBar() != null) {
            getSupportActionBar().l();
        }
    }

    private void q() {
        if (getSupportActionBar() != null) {
            getSupportActionBar().z();
        }
    }

    public void r() {
        this.ap.postDelayed(new dg(this), 500L);
    }

    @Override
    public String[] J() {
        return new String[]{"com.freshchat.consumer.sdk.actions.FAQFetched", "com.freshchat.consumer.sdk.actions.FAQVoted"};
    }

    @Override
    public void K() {
        com.freshchat.consumer.sdk.l.s sVar = new com.freshchat.consumer.sdk.l.s(a());
        this.eZ = sVar;
        if (sVar.g(getIntent().getExtras())) {
            ((com.freshchat.consumer.sdk.l.s) this.eZ).h(getIntent());
        } else {
            N();
        }
    }

    @Override
    @NonNull
    public String L() {
        return ((com.freshchat.consumer.sdk.l.s) this.eZ).kT();
    }

    @Override
    public void O() {
        M();
    }

    @Override
    public String P() {
        return ((com.freshchat.consumer.sdk.l.s) this.eZ).P();
    }

    @Override
    @NonNull
    public View Q() {
        return this.ap;
    }

    @Override
    public void R() {
        String kX = ((com.freshchat.consumer.sdk.l.s) this.eZ).kX();
        if (com.freshchat.consumer.sdk.util.ds.c(kX)) {
            b(Status.ERROR);
        } else {
            this.ap.loadDataWithBaseURL(null, kX, "text/html", "utf-8", null);
            f(this.ap);
        }
    }

    @Override
    public void j() {
        cw();
    }

    @Override
    public void k() {
        o();
    }

    @Override
    public void l() {
        p();
        this.x = true;
        this.n.setVisibility(8);
    }

    @Override
    public void m() {
        q();
        r();
        this.x = false;
    }

    @Override
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        if (this.x) {
            return;
        }
        r();
    }

    @Override
    public void onCreate(Bundle bundle) {
        FreshchatWebViewListener webviewListener;
        super.onCreate(bundle);
        Locale cd = cn.cd(this);
        setContentView(R.layout.freshchat_activity_faq_details);
        w();
        ((com.freshchat.consumer.sdk.l.s) this.eZ).lX();
        if (bundle != null) {
            this.ap.restoreState(bundle);
        }
        M();
        Locale cd2 = cn.cd(this);
        if (cd == null || cd2 == null || !com.freshchat.consumer.sdk.util.ds.B(cd.getLanguage(), cd2.getLanguage()) || (webviewListener = Freshchat.getInstance(this).getWebviewListener()) == null) {
            return;
        }
        webviewListener.onLocaleChangedByWebView(new WeakReference<>(this));
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        ds dsVar = this.ap;
        if (dsVar != null) {
            dsVar.destroy();
        }
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i != 4 || !this.ap.cz()) {
            return super.onKeyDown(i, keyEvent);
        }
        this.ap.cA();
        return true;
    }

    @Override
    public void onPause() {
        super.onPause();
        if (com.freshchat.consumer.sdk.util.dz.kw() && com.freshchat.consumer.sdk.util.dz.kj()) {
            this.ap.onPause();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        if (com.freshchat.consumer.sdk.util.dz.kw() && com.freshchat.consumer.sdk.util.dz.kj()) {
            this.ap.onResume();
        }
    }

    public void onStart() {
        super.onStart();
        if (com.freshchat.consumer.sdk.util.dz.kr()) {
            this.ap.onResume();
        }
    }

    public void onStop() {
        super.onStop();
        if (com.freshchat.consumer.sdk.util.dz.kr()) {
            this.ap.onPause();
        }
        this.ap.stopLoading();
    }

    @Override
    public void w() {
        super.w();
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
        layoutParams.addRule(10, -1);
        ds dsVar = new ds(this);
        this.ap = dsVar;
        dsVar.setVisibility(8);
        this.ap.setWebViewClient(this.C);
        this.ap.a(this, 85);
        this.n = findViewById(R.id.freshchat_voting_view);
        View findViewById = findViewById(R.id.freshchat_upvote);
        View findViewById2 = findViewById(R.id.freshchat_downvote);
        findViewById.setOnClickListener(this.D);
        findViewById2.setOnClickListener(this.D);
        ((RelativeLayout) findViewById(R.id.freshchat_solution_article_root_layout)).addView(this.ap.getLayout(), layoutParams);
    }

    @Override
    public void a(Context context, Intent intent) {
        if ("com.freshchat.consumer.sdk.actions.FAQFetched".equals(intent.getAction())) {
            b(((com.freshchat.consumer.sdk.l.s) this.eZ).h(intent.getExtras()));
            if (((com.freshchat.consumer.sdk.l.s) this.eZ).mb()) {
                cy();
                return;
            }
            return;
        }
        if ("android.net.conn.CONNECTIVITY_CHANGE".equals(intent.getAction())) {
            b(((com.freshchat.consumer.sdk.l.s) this.eZ).kP());
        } else if ("com.freshchat.consumer.sdk.actions.FAQVoted".equals(intent.getAction())) {
            b(intent.getExtras());
        }
    }

    @Override
    public String[] b() {
        return new String[]{"com.freshchat.consumer.sdk.actions.TokenWaitTimeout", "com.freshchat.consumer.sdk.actions.FAQApiVersionChanged"};
    }

    private void b(Bundle bundle) {
        if (((com.freshchat.consumer.sdk.l.s) this.eZ).i(bundle)) {
            Toast.makeText(a(), R.string.freshchat_faq_vote_successful, 1).show();
        }
    }
}