parent
990902845a
commit
188d11bc23
2 changed files with 18 additions and 3 deletions
|
@ -219,6 +219,8 @@
|
|||
|
||||
<!-- KeyScanningActivity -->
|
||||
<string name="KeyScanningActivity_no_scanned_key_found_exclamation">No scanned key found!</string>
|
||||
<string name="KeyScanningActivity_install_barcode_Scanner">Install Barcode Scanner?</string>
|
||||
<string name="KeyScanningActivity_this_application_requires_barcode_scanner_would_you_like_to_install_it">TextSecure needs Barcode Scanner for QR codes.</string>
|
||||
|
||||
<!-- MmsDownloader -->
|
||||
<string name="MmsDownloader_error_storing_mms">Error storing MMS!</string>
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue