mirror of https://github.com/M66B/FairEmail.git
Added back navigation
This commit is contained in:
parent
85ed6d9a1f
commit
701c2d6121
|
@ -30,6 +30,7 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -96,6 +97,8 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
|
||||||
fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro");
|
fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro");
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
|
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
getSupportFragmentManager().addOnBackStackChangedListener(this);
|
getSupportFragmentManager().addOnBackStackChangedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,8 +114,7 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackStackChanged() {
|
public void onBackStackChanged() {
|
||||||
int count = getSupportFragmentManager().getBackStackEntryCount();
|
if (getSupportFragmentManager().getBackStackEntryCount() == 0)
|
||||||
if (count == 0)
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,6 +148,18 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
static String getSkuPro() {
|
static String getSkuPro() {
|
||||||
if (BuildConfig.DEBUG)
|
if (BuildConfig.DEBUG)
|
||||||
|
|
Loading…
Reference in New Issue