parent
990902845a
commit
188d11bc23
2 changed files with 18 additions and 3 deletions
|
@ -219,6 +219,8 @@
|
||||||
|
|
||||||
<!-- KeyScanningActivity -->
|
<!-- KeyScanningActivity -->
|
||||||
<string name="KeyScanningActivity_no_scanned_key_found_exclamation">No scanned key found!</string>
|
<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 -->
|
<!-- MmsDownloader -->
|
||||||
<string name="MmsDownloader_error_storing_mms">Error storing MMS!</string>
|
<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.Base64;
|
||||||
import org.thoughtcrime.securesms.util.Dialogs;
|
import org.thoughtcrime.securesms.util.Dialogs;
|
||||||
|
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||||
import org.whispersystems.libaxolotl.IdentityKey;
|
import org.whispersystems.libaxolotl.IdentityKey;
|
||||||
|
|
||||||
|
@ -38,11 +39,13 @@ import org.whispersystems.libaxolotl.IdentityKey;
|
||||||
*/
|
*/
|
||||||
public abstract class KeyScanningActivity extends PassphraseRequiredActionBarActivity {
|
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
|
@Override
|
||||||
protected void onCreate(Bundle bundle) {
|
protected void onCreate(Bundle bundle) {
|
||||||
dynamicTheme.onCreate(this);
|
dynamicTheme.onCreate(this);
|
||||||
|
dynamicLanguage.onCreate(this);
|
||||||
super.onCreate(bundle);
|
super.onCreate(bundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +53,7 @@ public abstract class KeyScanningActivity extends PassphraseRequiredActionBarAct
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
dynamicTheme.onResume(this);
|
dynamicTheme.onResume(this);
|
||||||
|
dynamicLanguage.onResume(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -98,13 +102,22 @@ public abstract class KeyScanningActivity extends PassphraseRequiredActionBarAct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initiateScan() {
|
private IntentIntegrator getIntentIntegrator() {
|
||||||
IntentIntegrator intentIntegrator = new IntentIntegrator(this);
|
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();
|
intentIntegrator.initiateScan();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initiateDisplay() {
|
protected void initiateDisplay() {
|
||||||
IntentIntegrator intentIntegrator = new IntentIntegrator(this);
|
IntentIntegrator intentIntegrator = getIntentIntegrator();
|
||||||
intentIntegrator.shareText(Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
|
intentIntegrator.shareText(Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue