Don't let a user accidentally exit the setup wizard if they chose to use it

This commit is contained in:
str4d
2014-08-20 05:26:10 +00:00
parent 52833162d4
commit cd25f25191
2 changed files with 14 additions and 1 deletions

1
TODO
View File

@@ -6,7 +6,6 @@ Fixes:
-- Show full network error? Make it copy-able?
Tasks:
- Add a "do you want to skip tutorial" dialog to back button
- More layouts for intro and setup (tune for each screen size)
- Create and bundle better network status icons
- Subclass EmailListFragment for each default mailbox

View File

@@ -7,6 +7,7 @@ import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import i2p.bote.android.R;
import i2p.bote.android.config.EditIdentityActivity;
@@ -18,6 +19,12 @@ public class SetupActivity extends ActionBarActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setup);
// If a user has chosen to enter the setup wizard, don't let them
// accidentally exit it early.
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(false);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new SetPasswordFragment())
@@ -25,6 +32,13 @@ public class SetupActivity extends ActionBarActivity {
}
}
@Override
public void onBackPressed() {
// If a user has chosen to enter the setup wizard, don't let them
// accidentally exit it early.
Toast.makeText(this, R.string.please_finish_setup, Toast.LENGTH_SHORT).show();
}
/**
* Set password.