mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 10:32:39 +00:00
@@ -28,6 +28,7 @@ import com.google.zxing.integration.android.IntentResult;
|
||||
|
||||
import org.thoughtcrime.securesms.util.Base64;
|
||||
import org.thoughtcrime.securesms.util.Dialogs;
|
||||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.whispersystems.libaxolotl.IdentityKey;
|
||||
|
||||
@@ -38,11 +39,13 @@ import org.whispersystems.libaxolotl.IdentityKey;
|
||||
*/
|
||||
public abstract class KeyScanningActivity extends PassphraseRequiredActionBarActivity {
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
private final DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle bundle) {
|
||||
dynamicTheme.onCreate(this);
|
||||
dynamicLanguage.onCreate(this);
|
||||
super.onCreate(bundle);
|
||||
}
|
||||
|
||||
@@ -50,6 +53,7 @@ public abstract class KeyScanningActivity extends PassphraseRequiredActionBarAct
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
dynamicTheme.onResume(this);
|
||||
dynamicLanguage.onResume(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,13 +102,22 @@ public abstract class KeyScanningActivity extends PassphraseRequiredActionBarAct
|
||||
}
|
||||
}
|
||||
|
||||
protected void initiateScan() {
|
||||
private IntentIntegrator getIntentIntegrator() {
|
||||
IntentIntegrator intentIntegrator = new IntentIntegrator(this);
|
||||
intentIntegrator.setButtonYesByID(R.string.yes);
|
||||
intentIntegrator.setButtonNoByID(R.string.no);
|
||||
intentIntegrator.setTitleByID(R.string.KeyScanningActivity_install_barcode_Scanner);
|
||||
intentIntegrator.setMessageByID(R.string.KeyScanningActivity_this_application_requires_barcode_scanner_would_you_like_to_install_it);
|
||||
return intentIntegrator;
|
||||
}
|
||||
|
||||
protected void initiateScan() {
|
||||
IntentIntegrator intentIntegrator = getIntentIntegrator();
|
||||
intentIntegrator.initiateScan();
|
||||
}
|
||||
|
||||
protected void initiateDisplay() {
|
||||
IntentIntegrator intentIntegrator = new IntentIntegrator(this);
|
||||
IntentIntegrator intentIntegrator = getIntentIntegrator();
|
||||
intentIntegrator.shareText(Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user