Skip to content

Commit

Permalink
bugfix: crash on direct input
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEmperor committed Oct 2, 2024
1 parent b47764d commit 10212e4
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ protected void onCreate(Bundle savedInstanceState) {
}
FirebaseCrashlytics.getInstance().setUserId(sp.getString("net.devemperor.wristassist.userid", "null"));

if (getIntent().getBooleanExtra("net.devemperor.wristassist.enter_api_key", false)) {
Intent intent = new Intent(this, InputActivity.class);
intent.putExtra("net.devemperor.wristassist.input.title", getString(R.string.wristassist_set_api_key));
intent.putExtra("net.devemperor.wristassist.input.hint", getString(R.string.wristassist_api_key));
editApiKeyLauncher.launch(intent);
} else if (!sp.getBoolean("net.devemperor.wristassist.onboarding_complete", false)) {
startActivity(new Intent(this, OnboardingActivity.class));
finish();
} else if (sp.getInt("net.devemperor.wristassist.last_version_code", 0) < BuildConfig.VERSION_CODE) {
startActivity(new Intent(this, ChangelogActivity.class));
} else if (getIntent().getBooleanExtra("net.devemperor.wristassist.complication", false)
|| sp.getBoolean("net.devemperor.wristassist.instant_input", false)) {
input(false);
}

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Expand Down Expand Up @@ -129,6 +114,22 @@ protected void onCreate(Bundle savedInstanceState) {
}
});

if (getIntent().getBooleanExtra("net.devemperor.wristassist.enter_api_key", false)) {
Intent intent = new InputIntentBuilder(this)
.setTitle(getString(R.string.wristassist_set_api_key))
.setHint(getString(R.string.wristassist_api_key))
.build();
editApiKeyLauncher.launch(intent);
} else if (!sp.getBoolean("net.devemperor.wristassist.onboarding_complete", false)) {
startActivity(new Intent(this, OnboardingActivity.class));
finish();
} else if (sp.getInt("net.devemperor.wristassist.last_version_code", 0) < BuildConfig.VERSION_CODE) {
startActivity(new Intent(this, ChangelogActivity.class));
} else if (getIntent().getBooleanExtra("net.devemperor.wristassist.complication", false)
|| sp.getBoolean("net.devemperor.wristassist.instant_input", false)) {
input(false);
}

mainWrv.requestFocus();
mainWrv.postDelayed(() -> {
View view = mainWrv.getChildAt(0);
Expand Down

0 comments on commit 10212e4

Please sign in to comment.