导航菜单

页面标题

页面副标题

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

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

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


package com.mcb.stjohnsemschool.activity;

import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.analytics.FirebaseAnalytics;

public class DetailLibraryActivity extends AppCompatActivity {
    private static final String TAG = "com.mcb.stjohnsemschool.activity.DetailLibraryActivity";
    private TextView accessNum_tv;
    private TextView author_tv;
    private TextView bookTitle_tv;
    Context context;
    private Typeface fontMuseo;
    SharedPreferences.Editor mEditor;
    SharedPreferences mSharedPref;
    private AppCompatActivity myActivity;
    private TextView reservedDate_tv;
    private TextView returnDate_tv;
    private TextView status_tv;
    private TextView tittle;
    private String bookTitle = "";
    private String author = "";
    private String status = "";
    private String reservedDate = "";
    private String returnDate = "";
    private String accessNum = "";

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_library_details);
        setUpIds();
    }

    private void setUpIds() {
        Context applicationContext = getApplicationContext();
        this.context = applicationContext;
        SharedPreferences sharedPreferences = applicationContext.getSharedPreferences("", 0);
        this.mSharedPref = sharedPreferences;
        this.mEditor = sharedPreferences.edit();
        this.myActivity = this;
        this.bookTitle = getIntent().getStringExtra("BookTitle");
        this.author = getIntent().getStringExtra("Author");
        this.status = getIntent().getStringExtra("BookStatus");
        this.reservedDate = getIntent().getStringExtra("IssueDate");
        this.returnDate = getIntent().getStringExtra("ReturnDate");
        this.accessNum = getIntent().getStringExtra("AccessNumber");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowTitleEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setTitle(this.bookTitle);
        this.fontMuseo = Typeface.createFromAsset(getAssets(), "Roboto-Regular.ttf");
        this.bookTitle_tv = (TextView) findViewById(R.id.book_title);
        this.author_tv = (TextView) findViewById(R.id.author_name);
        this.status_tv = (TextView) findViewById(R.id.book_status);
        this.reservedDate_tv = (TextView) findViewById(R.id.reserved_date);
        this.returnDate_tv = (TextView) findViewById(R.id.returned_date);
        this.accessNum_tv = (TextView) findViewById(R.id.access_num);
        this.bookTitle_tv.setTypeface(this.fontMuseo);
        this.author_tv.setTypeface(this.fontMuseo);
        this.status_tv.setTypeface(this.fontMuseo);
        this.reservedDate_tv.setTypeface(this.fontMuseo);
        this.returnDate_tv.setTypeface(this.fontMuseo);
        this.accessNum_tv.setTypeface(this.fontMuseo);
        this.bookTitle_tv.setText("Book Title: " + this.bookTitle);
        this.author_tv.setText("Author: " + this.author);
        if (this.status.equalsIgnoreCase("returned")) {
            this.status_tv.setText("Status: " + this.status);
            this.status_tv.setTextColor(this.context.getResources().getColor(R.color.ColorPrimary));
        } else {
            this.status_tv.setText("Status: " + this.status);
            this.status_tv.setTextColor(this.context.getResources().getColor(R.color.red));
        }
        this.reservedDate_tv.setText("Issue Date: " + this.reservedDate);
        this.returnDate_tv.setText("Return Date: " + this.returnDate);
        this.accessNum_tv.setText("Access Number: " + this.accessNum);
    }

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

    protected void onResume() {
        super.onResume();
        String string = this.mSharedPref.getString("usernamekey", "");
        Bundle bundle = new Bundle();
        bundle.putString("user_name", string);
        FirebaseAnalytics.getInstance(this).logEvent("PAGE_DETAIL_LIBRARY", bundle);
    }
}