Search in sources :

Example 1 with MessageInteractor

use of chat.rocket.core.interactors.MessageInteractor in project Rocket.Chat.Android by RocketChat.

the class RoomFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    hostname = args.getString(HOSTNAME);
    roomId = args.getString(ROOM_ID);
    roomRepository = new RealmRoomRepository(hostname);
    MessageInteractor messageInteractor = new MessageInteractor(new RealmMessageRepository(hostname), roomRepository);
    userRepository = new RealmUserRepository(hostname);
    absoluteUrlHelper = new AbsoluteUrlHelper(hostname, new RealmServerInfoRepository(), userRepository, new SessionInteractor(new RealmSessionRepository(hostname)));
    methodCallHelper = new MethodCallHelper(getContext(), hostname);
    presenter = new RoomPresenter(roomId, userRepository, messageInteractor, roomRepository, absoluteUrlHelper, methodCallHelper, ConnectivityManager.getInstance(getContext()));
    if (savedInstanceState == null) {
        presenter.loadMessages();
    }
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) AbsoluteUrlHelper(chat.rocket.android.helper.AbsoluteUrlHelper) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) MessageInteractor(chat.rocket.core.interactors.MessageInteractor) Bundle(android.os.Bundle) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmMessageRepository(chat.rocket.persistence.realm.repositories.RealmMessageRepository) RealmServerInfoRepository(chat.rocket.persistence.realm.repositories.RealmServerInfoRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository)

Aggregations

Bundle (android.os.Bundle)1 MethodCallHelper (chat.rocket.android.api.MethodCallHelper)1 AbsoluteUrlHelper (chat.rocket.android.helper.AbsoluteUrlHelper)1 MessageInteractor (chat.rocket.core.interactors.MessageInteractor)1 SessionInteractor (chat.rocket.core.interactors.SessionInteractor)1 RealmMessageRepository (chat.rocket.persistence.realm.repositories.RealmMessageRepository)1 RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)1 RealmServerInfoRepository (chat.rocket.persistence.realm.repositories.RealmServerInfoRepository)1 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)1 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)1