aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-24 20:49:34 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-24 20:49:34 +0200
commit7cc71094dae503863a3e75bc60da4418e81e193d (patch)
tree0303a77b75e50bdcd62f28555fc33f9dd946255f
parent549548de54e903b59a6601b0f0a015403e8f7708 (diff)
do not provide up navigation in publish account when in setup mode
-rw-r--r--src/main/java/de/pixart/messenger/ui/ActionBarActivity.java8
-rw-r--r--src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ActionBarActivity.java b/src/main/java/de/pixart/messenger/ui/ActionBarActivity.java
index 997edaac3..06dad3d13 100644
--- a/src/main/java/de/pixart/messenger/ui/ActionBarActivity.java
+++ b/src/main/java/de/pixart/messenger/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);
}
}
}
diff --git a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java
index a6f158646..9d6df3980 100644
--- a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java
+++ b/src/main/java/de/pixart/messenger/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) {