mirror of https://github.com/M66B/FairEmail.git
Delegate compose back
This commit is contained in:
parent
66d718ffa2
commit
538cc943c6
|
@ -29,7 +29,9 @@ import android.os.Bundle;
|
|||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.TaskStackBuilder;
|
||||
import androidx.core.net.MailTo;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
@ -72,6 +74,15 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
|||
handle(intent, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == android.R.id.home &&
|
||||
getSupportFragmentManager().getBackStackEntryCount() > 0)
|
||||
return false; // Delegate to fragment
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackStackChanged() {
|
||||
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
|
||||
|
|
|
@ -2002,7 +2002,10 @@ public class FragmentCompose extends FragmentBase {
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.menu_encrypt) {
|
||||
if (itemId == android.R.id.home) {
|
||||
onExit();
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_encrypt) {
|
||||
onMenuEncrypt();
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_translate) {
|
||||
|
|
Loading…
Reference in New Issue