use of androidx.navigation.fragment.NavHostFragment in project Signal-Android by WhisperSystems.
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);
}
}
}
use of androidx.navigation.fragment.NavHostFragment in project Signal-Android by WhisperSystems.
the class AddGroupDetailsActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle bundle, boolean ready) {
theme.onCreate(this);
setContentView(R.layout.add_group_details_activity);
if (bundle == null) {
ArrayList<RecipientId> recipientIds = getIntent().getParcelableArrayListExtra(EXTRA_RECIPIENTS);
AddGroupDetailsFragmentArgs arguments = new AddGroupDetailsFragmentArgs.Builder(recipientIds.toArray(new RecipientId[0])).build();
NavHostFragment fragment = NavHostFragment.create(R.navigation.create_group, arguments.toBundle());
getSupportFragmentManager().beginTransaction().replace(R.id.nav_host_fragment, fragment).commit();
}
}
use of androidx.navigation.fragment.NavHostFragment in project Signal-Android by signalapp.
the class AddGroupDetailsActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle bundle, boolean ready) {
theme.onCreate(this);
setContentView(R.layout.add_group_details_activity);
if (bundle == null) {
ArrayList<RecipientId> recipientIds = getIntent().getParcelableArrayListExtra(EXTRA_RECIPIENTS);
AddGroupDetailsFragmentArgs arguments = new AddGroupDetailsFragmentArgs.Builder(recipientIds.toArray(new RecipientId[0])).build();
NavHostFragment fragment = NavHostFragment.create(R.navigation.create_group, arguments.toBundle());
getSupportFragmentManager().beginTransaction().replace(R.id.nav_host_fragment, fragment).commit();
}
}
Aggregations