mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-13 07:44:11 +01:00
Forgot to add things
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
70670baf3a
commit
38d581c5a8
@ -60,7 +60,7 @@
|
|||||||
android:name=".activities.CallActivity"
|
android:name=".activities.CallActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
/>
|
android:noHistory="true"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -60,6 +60,7 @@ import com.nextcloud.talk.controllers.bottomsheet.CallMenuController;
|
|||||||
import com.nextcloud.talk.controllers.bottomsheet.EntryMenuController;
|
import com.nextcloud.talk.controllers.bottomsheet.EntryMenuController;
|
||||||
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
||||||
import com.nextcloud.talk.events.MoreMenuClickEvent;
|
import com.nextcloud.talk.events.MoreMenuClickEvent;
|
||||||
|
import com.nextcloud.talk.events.ShowScreenEvent;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.participants.Participant;
|
import com.nextcloud.talk.models.json.participants.Participant;
|
||||||
import com.nextcloud.talk.models.json.rooms.Room;
|
import com.nextcloud.talk.models.json.rooms.Room;
|
||||||
@ -168,6 +169,7 @@ public class CallsListController extends BaseController implements SearchView.On
|
|||||||
protected void onAttach(@NonNull View view) {
|
protected void onAttach(@NonNull View view) {
|
||||||
super.onAttach(view);
|
super.onAttach(view);
|
||||||
eventBus.register(this);
|
eventBus.register(this);
|
||||||
|
getParentController().getView().findViewById(R.id.navigation).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -412,6 +414,15 @@ public class CallsListController extends BaseController implements SearchView.On
|
|||||||
return onQueryTextChange(query);
|
return onQueryTextChange(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onMessageEvent(ShowScreenEvent showScreenEvent) {
|
||||||
|
if (showScreenEvent.getScreenType().equals(ShowScreenEvent.ScreenType.CONTACTS_SCREEN)) {
|
||||||
|
getRouter().pushController((RouterTransaction.with(new ContactsController(showScreenEvent.getBundle()))
|
||||||
|
.pushChangeHandler(new VerticalChangeHandler())
|
||||||
|
.popChangeHandler(new VerticalChangeHandler())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onMessageEvent(BottomSheetLockEvent bottomSheetLockEvent) {
|
public void onMessageEvent(BottomSheetLockEvent bottomSheetLockEvent) {
|
||||||
if (bottomSheet != null) {
|
if (bottomSheet != null) {
|
||||||
|
@ -62,6 +62,7 @@ import com.nextcloud.talk.api.NcApi;
|
|||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.controllers.base.BaseController;
|
import com.nextcloud.talk.controllers.base.BaseController;
|
||||||
import com.nextcloud.talk.controllers.bottomsheet.EntryMenuController;
|
import com.nextcloud.talk.controllers.bottomsheet.EntryMenuController;
|
||||||
|
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
||||||
import com.nextcloud.talk.models.RetrofitBucket;
|
import com.nextcloud.talk.models.RetrofitBucket;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.participants.Participant;
|
import com.nextcloud.talk.models.json.participants.Participant;
|
||||||
@ -73,6 +74,9 @@ import com.nextcloud.talk.utils.ApiUtils;
|
|||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
import org.parceler.Parcels;
|
import org.parceler.Parcels;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -115,6 +119,9 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
@Inject
|
@Inject
|
||||||
NcApi ncApi;
|
NcApi ncApi;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
EventBus eventBus;
|
||||||
|
|
||||||
@BindView(R.id.recycler_view)
|
@BindView(R.id.recycler_view)
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
|
|
||||||
@ -172,6 +179,8 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
@Override
|
@Override
|
||||||
protected void onAttach(@NonNull View view) {
|
protected void onAttach(@NonNull View view) {
|
||||||
super.onAttach(view);
|
super.onAttach(view);
|
||||||
|
eventBus.register(this);
|
||||||
|
|
||||||
if (isNewConversationView) {
|
if (isNewConversationView) {
|
||||||
checkAndHandleBottomButtons();
|
checkAndHandleBottomButtons();
|
||||||
|
|
||||||
@ -186,6 +195,10 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
super.onViewBound(view);
|
super.onViewBound(view);
|
||||||
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
||||||
|
|
||||||
|
if (isNewConversationView) {
|
||||||
|
getParentController().getView().findViewById(R.id.navigation).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
FlipView.resetLayoutAnimationDelay(true, 1000L);
|
FlipView.resetLayoutAnimationDelay(true, 1000L);
|
||||||
FlipView.stopLayoutAnimation();
|
FlipView.stopLayoutAnimation();
|
||||||
|
|
||||||
@ -239,6 +252,45 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
@Optional
|
@Optional
|
||||||
@OnClick(R.id.done_button)
|
@OnClick(R.id.done_button)
|
||||||
public void onDoneButtonClick() {
|
public void onDoneButtonClick() {
|
||||||
|
|
||||||
|
if (!isPublicCall && adapter.getSelectedPositions().size() == 1) {
|
||||||
|
RetrofitBucket retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(userEntity.getBaseUrl(), "1",
|
||||||
|
((UserItem) adapter.getItem(adapter.getSelectedPositions().get(0))).getModel().getUserId(), null);
|
||||||
|
ncApi.createRoom(ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()),
|
||||||
|
retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
|
||||||
|
.subscribeOn(Schedulers.newThread())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<RoomOverall>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(RoomOverall roomOverall) {
|
||||||
|
if (getActivity() != null) {
|
||||||
|
overridePushHandler(new NoOpControllerChangeHandler());
|
||||||
|
overridePopHandler(new NoOpControllerChangeHandler());
|
||||||
|
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
|
||||||
|
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
|
||||||
|
callIntent.putExtras(bundle);
|
||||||
|
startActivity(callIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
Room.RoomType roomType;
|
Room.RoomType roomType;
|
||||||
if (isPublicCall) {
|
if (isPublicCall) {
|
||||||
@ -254,12 +306,12 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
UserItem userItem = (UserItem) adapter.getItem(selectedPosition);
|
UserItem userItem = (UserItem) adapter.getItem(selectedPosition);
|
||||||
userIds.add(userItem.getModel().getUserId());
|
userIds.add(userItem.getModel().getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
bundle.putStringArrayList(BundleKeys.KEY_INVITED_PARTICIPANTS, userIds);
|
bundle.putStringArrayList(BundleKeys.KEY_INVITED_PARTICIPANTS, userIds);
|
||||||
bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 11);
|
bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 11);
|
||||||
prepareAndShowBottomSheetWithBundle(bundle);
|
prepareAndShowBottomSheetWithBundle(bundle);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initSearchView() {
|
private void initSearchView() {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
@ -588,7 +640,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,4 +732,25 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
|
|
||||||
bottomSheet.show();
|
bottomSheet.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onMessageEvent(BottomSheetLockEvent bottomSheetLockEvent) {
|
||||||
|
if (bottomSheet != null) {
|
||||||
|
if (!bottomSheetLockEvent.isCancelable()) {
|
||||||
|
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
|
||||||
|
} else {
|
||||||
|
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
|
||||||
|
if (bottomSheet.isShowing() && bottomSheetLockEvent.isCancel()) {
|
||||||
|
bottomSheet.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDetach(@NonNull View view) {
|
||||||
|
super.onDetach(view);
|
||||||
|
eventBus.unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,9 +38,9 @@ import com.nextcloud.talk.R;
|
|||||||
import com.nextcloud.talk.adapters.items.AppItem;
|
import com.nextcloud.talk.adapters.items.AppItem;
|
||||||
import com.nextcloud.talk.adapters.items.MenuItem;
|
import com.nextcloud.talk.adapters.items.MenuItem;
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.controllers.ContactsController;
|
|
||||||
import com.nextcloud.talk.controllers.base.BaseController;
|
import com.nextcloud.talk.controllers.base.BaseController;
|
||||||
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
||||||
|
import com.nextcloud.talk.events.ShowScreenEvent;
|
||||||
import com.nextcloud.talk.models.json.rooms.Room;
|
import com.nextcloud.talk.models.json.rooms.Room;
|
||||||
import com.nextcloud.talk.utils.ShareUtils;
|
import com.nextcloud.talk.utils.ShareUtils;
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
@ -237,12 +237,7 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
|
|||||||
eventBus.post(new BottomSheetLockEvent(true, 0, false, true));
|
eventBus.post(new BottomSheetLockEvent(true, 0, false, true));
|
||||||
bundle = new Bundle();
|
bundle = new Bundle();
|
||||||
bundle.putBoolean(BundleKeys.KEY_NEW_CONVERSATION, true);
|
bundle.putBoolean(BundleKeys.KEY_NEW_CONVERSATION, true);
|
||||||
if (getParentController() != null && getParentController().getParentController() != null) {
|
eventBus.post(new ShowScreenEvent(ShowScreenEvent.ScreenType.CONTACTS_SCREEN, bundle));
|
||||||
getParentController().getParentController().getRouter().pushController(
|
|
||||||
(RouterTransaction.with(new ContactsController(bundle))
|
|
||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
|
||||||
.popChangeHandler(new HorizontalChangeHandler())));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
bundle = new Bundle();
|
bundle = new Bundle();
|
||||||
bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 10);
|
bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 10);
|
||||||
|
@ -507,6 +507,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, baseUrl);
|
bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, baseUrl);
|
||||||
}
|
}
|
||||||
bundle.putString(BundleKeys.KEY_CALL_SESSION, callSession);
|
bundle.putString(BundleKeys.KEY_CALL_SESSION, callSession);
|
||||||
|
|
||||||
overridePushHandler(new NoOpControllerChangeHandler());
|
overridePushHandler(new NoOpControllerChangeHandler());
|
||||||
overridePopHandler(new NoOpControllerChangeHandler());
|
overridePopHandler(new NoOpControllerChangeHandler());
|
||||||
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
||||||
|
Loading…
Reference in New Issue
Block a user