正在查看: St.John's v1.0.9 应用的 GatePassTabbedActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: St.John's v1.0.9 应用的 GatePassTabbedActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mcb.stjohnsemschool.activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import com.mcb.stjohnsemschool.adapter.GatePassViewPagerAdapter;
import com.mcb.stjohnsemschool.interfaces.GatePassListener;
import com.mcb.stjohnsemschool.utils.TransparentProgressDialog;
public class GatePassTabbedActivity extends AppCompatActivity {
static SharedPreferences.Editor mEditor;
static SharedPreferences mSharedPref;
GatePassListener listener;
RecyclerView mGatePassRv;
TextView mNoDataTv;
TransparentProgressDialog mProgressbar;
String mStudentEnrollmentIDStr = "0";
String mAcademicYearIDStr = "0";
private int themeId = 1;
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_gate_pass_tabbed);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle("Gate Pass");
init();
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == 16908332) {
finish();
} else if (itemId == 2131361884) {
Intent intent = new Intent(getApplicationContext(), (Class<?>) RequestNewGatePassActivity.class);
intent.putExtra("multiple_dates", true);
startActivity(intent);
}
return super.onOptionsItemSelected(menuItem);
}
private void init() {
this.mProgressbar = new TransparentProgressDialog(this, R.drawable.spinner_loading_imag);
SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences("", 0);
mSharedPref = sharedPreferences;
mEditor = sharedPreferences.edit();
this.mStudentEnrollmentIDStr = mSharedPref.getString("studentEnrollmentIdKey", this.mStudentEnrollmentIDStr);
this.mAcademicYearIDStr = mSharedPref.getString("academicyearIdKey", this.mAcademicYearIDStr);
this.themeId = mSharedPref.getInt("ThemeIdKey", this.themeId);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.addTab(tabLayout.newTab().setText("PreApproved"));
tabLayout.addTab(tabLayout.newTab().setText("Pending"));
tabLayout.addTab(tabLayout.newTab().setText("History"));
tabLayout.setTabGravity(0);
tabLayout.setTabMode(1);
final ViewPager findViewById = findViewById(R.id.pager);
findViewById.setAdapter(new GatePassViewPagerAdapter(getSupportFragmentManager(), tabLayout.getTabCount()));
findViewById.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabSelected(TabLayout.Tab tab) {
findViewById.setCurrentItem(tab.getPosition());
}
});
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_new_gatepass, menu);
return super.onCreateOptionsMenu(menu);
}
}