mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Don't interpolate the app name into strings.
This commit is contained in:
@@ -25,6 +25,7 @@ import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
@@ -104,7 +105,7 @@ public abstract class BriarActivity extends BaseActivity {
|
||||
LOG.info("Not signed in, launching StartupActivity");
|
||||
Intent i = new Intent(this, StartupActivity.class);
|
||||
startActivityForResult(i, REQUEST_PASSWORD);
|
||||
} else if (lockManager.isLocked() && !isFinishing()) {
|
||||
} else if (SDK_INT >= 21 && lockManager.isLocked() && !isFinishing()) {
|
||||
// Also check that the activity isn't finishing already.
|
||||
// This is possible if we finished in onActivityResult().
|
||||
// Launching another UnlockActivity would cause a loop.
|
||||
@@ -115,10 +116,7 @@ public abstract class BriarActivity extends BaseActivity {
|
||||
briarController.hasDozed(new UiResultHandler<Boolean>(this) {
|
||||
@Override
|
||||
public void onResultUi(Boolean result) {
|
||||
if (result) {
|
||||
showDozeDialog(getString(R.string.dnkm_warning_dozed,
|
||||
getString(R.string.app_name)));
|
||||
}
|
||||
if (result) showDozeDialog(R.string.dnkm_warning_dozed_1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -175,7 +173,7 @@ public abstract class BriarActivity extends BaseActivity {
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
protected void showDozeDialog(String message) {
|
||||
protected void showDozeDialog(@StringRes int message) {
|
||||
AlertDialog.Builder b =
|
||||
new AlertDialog.Builder(this, R.style.BriarDialogTheme);
|
||||
b.setMessage(message);
|
||||
|
||||
@@ -175,13 +175,8 @@ public class AddNearbyContactActivity extends BriarActivity
|
||||
showErrorFragment();
|
||||
} else {
|
||||
String msg;
|
||||
if (qrCodeTooOld) {
|
||||
msg = getString(R.string.qr_code_too_old,
|
||||
getString(R.string.app_name));
|
||||
} else {
|
||||
msg = getString(R.string.qr_code_too_new,
|
||||
getString(R.string.app_name));
|
||||
}
|
||||
if (qrCodeTooOld) msg = getString(R.string.qr_code_too_old_1);
|
||||
else msg = getString(R.string.qr_code_too_new_1);
|
||||
showNextFragment(AddNearbyContactErrorFragment.newInstance(msg));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,16 +78,15 @@ class WebServer extends NanoHTTPD {
|
||||
try (InputStream is = ctx.getAssets().open(FILE_HTML)) {
|
||||
doc = Jsoup.parse(is, UTF_8.name(), "");
|
||||
}
|
||||
String app = ctx.getString(R.string.app_name);
|
||||
String appV = app + " " + VERSION_NAME;
|
||||
String filename = getApkFileName();
|
||||
doc.select("#download_title").first()
|
||||
.text(ctx.getString(R.string.website_download_title, appV));
|
||||
.text(ctx.getString(R.string.website_download_title_1,
|
||||
VERSION_NAME));
|
||||
doc.select("#download_intro").first()
|
||||
.text(ctx.getString(R.string.website_download_intro, app));
|
||||
.text(ctx.getString(R.string.website_download_intro_1));
|
||||
doc.select(".button").first().attr("href", filename);
|
||||
doc.select("#download_button").first()
|
||||
.text(ctx.getString(R.string.website_download_title, app));
|
||||
.text(ctx.getString(R.string.website_download_button));
|
||||
doc.select("#download_outro").first()
|
||||
.text(ctx.getString(R.string.website_download_outro));
|
||||
doc.select("#troubleshooting_title").first()
|
||||
|
||||
@@ -147,7 +147,7 @@ public class NavDrawerActivity extends BriarActivity implements
|
||||
}
|
||||
}
|
||||
navDrawerViewModel.shouldAskForDozeWhitelisting().observe(this, ask -> {
|
||||
if (ask) showDozeDialog(getString(R.string.dnkm_doze_intro));
|
||||
if (ask) showDozeDialog(R.string.dnkm_doze_intro);
|
||||
});
|
||||
|
||||
Toolbar toolbar = setUpCustomToolbar(false);
|
||||
|
||||
Reference in New Issue
Block a user