mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -12,6 +12,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.util.Linkify;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
@@ -19,6 +20,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.b44t.messenger.DcContext;
|
||||
@@ -37,7 +39,6 @@ import org.thoughtcrime.securesms.qr.QrCodeHandler;
|
||||
import org.thoughtcrime.securesms.qr.RegistrationQrActivity;
|
||||
import org.thoughtcrime.securesms.service.GenericForegroundService;
|
||||
import org.thoughtcrime.securesms.service.NotificationController;
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
||||
import org.thoughtcrime.securesms.util.StorageUtil;
|
||||
import org.thoughtcrime.securesms.util.StreamUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
@@ -64,12 +65,6 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
|
||||
DcContext dcContext;
|
||||
private NotificationController notificationController;
|
||||
|
||||
@Override
|
||||
protected void onPreCreate() {
|
||||
dynamicTheme = new DynamicNoActionBarTheme();
|
||||
super.onPreCreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
@@ -86,6 +81,7 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
|
||||
backupButton.setOnClickListener((view) -> startImportBackup());
|
||||
|
||||
registerForEvents();
|
||||
initializeActionBar();
|
||||
|
||||
if (!DcHelper.hasAnyConfiguredContext(this)) {
|
||||
Intent intent = new Intent();
|
||||
@@ -100,6 +96,15 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
|
||||
handleIntent();
|
||||
}
|
||||
|
||||
protected void initializeActionBar() {
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
if (supportActionBar == null) throw new AssertionError();
|
||||
|
||||
boolean canGoBack = AccountManager.getInstance().canRollbackAccountCreation(this);
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(canGoBack);
|
||||
getSupportActionBar().setTitle(canGoBack? R.string.add_account : R.string.welcome_desktop);
|
||||
}
|
||||
|
||||
private void registerForEvents() {
|
||||
dcContext = DcHelper.getContext(this);
|
||||
DcEventCenter eventCenter = DcHelper.getEventCenter(this);
|
||||
@@ -119,6 +124,19 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
super.onOptionsItemSelected(item);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
||||
Reference in New Issue
Block a user