正在查看: eFriend v2.0.21 应用的 Dashboard.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: eFriend v2.0.21 应用的 Dashboard.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.projectx.activities;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;
import com.google.android.material.navigation.NavigationView;
import com.projectx.EntryPointActivity;
import com.projectx.R;
import com.projectx.fragments.AboutUs;
import com.projectx.fragments.AchievmentsView;
import com.projectx.fragments.BloodInfo;
import com.projectx.fragments.HomeView;
import com.projectx.fragments.SearchDonorFragment;
public class Dashboard extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private TextView getUserEmail;
private TextView getUserName;
private ProgressDialog pd;
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_dashboard);
ProgressDialog progressDialog = new ProgressDialog(this);
this.pd = progressDialog;
progressDialog.setMessage("Loading...");
this.pd.setCancelable(true);
this.pd.setCanceledOnTouchOutside(false);
this.getUserEmail = (TextView) findViewById(R.id.UserEmailView);
this.getUserName = (TextView) findViewById(R.id.UserNameView);
findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Dashboard.this.startActivity(new Intent((Context) Dashboard.this, (Class<?>) PostActivity.class));
}
});
findViewById(R.id.drawer_layout);
NavigationView findViewById = findViewById(R.id.nav_view);
findViewById.setNavigationItemSelectedListener(this);
View headerView = findViewById.getHeaderView(0);
this.getUserEmail = (TextView) headerView.findViewById(R.id.UserEmailView);
this.getUserName = (TextView) headerView.findViewById(R.id.UserNameView);
if (bundle == null) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new HomeView()).commit();
findViewById.getMenu().getItem(0).setChecked(true);
}
}
public void onBackPressed() {
DrawerLayout findViewById = findViewById(R.id.drawer_layout);
if (findViewById.isDrawerOpen(8388611)) {
findViewById.closeDrawer(8388611);
} else {
super.onBackPressed();
}
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.dashboard, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == R.id.donateinfo) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new BloodInfo()).commit();
}
if (itemId == R.id.devinfo) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new AboutUs()).commit();
}
return super.onOptionsItemSelected(menuItem);
}
public boolean onNavigationItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == R.id.home) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new HomeView()).commit();
} else if (itemId == R.id.userprofile) {
startActivity(new Intent(getApplicationContext(), (Class<?>) ProfileActivity.class));
} else if (itemId == R.id.user_achiev) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new AchievmentsView()).commit();
} else if (itemId == R.id.logout) {
startActivity(new Intent(getApplicationContext(), (Class<?>) EntryPointActivity.class));
} else if (itemId == R.id.blood_storage) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new SearchDonorFragment()).commit();
} else if (itemId == R.id.nearby_hospital) {
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentcontainer, new SearchDonorFragment()).commit();
}
findViewById(R.id.drawer_layout).closeDrawer(8388611);
return true;
}
protected void onStart() {
super.onStart();
startActivity(new Intent(getApplicationContext(), (Class<?>) EntryPointActivity.class));
finish();
}
protected void onResume() {
super.onResume();
startActivity(new Intent(getApplicationContext(), (Class<?>) EntryPointActivity.class));
finish();
}
}