Search in sources :

Example 1 with NavGraph

use of androidx.navigation.NavGraph in project Signal-Android by WhisperSystems.

the class CreateKbsPinActivity method onCreate.

@Override
public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    if (KeyCachingService.isLocked(this)) {
        startActivity(getPromptPassphraseIntent());
        finish();
        return;
    }
    dynamicTheme.onCreate(this);
    setContentView(R.layout.create_kbs_pin_activity);
    CreateKbsPinFragmentArgs arguments = CreateKbsPinFragmentArgs.fromBundle(getIntent().getExtras());
    NavGraph graph = Navigation.findNavController(this, R.id.nav_host_fragment).getGraph();
    Navigation.findNavController(this, R.id.nav_host_fragment).setGraph(graph, arguments.toBundle());
}
Also used : NavGraph(androidx.navigation.NavGraph)

Example 2 with NavGraph

use of androidx.navigation.NavGraph in project Signal-Android by WhisperSystems.

the class ChatWallpaperActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState, boolean ready) {
    ChatWallpaperViewModel.Factory factory = new ChatWallpaperViewModel.Factory(getIntent().getParcelableExtra(EXTRA_RECIPIENT_ID));
    ViewModelProviders.of(this, factory).get(ChatWallpaperViewModel.class);
    dynamicTheme.onCreate(this);
    setContentView(R.layout.chat_wallpaper_activity);
    if (savedInstanceState == null) {
        Bundle extras = getIntent().getExtras();
        NavGraph graph = Navigation.findNavController(this, R.id.nav_host_fragment).getGraph();
        Navigation.findNavController(this, R.id.nav_host_fragment).setGraph(graph, extras != null ? extras : new Bundle());
    }
}
Also used : Bundle(android.os.Bundle) NavGraph(androidx.navigation.NavGraph)

Example 3 with NavGraph

use of androidx.navigation.NavGraph in project Signal-Android by signalapp.

the class ManageProfileActivity method onCreate.

@Override
public void onCreate(Bundle bundle, boolean ready) {
    dynamicTheme.onCreate(this);
    setContentView(R.layout.manage_profile_activity);
    if (bundle == null) {
        Bundle extras = getIntent().getExtras();
        // noinspection ConstantConditions
        NavController navController = ((NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment)).getNavController();
        NavGraph graph = navController.getGraph();
        navController.setGraph(graph, extras != null ? extras : new Bundle());
        if (extras != null && extras.getBoolean(START_AT_USERNAME, false)) {
            NavDirections action = ManageProfileFragmentDirections.actionManageUsername();
            SafeNavigation.safeNavigate(navController, action);
        }
        if (extras != null && extras.getBoolean(START_AT_AVATAR, false)) {
            NavDirections action = ManageProfileFragmentDirections.actionManageProfileFragmentToAvatarPicker(null, null);
            SafeNavigation.safeNavigate(navController, action);
        }
    }
}
Also used : Bundle(android.os.Bundle) NavController(androidx.navigation.NavController) NavGraph(androidx.navigation.NavGraph) NavHostFragment(androidx.navigation.fragment.NavHostFragment) NavDirections(androidx.navigation.NavDirections)

Example 4 with NavGraph

use of androidx.navigation.NavGraph in project Signal-Android by signalapp.

the class CreateKbsPinActivity method onCreate.

@Override
public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    if (KeyCachingService.isLocked(this)) {
        startActivity(getPromptPassphraseIntent());
        finish();
        return;
    }
    dynamicTheme.onCreate(this);
    setContentView(R.layout.create_kbs_pin_activity);
    CreateKbsPinFragmentArgs arguments = CreateKbsPinFragmentArgs.fromBundle(getIntent().getExtras());
    NavGraph graph = Navigation.findNavController(this, R.id.nav_host_fragment).getGraph();
    Navigation.findNavController(this, R.id.nav_host_fragment).setGraph(graph, arguments.toBundle());
}
Also used : NavGraph(androidx.navigation.NavGraph)

Example 5 with NavGraph

use of androidx.navigation.NavGraph in project Signal-Android by signalapp.

the class ChatWallpaperActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState, boolean ready) {
    ChatWallpaperViewModel.Factory factory = new ChatWallpaperViewModel.Factory(getIntent().getParcelableExtra(EXTRA_RECIPIENT_ID));
    ViewModelProviders.of(this, factory).get(ChatWallpaperViewModel.class);
    dynamicTheme.onCreate(this);
    setContentView(R.layout.chat_wallpaper_activity);
    if (savedInstanceState == null) {
        Bundle extras = getIntent().getExtras();
        NavGraph graph = Navigation.findNavController(this, R.id.nav_host_fragment).getGraph();
        Navigation.findNavController(this, R.id.nav_host_fragment).setGraph(graph, extras != null ? extras : new Bundle());
    }
}
Also used : Bundle(android.os.Bundle) NavGraph(androidx.navigation.NavGraph)

Aggregations

NavGraph (androidx.navigation.NavGraph)6 Bundle (android.os.Bundle)4 NavController (androidx.navigation.NavController)2 NavDirections (androidx.navigation.NavDirections)2 NavHostFragment (androidx.navigation.fragment.NavHostFragment)2