mirror of https://github.com/M66B/FairEmail.git
Fixed back to unselect
This commit is contained in:
parent
6a0c23d012
commit
494162f97d
|
@ -170,10 +170,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
if (backHandled())
|
||||||
|
return;
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean backHandled() {
|
||||||
for (IBackPressedListener listener : backPressedListeners)
|
for (IBackPressedListener listener : backPressedListeners)
|
||||||
if (listener.onBackPressed())
|
if (listener.onBackPressed())
|
||||||
return;
|
return true;
|
||||||
super.onBackPressed();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IBackPressedListener {
|
public interface IBackPressedListener {
|
||||||
|
|
|
@ -539,7 +539,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
int count = getSupportFragmentManager().getBackStackEntryCount();
|
int count = getSupportFragmentManager().getBackStackEntryCount();
|
||||||
if (exit || count > 1)
|
if (exit || count > 1)
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
else {
|
else if (!backHandled()) {
|
||||||
exit = true;
|
exit = true;
|
||||||
Toast.makeText(this, R.string.app_exit, Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, R.string.app_exit, Toast.LENGTH_SHORT).show();
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
|
Loading…
Reference in New Issue