mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Compare commits
3 Commits
alpha-1.3.
...
2057-image
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2faf08c9d | ||
|
|
cc04fb05c2 | ||
|
|
58eb1d9e24 |
@@ -42,7 +42,7 @@ configurations {
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':bramble-core', configuration: 'default')
|
||||
tor 'org.briarproject:tor-android:0.3.5.13@zip'
|
||||
tor 'org.briarproject:tor-android:0.3.5.14'
|
||||
tor 'org.briarproject:obfs4proxy-android:0.0.12-dev-40245c4a@zip'
|
||||
|
||||
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
|
||||
|
||||
@@ -76,7 +76,7 @@ dependencyVerification {
|
||||
'org.bouncycastle:bcpkix-jdk15on:1.56:bcpkix-jdk15on-1.56.jar:7043dee4e9e7175e93e0b36f45b1ec1ecb893c5f755667e8b916eb8dd201c6ca',
|
||||
'org.bouncycastle:bcprov-jdk15on:1.56:bcprov-jdk15on-1.56.jar:963e1ee14f808ffb99897d848ddcdb28fa91ddda867eb18d303e82728f878349',
|
||||
'org.briarproject:obfs4proxy-android:0.0.12-dev-40245c4a:obfs4proxy-android-0.0.12-dev-40245c4a.zip:8ab05a8f8391be2cb5ab2b665c281a06d9e3a756bd0f95a40a36ca927866ea82',
|
||||
'org.briarproject:tor-android:0.3.5.13:tor-android-0.3.5.13.zip:e0978db136731dae07774b722970cdae1e462fb5adc82845dd80a7e2d87f356c',
|
||||
'org.briarproject:tor-android:0.3.5.14:tor-android-0.3.5.14.jar:92bdb9890de8f14e9e90d1e3aff49a7a4b9262f19904410ae0a3baf94ed6be33',
|
||||
'org.checkerframework:checker-compat-qual:2.5.3:checker-compat-qual-2.5.3.jar:d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d',
|
||||
'org.checkerframework:checker-qual:2.5.2:checker-qual-2.5.2.jar:64b02691c8b9d4e7700f8ee2e742dce7ea2c6e81e662b7522c9ee3bf568c040a',
|
||||
'org.checkerframework:checker-qual:2.8.1:checker-qual-2.8.1.jar:9103499008bcecd4e948da29b17864abb64304e15706444ae209d17ebe0575df',
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: '*.jar')
|
||||
implementation 'net.java.dev.jna:jna:4.5.2'
|
||||
implementation 'net.java.dev.jna:jna-platform:4.5.2'
|
||||
tor 'org.briarproject:tor:0.3.5.13-1@zip'
|
||||
tor 'org.briarproject:tor:0.3.5.14'
|
||||
tor 'org.briarproject:obfs4proxy:0.0.12-dev-40245c4a@zip'
|
||||
|
||||
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
|
||||
|
||||
@@ -24,7 +24,7 @@ dependencyVerification {
|
||||
'org.apache.ant:ant:1.9.4:ant-1.9.4.jar:649ae0730251de07b8913f49286d46bba7b92d47c5f332610aa426c4f02161d8',
|
||||
'org.beanshell:bsh:1.3.0:bsh-1.3.0.jar:9b04edc75d19db54f1b4e8b5355e9364384c6cf71eb0a1b9724c159d779879f8',
|
||||
'org.briarproject:obfs4proxy:0.0.12-dev-40245c4a:obfs4proxy-0.0.12-dev-40245c4a.zip:172029e7058b3a83ac93ac4991a44bf76e16ce8d46f558f5836d57da3cb3a766',
|
||||
'org.briarproject:tor:0.3.5.13-1:tor-0.3.5.13-1.zip:ef35c16bf8dc1f4c75ed71d9f55e4514f383d124ec96b859aca647c990927c99',
|
||||
'org.briarproject:tor:0.3.5.14:tor-0.3.5.14.jar:a969ab3f4bde4a7fc5945c53935cf3bca50de44451a34ebeca8add93e2a9af60',
|
||||
'org.checkerframework:checker-compat-qual:2.5.3:checker-compat-qual-2.5.3.jar:d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d',
|
||||
'org.checkerframework:checker-qual:2.5.2:checker-qual-2.5.2.jar:64b02691c8b9d4e7700f8ee2e742dce7ea2c6e81e662b7522c9ee3bf568c040a',
|
||||
'org.codehaus.mojo:animal-sniffer-annotations:1.17:animal-sniffer-annotations-1.17.jar:92654f493ecfec52082e76354f0ebf87648dc3d5cec2e3c3cdb947c016747a53',
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.briarproject.briar.android.view.ImagePreview.ImagePreviewListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
@@ -37,6 +38,8 @@ import static android.widget.Toast.LENGTH_LONG;
|
||||
import static androidx.core.content.ContextCompat.getColor;
|
||||
import static androidx.customview.view.AbsSavedState.EMPTY_STATE;
|
||||
import static androidx.lifecycle.Lifecycle.State.DESTROYED;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Logger.getLogger;
|
||||
import static org.briarproject.briar.android.util.UiUtils.resolveColorAttribute;
|
||||
import static org.briarproject.briar.android.view.TextSendController.SendState.SENT;
|
||||
import static org.briarproject.briar.api.messaging.MessagingConstants.MAX_ATTACHMENTS_PER_MESSAGE;
|
||||
@@ -46,6 +49,9 @@ import static org.briarproject.briar.api.messaging.MessagingConstants.MAX_ATTACH
|
||||
public class TextAttachmentController extends TextSendController
|
||||
implements ImagePreviewListener {
|
||||
|
||||
private static final Logger LOG =
|
||||
getLogger(TextAttachmentController.class.getName());
|
||||
|
||||
private final ImagePreview imagePreview;
|
||||
private final AttachmentListener attachmentListener;
|
||||
private final CompositeSendButton sendButton;
|
||||
@@ -67,6 +73,7 @@ public class TextAttachmentController extends TextSendController
|
||||
sendButton.setOnImageClickListener(view -> onImageButtonClicked());
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@Override
|
||||
protected void updateViewState() {
|
||||
super.updateViewState();
|
||||
@@ -160,10 +167,13 @@ public class TextAttachmentController extends TextSendController
|
||||
* at most once per call to
|
||||
* {@link Activity#startActivityForResult(Intent, int)}.
|
||||
*/
|
||||
@UiThread
|
||||
@SuppressWarnings("JavadocReference")
|
||||
public void onImageReceived(@Nullable Intent resultData) {
|
||||
if (LOG.isLoggable(INFO)) LOG.info("onImageReceived: " + resultData);
|
||||
if (resultData == null) return;
|
||||
if (loadingUris || !imageUris.isEmpty()) throw new AssertionError();
|
||||
if (loadingUris) throw new AssertionError("still loading URIs");
|
||||
if (!imageUris.isEmpty()) throw new AssertionError("uris " + imageUris);
|
||||
List<Uri> newUris = new ArrayList<>();
|
||||
if (resultData.getData() != null) {
|
||||
newUris.add(resultData.getData());
|
||||
@@ -177,6 +187,7 @@ public class TextAttachmentController extends TextSendController
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
private void onNewUris(boolean restart, List<Uri> newUris) {
|
||||
if (newUris.isEmpty()) return;
|
||||
if (loadingUris) throw new AssertionError();
|
||||
@@ -197,8 +208,9 @@ public class TextAttachmentController extends TextSendController
|
||||
@Override
|
||||
public void onChanged(@Nullable AttachmentResult attachmentResult) {
|
||||
if (attachmentResult == null) {
|
||||
// The fresh LiveData was deliberately set to null.
|
||||
// This means that we can stop observing it.
|
||||
// The fresh LiveData was deliberately set to null
|
||||
// when the AttachmentCreator reset its state.
|
||||
// This means that we can simply stop observing it.
|
||||
result.removeObserver(this);
|
||||
} else {
|
||||
boolean noError = onNewAttachmentItemResults(
|
||||
@@ -270,6 +282,7 @@ public class TextAttachmentController extends TextSendController
|
||||
onCancel();
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@Override
|
||||
public void onCancel() {
|
||||
textInput.clearText();
|
||||
|
||||
@@ -4,6 +4,7 @@ allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
google()
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user