Search in sources :

Example 1 with WelcomeFragment

use of run.wallet.iota.ui.fragment.WelcomeFragment in project run-wallet-android by runplay.

the class MainActivity method onNavigationItemSelected.

@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
    Fragment fragment = null;
    getFragmentManager().popBackStack();
    switch(item.getItemId()) {
        case R.id.nav_wallet:
            showLogoutNavigationItem();
            if (Store.getCurrentSeed() != null) {
                if (!Store.isLoggedIn()) {
                    UiManager.checkPin(this);
                    killFragments = true;
                } else {
                    killFragments = true;
                    fragment = new WalletTabFragment();
                    appRate();
                }
            } else {
                killFragments = true;
                fragment = new WelcomeFragment();
            }
            break;
        case R.id.nav_choose_wallet:
            fragment = new ChooseSeedFragment();
            killFragments = true;
            break;
        case R.id.nav_node_info:
            fragment = new NetworkTabFragment();
            break;
        case R.id.nav_help:
            UiManager.openFragmentBackStack(this, HelpFragment.class);
            break;
        case R.id.nav_tor:
            UiManager.openFragmentBackStack(this, TorFragment.class);
            break;
        /*
            case R.id.nav_messaging:
                if (Store.isLoggedIn()) {
                    fragment = new MsgHomeFragment();
                    killFragments = true;
                }
                break;
                */
        case R.id.nav_settings:
            // UiManager.openFragmentBackStack(this,SettingsFragment.class);
            // fragment = new SettingsFragment();
            Intent settings = new Intent(MainActivity.this, SettingsActivity.class);
            startActivityForResult(settings, 0);
            break;
    }
    if (fragment != null) {
        showFragment(fragment, false, killFragments);
    }
    drawer.closeDrawer(GravityCompat.START);
    return true;
}
Also used : ChooseSeedFragment(run.wallet.iota.ui.fragment.ChooseSeedFragment) WelcomeFragment(run.wallet.iota.ui.fragment.WelcomeFragment) NetworkTabFragment(run.wallet.iota.ui.fragment.NetworkTabFragment) Intent(android.content.Intent) WalletTabFragment(run.wallet.iota.ui.fragment.WalletTabFragment) NetworkNodeInfoFragment(run.wallet.iota.ui.fragment.NetworkNodeInfoFragment) NetworkNodesFragment(run.wallet.iota.ui.fragment.NetworkNodesFragment) NetworkNodesAddFragment(run.wallet.iota.ui.fragment.NetworkNodesAddFragment) SnTrFragment(run.wallet.iota.ui.fragment.SnTrFragment) HelpFragment(run.wallet.iota.ui.fragment.HelpFragment) NetworkTabFragment(run.wallet.iota.ui.fragment.NetworkTabFragment) WalletAddressesFragment(run.wallet.iota.ui.fragment.WalletAddressesFragment) SettingsFragment(run.wallet.iota.ui.fragment.SettingsFragment) WelcomeFragment(run.wallet.iota.ui.fragment.WelcomeFragment) GenerateQRCodeFragment(run.wallet.iota.ui.fragment.GenerateQRCodeFragment) ChooseSeedFragment(run.wallet.iota.ui.fragment.ChooseSeedFragment) PasswordLoginFragment(run.wallet.iota.ui.fragment.PasswordLoginFragment) NetworkNeighborsFragment(run.wallet.iota.ui.fragment.NetworkNeighborsFragment) QRScannerFragment(run.wallet.iota.ui.fragment.QRScannerFragment) Fragment(android.app.Fragment) SeedLoginFragment(run.wallet.iota.ui.fragment.SeedLoginFragment) ColorFragment(run.wallet.iota.ui.fragment.ColorFragment) WalletTransfersFragment(run.wallet.iota.ui.fragment.WalletTransfersFragment) TorFragment(run.wallet.iota.ui.fragment.TorFragment) WalletTabFragment(run.wallet.iota.ui.fragment.WalletTabFragment) AboutFragment(run.wallet.iota.ui.fragment.AboutFragment)

Aggregations

Fragment (android.app.Fragment)1 Intent (android.content.Intent)1 AboutFragment (run.wallet.iota.ui.fragment.AboutFragment)1 ChooseSeedFragment (run.wallet.iota.ui.fragment.ChooseSeedFragment)1 ColorFragment (run.wallet.iota.ui.fragment.ColorFragment)1 GenerateQRCodeFragment (run.wallet.iota.ui.fragment.GenerateQRCodeFragment)1 HelpFragment (run.wallet.iota.ui.fragment.HelpFragment)1 NetworkNeighborsFragment (run.wallet.iota.ui.fragment.NetworkNeighborsFragment)1 NetworkNodeInfoFragment (run.wallet.iota.ui.fragment.NetworkNodeInfoFragment)1 NetworkNodesAddFragment (run.wallet.iota.ui.fragment.NetworkNodesAddFragment)1 NetworkNodesFragment (run.wallet.iota.ui.fragment.NetworkNodesFragment)1 NetworkTabFragment (run.wallet.iota.ui.fragment.NetworkTabFragment)1 PasswordLoginFragment (run.wallet.iota.ui.fragment.PasswordLoginFragment)1 QRScannerFragment (run.wallet.iota.ui.fragment.QRScannerFragment)1 SeedLoginFragment (run.wallet.iota.ui.fragment.SeedLoginFragment)1 SettingsFragment (run.wallet.iota.ui.fragment.SettingsFragment)1 SnTrFragment (run.wallet.iota.ui.fragment.SnTrFragment)1 TorFragment (run.wallet.iota.ui.fragment.TorFragment)1 WalletAddressesFragment (run.wallet.iota.ui.fragment.WalletAddressesFragment)1 WalletTabFragment (run.wallet.iota.ui.fragment.WalletTabFragment)1