mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-25 21:55:25 +01:00
Fixed bugs in code
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
88298026aa
commit
92cb537d2f
@ -795,6 +795,10 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
view = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null, false);
|
view = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bottomSheet == null) {
|
||||||
|
bottomSheet = new BottomSheet.Builder(getActivity()).setView(view).create();
|
||||||
|
}
|
||||||
|
|
||||||
if (showEntrySheet) {
|
if (showEntrySheet) {
|
||||||
getChildRouter((ViewGroup) view).setRoot(
|
getChildRouter((ViewGroup) view).setRoot(
|
||||||
RouterTransaction.with(new EntryMenuController(bundle))
|
RouterTransaction.with(new EntryMenuController(bundle))
|
||||||
@ -805,13 +809,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
RouterTransaction.with(new OperationsMenuController(bundle))
|
RouterTransaction.with(new OperationsMenuController(bundle))
|
||||||
.popChangeHandler(new VerticalChangeHandler())
|
.popChangeHandler(new VerticalChangeHandler())
|
||||||
.pushChangeHandler(new VerticalChangeHandler()));
|
.pushChangeHandler(new VerticalChangeHandler()));
|
||||||
|
|
||||||
bottomSheet.setOnShowListener(dialog -> eventBus.post(new BottomSheetLockEvent(false, 0,
|
|
||||||
false, false)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bottomSheet == null) {
|
|
||||||
bottomSheet = new BottomSheet.Builder(getActivity()).setView(view).create();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bottomSheet.setOnShowListener(dialog -> {
|
bottomSheet.setOnShowListener(dialog -> {
|
||||||
@ -822,6 +819,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
false, false));
|
false, false));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
bottomSheet.setOnDismissListener(dialog -> getActionBar().setDisplayHomeAsUpEnabled(getRouter().getBackstackSize() > 1));
|
bottomSheet.setOnDismissListener(dialog -> getActionBar().setDisplayHomeAsUpEnabled(getRouter().getBackstackSize() > 1));
|
||||||
|
|
||||||
bottomSheet.show();
|
bottomSheet.show();
|
||||||
@ -970,6 +968,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
checkAndHandleDoneMenuItem();
|
checkAndHandleDoneMenuItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,6 +517,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
if (localInvitedGroups.size() > 0) {
|
if (localInvitedGroups.size() > 0) {
|
||||||
localInvitedGroups.remove(0);
|
localInvitedGroups.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localInvitedUsers.size() > 0 || (localInvitedGroups.size() > 0 && currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails"))) {
|
if (localInvitedUsers.size() > 0 || (localInvitedGroups.size() > 0 && currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails"))) {
|
||||||
if ((localInvitedGroups.size() > 0 && currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails"))) {
|
if ((localInvitedGroups.size() > 0 && currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails"))) {
|
||||||
for (int i = 0; i < localInvitedGroups.size(); i++) {
|
for (int i = 0; i < localInvitedGroups.size(); i++) {
|
||||||
@ -557,44 +558,44 @@ public class OperationsMenuController extends BaseController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < localInvitedGroups.size(); i++) {
|
for (int i = 0; i < localInvitedUsers.size(); i++) {
|
||||||
final String userId = invitedUsers.get(i);
|
final String userId = invitedUsers.get(i);
|
||||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(currentUser.getBaseUrl(), conversation.getToken(),
|
retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(currentUser.getBaseUrl(), conversation.getToken(),
|
||||||
userId);
|
userId);
|
||||||
|
|
||||||
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||||
.subscribeOn(Schedulers.newThread())
|
.subscribeOn(Schedulers.newThread())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.retry(1)
|
.retry(1)
|
||||||
.subscribe(new Observer<AddParticipantOverall>() {
|
.subscribe(new Observer<AddParticipantOverall>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(AddParticipantOverall addParticipantOverall) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
synchronized (localInvitedUsers) {
|
||||||
|
localInvitedUsers.remove(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
if (localInvitedGroups.size() == 0 && localInvitedUsers.size() == 0) {
|
||||||
public void onNext(AddParticipantOverall addParticipantOverall) {
|
initiateConversation(true, null);
|
||||||
}
|
}
|
||||||
|
dispose();
|
||||||
@Override
|
}
|
||||||
public void onError(Throwable e) {
|
});
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
synchronized (localInvitedUsers) {
|
|
||||||
localInvitedUsers.remove(userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (localInvitedUsers.size() == 0) {
|
|
||||||
initiateConversation(true, null);
|
|
||||||
}
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!currentUser.hasSpreedCapabilityWithName("chat-v2")) {
|
if (!currentUser.hasSpreedCapabilityWithName("chat-v2")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user