Search in sources :

Example 1 with Room

use of com.nextcloud.talk.models.json.rooms.Room in project talk-android by nextcloud.

the class CallsListController method onItemClick.

@Override
public boolean onItemClick(View view, int position) {
    CallItem callItem = adapter.getItem(position);
    if (callItem != null && getActivity() != null) {
        Room room = callItem.getModel();
        Bundle bundle = new Bundle();
        bundle.putString(BundleKeys.KEY_ROOM_TOKEN, callItem.getModel().getToken());
        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
        if (room.hasPassword && (room.participantType.equals(Participant.ParticipantType.GUEST) || room.participantType.equals(Participant.ParticipantType.USER_FOLLOWING_LINK))) {
            bundle.putInt(BundleKeys.KEY_OPERATION_CODE, 99);
            prepareAndShowBottomSheetWithBundle(bundle, false);
        } else {
            overridePushHandler(new NoOpControllerChangeHandler());
            overridePopHandler(new NoOpControllerChangeHandler());
            Intent callIntent = new Intent(getActivity(), CallActivity.class);
            callIntent.putExtras(bundle);
            startActivity(callIntent);
        }
    }
    return true;
}
Also used : Bundle(android.os.Bundle) CallItem(com.nextcloud.talk.adapters.items.CallItem) Intent(android.content.Intent) Room(com.nextcloud.talk.models.json.rooms.Room) NoOpControllerChangeHandler(com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler)

Example 2 with Room

use of com.nextcloud.talk.models.json.rooms.Room in project talk-android by nextcloud.

the class CallsListController method onMessageEvent.

@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(MoreMenuClickEvent moreMenuClickEvent) {
    Bundle bundle = new Bundle();
    Room room = moreMenuClickEvent.getRoom();
    bundle.putParcelable(BundleKeys.KEY_ROOM, Parcels.wrap(room));
    bundle.putParcelable(BundleKeys.KEY_MENU_TYPE, Parcels.wrap(CallMenuController.MenuType.REGULAR));
    prepareAndShowBottomSheetWithBundle(bundle, true);
}
Also used : Bundle(android.os.Bundle) Room(com.nextcloud.talk.models.json.rooms.Room) Subscribe(org.greenrobot.eventbus.Subscribe)

Aggregations

Bundle (android.os.Bundle)2 Room (com.nextcloud.talk.models.json.rooms.Room)2 Intent (android.content.Intent)1 NoOpControllerChangeHandler (com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler)1 CallItem (com.nextcloud.talk.adapters.items.CallItem)1 Subscribe (org.greenrobot.eventbus.Subscribe)1