kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix back navigation issues when creating an initial profile.
rodzic
b92dd19a4c
commit
6bbd941158
|
@ -6,7 +6,9 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
|
||||
import org.thoughtcrime.securesms.BaseActivity;
|
||||
|
@ -64,6 +66,14 @@ public class EditProfileActivity extends BaseActivity implements EditProfileFrag
|
|||
.add(R.id.fragment_container, fragment)
|
||||
.commit();
|
||||
}
|
||||
|
||||
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
|
||||
@Override public void handleOnBackPressed() {
|
||||
if (!Navigation.findNavController(EditProfileActivity.this, R.id.fragment_container).popBackStack()) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,6 +53,9 @@ import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.NEXT_
|
|||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.NEXT_INTENT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.SHOW_TOOLBAR;
|
||||
|
||||
/**
|
||||
* Used for profile creation during registration.
|
||||
*/
|
||||
public class EditProfileFragment extends LoggingFragment {
|
||||
|
||||
private static final String TAG = Log.tag(EditProfileFragment.class);
|
||||
|
|
Ładowanie…
Reference in New Issue