aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-11-15 21:15:20 +0100
committerChristian Schneppe <christian@pix-art.de>2018-11-15 21:15:20 +0100
commit5cd09d7cc41ee46ab53dd2b46c7b2cbd47b78d6e (patch)
tree19cf3ce5fd40fb8aaa408b49377195aae2ca8993 /src/main/java/de/pixart/messenger
parente05df83a2a3260f1b04c36ff270ea2c3f2b5a64c (diff)
do not show up navigation when opening edit account from notification
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java20
2 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 99ba3ddfe..053685fc6 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -107,7 +107,7 @@ public class NotificationService {
}
@RequiresApi(api = Build.VERSION_CODES.O)
- public void initializeChannels() {
+ void initializeChannels() {
final Context c = mXmppConnectionService;
final NotificationManager notificationManager = c.getSystemService(NotificationManager.class);
if (notificationManager == null) {
@@ -969,6 +969,7 @@ public class NotificationService {
} else {
intent = new Intent(mXmppConnectionService, EditAccountActivity.class);
intent.putExtra("jid", errors.get(0).getJid().asBareJid().toEscapedString());
+ intent.putExtra(EditAccountActivity.EXTRA_OPENED_FROM_NOTIFICATION, true);
}
mBuilder.setContentIntent(PendingIntent.getActivity(mXmppConnectionService, 145, intent, PendingIntent.FLAG_UPDATE_CURRENT));
if (Compatibility.runsTwentySix()) {
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 426627510..5daaafacd 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -81,6 +81,8 @@ import rocks.xmpp.addr.Jid;
public class EditAccountActivity extends OmemoActivity implements OnAccountUpdate, OnUpdateBlocklist,
OnKeyStatusUpdated, OnCaptchaRequested, KeyChainAliasCallback, XmppConnectionService.OnShowErrorToast, XmppConnectionService.OnMamPreferencesFetched {
+ public static final String EXTRA_OPENED_FROM_NOTIFICATION = "opened_from_notification";
+
private static final int REQUEST_DATA_SAVER = 0xf244;
private static final int REQUEST_CHANGE_STATUS = 0xee11;
@@ -673,23 +675,17 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
}
boolean init = intent.getBooleanExtra("init", false);
+ boolean openedFromNotification = intent.getBooleanExtra(EXTRA_OPENED_FROM_NOTIFICATION, false);
this.mInitMode = init || this.jidToEdit == null;
this.messageFingerprint = intent.getStringExtra("fingerprint");
if (!mInitMode) {
this.binding.accountRegisterNew.setVisibility(View.GONE);
- if (getSupportActionBar() != null) {
- getSupportActionBar().setTitle(getString(R.string.account_details));
- }
+ setTitle(getString(R.string.account_details));
+ configureActionBar(getSupportActionBar(), !openedFromNotification);
} else {
- binding.avater.setVisibility(View.GONE);
- ActionBar ab = getSupportActionBar();
- if (ab != null) {
- if (init && Config.MAGIC_CREATE_DOMAIN == null) {
- ab.setDisplayShowHomeEnabled(false);
- ab.setDisplayHomeAsUpEnabled(false);
- }
- ab.setTitle(R.string.action_add_account);
- }
+ this.binding.avater.setVisibility(View.GONE);
+ configureActionBar(getSupportActionBar(), !(init && Config.MAGIC_CREATE_DOMAIN == null));
+ setTitle(R.string.action_add_account);
}
}
SharedPreferences preferences = getPreferences();