From 185d36d270e491a63000935f611b962a8a206e5a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 23 Oct 2018 21:25:38 +0200 Subject: [PATCH] do not provide up navigation in publish account when in setup mode --- .../java/eu/siacs/conversations/ui/ActionBarActivity.java | 8 ++++++-- .../conversations/ui/PublishProfilePictureActivity.java | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java b/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java index 72a89ab2c..5741d4502 100644 --- a/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java @@ -5,9 +5,13 @@ import android.support.v7.app.AppCompatActivity; public abstract class ActionBarActivity extends AppCompatActivity { public static void configureActionBar(ActionBar actionBar) { + configureActionBar(actionBar, true); + } + + public static void configureActionBar(ActionBar actionBar, boolean upNavigation) { if (actionBar != null) { - actionBar.setHomeButtonEnabled(true); - actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setHomeButtonEnabled(upNavigation); + actionBar.setDisplayHomeAsUpEnabled(upNavigation); } } } \ No newline at end of file diff --git a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java index 9df669923..6dadf5e95 100644 --- a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java @@ -77,7 +77,6 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC super.onCreate(savedInstanceState); setContentView(R.layout.activity_publish_profile_picture); setSupportActionBar(findViewById(R.id.toolbar)); - configureActionBar(getSupportActionBar()); this.avatar = findViewById(R.id.account_image); this.cancelButton = findViewById(R.id.cancel_button); @@ -158,12 +157,13 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC @Override protected void onStart() { super.onStart(); - if (getIntent() != null) { - this.mInitialAccountSetup = getIntent().getBooleanExtra("setup", false); - } + final Intent intent = getIntent(); + this.mInitialAccountSetup = intent != null && intent.getBooleanExtra("setup", false); + if (this.mInitialAccountSetup) { this.cancelButton.setText(R.string.skip); } + configureActionBar(getSupportActionBar(), !this.mInitialAccountSetup); } protected void loadImageIntoPreview(Uri uri) {