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 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);
}
}
}

View File

@ -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) {