Add locale chooser (#304)

* Add locale chooser

* Prevent AppBundle crashes

* Reload activity on language change

* Make spotBugs happy
This commit is contained in:
Sylvia van Os
2021-08-15 22:18:40 +02:00
committed by GitHub
parent 86be5d1994
commit edba5d5dca
16 changed files with 225 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
package protect.card_locker;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
@@ -39,6 +40,11 @@ public class ScanActivity extends AppCompatActivity {
private String addGroup;
private boolean torch = false;
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(Utils.updateBaseContextLocale(base));
}
private void extractIntentFields(Intent intent) {
final Bundle b = intent.getExtras();
cardId = b != null ? b.getString(LoyaltyCardEditActivity.BUNDLE_CARDID) : null;
@@ -49,6 +55,7 @@ public class ScanActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(R.string.scanCardBarcode);
setContentView(R.layout.scan_activity);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);