Android Open Source - notify Display Fragments






From Project

Back to project page notify.

License

The source code is released under:

GNU General Public License

If you think the Android project notify listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.notify;
/*from   w ww. j  a v a2  s. c  o m*/
import android.app.Fragment;
import android.app.FragmentTransaction;

public class DisplayFragments {
    public void setFragment(Fragment f) {
        this.setFragment(f, true);
    }

    public void setFragment(Fragment f, Boolean log) {
        if (!MainActivity.isOpen) {
            return;
        }
        FragmentTransaction ft = MainActivity.ma.fm.beginTransaction();
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
        ft.replace(R.id.fragment_container, f, "fc");
        ft.commitAllowingStateLoss();

        if (log) {
            if (MainActivity.ma.displayList.size() > 1 && f.getClass().toString().equals(MainActivity.ma.displayList.get(MainActivity.ma.displayList.size() - 1).getClass().toString())) {
                return;
            }
            MainActivity.ma.displayList.add(f);
        }
    }

    public void displayConnect() {
        MainActivity.ma.displayList.clear();
        this.setFragment(new FragmentConnect());
    }

    public void displayConnecting() {
        this.setFragment(new FragmentConnecting(), false);
    }

    public void displayConnected() {
        MainActivity.ma.displayList.clear();
        MainActivity.ma.displayList.add(new FragmentConnect());
        this.setFragment(new FragmentConnected());
    }

    public void displayReconnect(Boolean died) {
        this.setFragment(new FragmentReconnect(died));
    }

    public void displayAccessibility() {
        this.setFragment(new FragmentAccessibility());
    }

    public void displayBroadcastReconnect() {
        this.setFragment(new FragmentBroadcastReconnect());
    }

    public void displayQrcodeWrong() {
        this.setFragment(new FragmentQrcodeWrong());
    }

    public void displayNoQrcodeScanner() {
        this.setFragment(new FragmentNoQrcodeScanner());
    }

    public void displayManual() {
        this.setFragment(new FragmentManual());
    }

    public void displayWifiWarning() {
        this.setFragment(new FragmentWifiWarning());
    }
}




Java Source Code List

com.example.notify.AccessibilityListenerService.java
com.example.notify.BackgroundService.java
com.example.notify.Broadcast.java
com.example.notify.DisplayFragments.java
com.example.notify.EnumMessage.java
com.example.notify.FragmentAccessibility.java
com.example.notify.FragmentBroadcastReconnect.java
com.example.notify.FragmentConnect.java
com.example.notify.FragmentConnected.java
com.example.notify.FragmentConnecting.java
com.example.notify.FragmentManual.java
com.example.notify.FragmentNoQrcodeScanner.java
com.example.notify.FragmentQrcodeWrong.java
com.example.notify.FragmentReconnect.java
com.example.notify.FragmentWifiWarning.java
com.example.notify.IntentBroadcastReceiver.java
com.example.notify.MainActivity.java
com.example.notify.OurUtils.java