Improvements & bugfixes

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-03-03 20:57:56 +01:00
parent 08827ffadd
commit 7cdf323353
2 changed files with 9 additions and 12 deletions

View File

@ -50,7 +50,6 @@ import android.widget.LinearLayout;
import com.bluelinelabs.conductor.RouterTransaction; import com.bluelinelabs.conductor.RouterTransaction;
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler; import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler; import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
import com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler;
import com.kennyc.bottomsheet.BottomSheet; import com.kennyc.bottomsheet.BottomSheet;
import com.nextcloud.talk.R; import com.nextcloud.talk.R;
import com.nextcloud.talk.activities.CallActivity; import com.nextcloud.talk.activities.CallActivity;
@ -269,14 +268,13 @@ public class ContactsController extends BaseController implements SearchView.OnQ
@Override @Override
public void onNext(RoomOverall roomOverall) { public void onNext(RoomOverall roomOverall) {
if (getActivity() != null) { if (getActivity() != null) {
overridePushHandler(new NoOpControllerChangeHandler());
overridePopHandler(new NoOpControllerChangeHandler());
Intent callIntent = new Intent(getActivity(), CallActivity.class); Intent callIntent = new Intent(getActivity(), CallActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken()); bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity)); bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
callIntent.putExtras(bundle); callIntent.putExtras(bundle);
startActivity(callIntent); startActivity(callIntent);
new Handler().postDelayed(() -> getRouter().popCurrentController(), 100);
} }
} }
@ -633,8 +631,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
@Override @Override
public void onNext(RoomOverall roomOverall) { public void onNext(RoomOverall roomOverall) {
if (getActivity() != null) { if (getActivity() != null) {
overridePushHandler(new NoOpControllerChangeHandler());
overridePopHandler(new NoOpControllerChangeHandler());
Intent callIntent = new Intent(getActivity(), CallActivity.class); Intent callIntent = new Intent(getActivity(), CallActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken()); bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());

View File

@ -23,6 +23,7 @@ package com.nextcloud.talk.controllers.bottomsheet;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -35,7 +36,6 @@ import android.widget.TextView;
import com.bluelinelabs.conductor.RouterTransaction; import com.bluelinelabs.conductor.RouterTransaction;
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler; import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
import com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler;
import com.nextcloud.talk.R; import com.nextcloud.talk.R;
import com.nextcloud.talk.activities.CallActivity; import com.nextcloud.talk.activities.CallActivity;
import com.nextcloud.talk.api.NcApi; import com.nextcloud.talk.api.NcApi;
@ -271,7 +271,7 @@ public class OperationsMenuController extends BaseController {
.pushChangeHandler(new HorizontalChangeHandler()) .pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler())); .popChangeHandler(new HorizontalChangeHandler()));
} else { } else {
initiateCall(); initiateCall(false);
} }
} else { } else {
showResultImage(false, true); showResultImage(false, true);
@ -487,7 +487,7 @@ public class OperationsMenuController extends BaseController {
} }
if (localInvitedUsers.size() == 0) { if (localInvitedUsers.size() == 0) {
initiateCall(); initiateCall(true);
} }
dispose(); dispose();
} }
@ -498,7 +498,7 @@ public class OperationsMenuController extends BaseController {
} }
} }
private void initiateCall() { private void initiateCall(boolean fromContactsView) {
eventBus.post(new BottomSheetLockEvent(true, 0, true, true)); eventBus.post(new BottomSheetLockEvent(true, 0, true, true));
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, room.getToken()); bundle.putString(BundleKeys.KEY_ROOM_TOKEN, room.getToken());
@ -508,11 +508,12 @@ public class OperationsMenuController extends BaseController {
} }
bundle.putString(BundleKeys.KEY_CALL_SESSION, callSession); bundle.putString(BundleKeys.KEY_CALL_SESSION, callSession);
overridePushHandler(new NoOpControllerChangeHandler());
overridePopHandler(new NoOpControllerChangeHandler());
Intent callIntent = new Intent(getActivity(), CallActivity.class); Intent callIntent = new Intent(getActivity(), CallActivity.class);
callIntent.putExtras(bundle); callIntent.putExtras(bundle);
startActivity(callIntent); startActivity(callIntent);
if (fromContactsView) {
new Handler().postDelayed(() -> getParentController().getRouter().popCurrentController(), 100);
}
} }
private class OperationsObserver implements Observer { private class OperationsObserver implements Observer {
@ -529,7 +530,7 @@ public class OperationsMenuController extends BaseController {
} else { } else {
CallOverall callOverall = (CallOverall) o; CallOverall callOverall = (CallOverall) o;
callSession = callOverall.getOcs().getData().getSessionId(); callSession = callOverall.getOcs().getData().getSessionId();
initiateCall(); initiateCall(false);
} }
} }