Search in sources :

Example 1 with ProfileEditFragment

use of com.example.flashgig.fragments.ProfileEditFragment 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);
}
Also used : ProfileEditFragment(com.example.flashgig.fragments.ProfileEditFragment) JobAdderFragment(com.example.flashgig.JobAdderFragment) SearchView(android.widget.SearchView) DetailFragment(com.example.flashgig.fragments.DetailFragment) DetailFragment(com.example.flashgig.fragments.DetailFragment) MessagesFragment(com.example.flashgig.fragments.MessagesFragment) ProfileFragment(com.example.flashgig.fragments.ProfileFragment) HomeFragment(com.example.flashgig.fragments.HomeFragment) MyJobsFragment(com.example.flashgig.fragments.MyJobsFragment) Fragment(androidx.fragment.app.Fragment) ProfileEditFragment(com.example.flashgig.fragments.ProfileEditFragment) JobAdderFragment(com.example.flashgig.JobAdderFragment)

Aggregations

SearchView (android.widget.SearchView)1 Fragment (androidx.fragment.app.Fragment)1 JobAdderFragment (com.example.flashgig.JobAdderFragment)1 DetailFragment (com.example.flashgig.fragments.DetailFragment)1 HomeFragment (com.example.flashgig.fragments.HomeFragment)1 MessagesFragment (com.example.flashgig.fragments.MessagesFragment)1 MyJobsFragment (com.example.flashgig.fragments.MyJobsFragment)1 ProfileEditFragment (com.example.flashgig.fragments.ProfileEditFragment)1 ProfileFragment (com.example.flashgig.fragments.ProfileFragment)1