do not provide up navigation in publish account when in setup mode

This commit is contained in:
Daniel Gultsch 2018-10-23 21:25:38 +02:00
parent f9cafc144b
commit 185d36d270
2 changed files with 10 additions and 6 deletions

View file

@ -5,9 +5,13 @@ import android.support.v7.app.AppCompatActivity;
public abstract class ActionBarActivity extends AppCompatActivity { public abstract class ActionBarActivity extends AppCompatActivity {
public static void configureActionBar(ActionBar actionBar) { public static void configureActionBar(ActionBar actionBar) {
configureActionBar(actionBar, true);
}
public static void configureActionBar(ActionBar actionBar, boolean upNavigation) {
if (actionBar != null) { if (actionBar != null) {
actionBar.setHomeButtonEnabled(true); actionBar.setHomeButtonEnabled(upNavigation);
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(upNavigation);
} }
} }
} }

View file

@ -77,7 +77,6 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_publish_profile_picture); setContentView(R.layout.activity_publish_profile_picture);
setSupportActionBar(findViewById(R.id.toolbar)); setSupportActionBar(findViewById(R.id.toolbar));
configureActionBar(getSupportActionBar());
this.avatar = findViewById(R.id.account_image); this.avatar = findViewById(R.id.account_image);
this.cancelButton = findViewById(R.id.cancel_button); this.cancelButton = findViewById(R.id.cancel_button);
@ -158,12 +157,13 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
if (getIntent() != null) { final Intent intent = getIntent();
this.mInitialAccountSetup = getIntent().getBooleanExtra("setup", false); this.mInitialAccountSetup = intent != null && intent.getBooleanExtra("setup", false);
}
if (this.mInitialAccountSetup) { if (this.mInitialAccountSetup) {
this.cancelButton.setText(R.string.skip); this.cancelButton.setText(R.string.skip);
} }
configureActionBar(getSupportActionBar(), !this.mInitialAccountSetup);
} }
protected void loadImageIntoPreview(Uri uri) { protected void loadImageIntoPreview(Uri uri) {