use of com.example.flashgig.JobAdderFragment in project FIREBASE_TEST_JAVA by essantos8.
the class MainActivity method onBackPressed.
@Override
public void onBackPressed() {
Fragment curFragment = getSupportFragmentManager().findFragmentById(R.id.frameLayout);
if (curFragment instanceof DetailFragment || curFragment instanceof JobAdderFragment || curFragment instanceof ProfileEditFragment) {
super.onBackPressed();
return;
}
SearchView searchBar = findViewById(R.id.searchviewHome);
if (searchBar != null) {
if (!searchBar.isIconified()) {
searchBar.setIconified(true);
searchBar.onActionViewCollapsed();
return;
}
}
this.moveTaskToBack(true);
}
use of com.example.flashgig.JobAdderFragment in project FIREBASE_TEST_JAVA by essantos8.
the class ProfileFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentProfileBinding.inflate(inflater, container, false);
progressBar = binding.progressBar;
textName = binding.textName;
textEmail = binding.textEmail;
textPhone = binding.textPhone;
profilePicture = binding.ProfilePic;
retrieveInfo(false);
binding.btnEditProfile.setOnClickListener(view -> {
// startActivity(new Intent(getContext(), ProfileEditActivity.class));
replaceFragment(new ProfileEditFragment(), "profileEdit");
});
binding.btnProfileAddJob.setOnClickListener(view -> {
// startActivity(new Intent(getContext(), JobAdderActivity.class));
replaceFragment(new JobAdderFragment(), "jobAdder");
});
binding.btnReviews.setOnClickListener(view -> {
startActivity(new Intent(getContext(), ReviewsActivity.class));
});
binding.btnProfileUpdate.setOnClickListener(view -> {
retrieveInfo(true);
});
binding.btnLogout.setOnClickListener(view -> {
FirebaseAuth.getInstance().signOut();
db.clearPersistence();
Toast.makeText(this.getContext(), "User logged out!", Toast.LENGTH_SHORT).show();
getActivity().finish();
startActivity(new Intent(getContext(), SplashActivity.class));
});
// Inflate the layout for this fragment
return binding.getRoot();
}
Aggregations