mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
[android] Close memberlist or sharing status screen when group was left
This commit is contained in:
@@ -13,6 +13,7 @@ import org.briarproject.bramble.api.event.EventListener;
|
||||
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
|
||||
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
|
||||
import org.briarproject.bramble.api.sync.GroupId;
|
||||
import org.briarproject.bramble.api.sync.event.GroupRemovedEvent;
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.android.activity.BriarActivity;
|
||||
@@ -87,10 +88,16 @@ public class GroupMemberListActivity extends BriarActivity
|
||||
// we can't use GroupInvitationResponseReceivedEvent, because
|
||||
// a peer only becomes a member after joining the group by message
|
||||
GroupMessageAddedEvent ge = (GroupMessageAddedEvent) e;
|
||||
if (ge.getGroupId().equals(this.groupId) &&
|
||||
if (ge.getGroupId().equals(groupId) &&
|
||||
ge.getHeader() instanceof JoinMessageHeader) {
|
||||
loadMembers();
|
||||
}
|
||||
} else if (e instanceof GroupRemovedEvent) {
|
||||
GroupRemovedEvent g = (GroupRemovedEvent) e;
|
||||
if (g.getGroup().getId().equals(groupId)) {
|
||||
runOnUiThreadUnlessDestroyed(
|
||||
this::supportFinishAfterTransition);
|
||||
}
|
||||
}
|
||||
// TODO ContactConnectedEvent and ContactDisconnectedEvent
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.briarproject.briar.android.sharing;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.CallSuper;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.view.MenuItem;
|
||||
@@ -17,6 +18,7 @@ import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
|
||||
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
|
||||
import org.briarproject.bramble.api.plugin.ConnectionRegistry;
|
||||
import org.briarproject.bramble.api.sync.GroupId;
|
||||
import org.briarproject.bramble.api.sync.event.GroupRemovedEvent;
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.BriarActivity;
|
||||
import org.briarproject.briar.android.contact.ContactItem;
|
||||
@@ -88,12 +90,19 @@ abstract class SharingStatusActivity extends BriarActivity
|
||||
}
|
||||
|
||||
@Override
|
||||
@CallSuper
|
||||
public void eventOccurred(Event e) {
|
||||
if (e instanceof ContactLeftShareableEvent) {
|
||||
ContactLeftShareableEvent c = (ContactLeftShareableEvent) e;
|
||||
if (c.getGroupId().equals(getGroupId())) {
|
||||
loadSharedWith();
|
||||
}
|
||||
} else if (e instanceof GroupRemovedEvent) {
|
||||
GroupRemovedEvent g = (GroupRemovedEvent) e;
|
||||
if (g.getGroup().getId().equals(getGroupId())) {
|
||||
runOnUiThreadUnlessDestroyed(
|
||||
this::supportFinishAfterTransition);
|
||||
}
|
||||
}
|
||||
// TODO ContactConnectedEvent and ContactDisconnectedEvent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user