导航菜单

页面标题

页面副标题

Delta Chat v1.58.3 - ConnectivityActivity.java 源代码

正在查看: Delta Chat v1.58.3 应用的 ConnectivityActivity.java JAVA 源代码文件

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


package org.thoughtcrime.securesms;

import android.os.Bundle;
import android.view.Menu;
import com.b44t.messenger.DcEvent;
import org.thoughtcrime.securesms.connect.DcEventCenter;
import org.thoughtcrime.securesms.connect.DcHelper;

public class ConnectivityActivity extends WebViewActivity implements DcEventCenter.DcEventDelegate {
    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        return true;
    }

    @Override
    public boolean runOnMain() {
        return DcEventCenter.DcEventDelegate.CC.$default$runOnMain(this);
    }

    @Override
    protected void onCreate(Bundle bundle, boolean z) {
        super.onCreate(bundle, z);
        setForceDark();
        getSupportActionBar().setTitle(R.string.connectivity);
        refresh();
        DcHelper.getEventCenter(this).addObserver(2100, this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        DcHelper.getEventCenter(this).removeObservers(this);
    }

    private void refresh() {
        this.webView.loadDataWithBaseURL(null, DcHelper.getContext(this).getConnectivityHtml().replace("</style>", " html { color-scheme: dark light; }</style>"), "text/html", "utf-8", null);
    }

    @Override
    public void handleEvent(DcEvent dcEvent) {
        refresh();
    }
}