导航菜单

页面标题

页面副标题

St.John's v1.0.9 - DynamicFormWebviewActivity.java 源代码

正在查看: St.John's v1.0.9 应用的 DynamicFormWebviewActivity.java JAVA 源代码文件

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


package com.mcb.stjohnsemschool.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import com.mcb.stjohnsemschool.utils.TransparentProgressDialog;
import im.delight.android.webview.AdvancedWebView;

public class DynamicFormWebviewActivity extends AppCompatActivity implements AdvancedWebView.Listener {
    private static final String TAG = "DynamicFormWebviewActivity";
    private Activity activity;
    private Context context;
    int formId;
    TransparentProgressDialog mProgressbar;
    private AdvancedWebView web;
    String formName = "";
    String disclaimer = "";
    String userId = "0";
    String studentEnrolmentId = "0";
    String orgId = "0";
    String academicYearId = "0";

    public void onDownloadRequested(String str, String str2, String str3, long j, String str4, String str5) {
    }

    public void onExternalPageRequest(String str) {
    }

    public void onPageError(int i, String str, String str2) {
    }

    public void onPageStarted(String str, Bitmap bitmap) {
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_dynamic_form_webview);
        this.activity = this;
        this.context = getApplicationContext();
        Bundle extras = getIntent().getExtras();
        this.formName = extras.getString("FormName", this.formName);
        this.disclaimer = extras.getString("Disclaimer", this.disclaimer);
        this.formId = extras.getInt("FormId", this.formId);
        getSupportActionBar().setTitle("Dynamic Form");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        this.mProgressbar = new TransparentProgressDialog(this, R.drawable.spinner_loading_imag);
        SharedPreferences sharedPreferences = this.context.getSharedPreferences("", 0);
        this.userId = sharedPreferences.getString("UseridKey", this.userId);
        this.studentEnrolmentId = sharedPreferences.getString("studentEnrollmentIdKey", this.studentEnrolmentId);
        this.orgId = sharedPreferences.getString("orgnizationIdKey", this.orgId);
        this.academicYearId = sharedPreferences.getString("academicyearIdKey", this.academicYearId);
        String str = getString(R.string.payonline_url) + "/signin/DynamicFormReport_Student_App?FormID=" + this.formId + "&StudentEnrollmentID=" + this.studentEnrolmentId + "&AcademicYearID=" + this.academicYearId;
        AdvancedWebView findViewById = findViewById(2131364517);
        this.web = findViewById;
        findViewById.setListener(this, this);
        this.web.loadUrl(str);
        TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
        if (transparentProgressDialog == null || transparentProgressDialog.isShowing()) {
            return;
        }
        this.mProgressbar.show();
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == 16908332) {
            finish();
        }
        return super.onOptionsItemSelected(menuItem);
    }

    protected void onResume() {
        super.onResume();
        this.web.onResume();
    }

    protected void onPause() {
        this.web.onPause();
        super.onPause();
    }

    protected void onDestroy() {
        this.web.onDestroy();
        super.onDestroy();
    }

    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        this.web.onActivityResult(i, i2, intent);
    }

    public void onBackPressed() {
        if (this.web.onBackPressed()) {
            super.onBackPressed();
        }
    }

    public void onPageFinished(String str) {
        TransparentProgressDialog transparentProgressDialog = this.mProgressbar;
        if (transparentProgressDialog == null || !transparentProgressDialog.isShowing()) {
            return;
        }
        this.mProgressbar.dismiss();
    }
}