Search in sources :

Example 1 with RoomInteractor

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

the class SidebarMainFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    hostname = args == null ? null : args.getString(HOSTNAME);
    methodCallHelper = new MethodCallHelper(getContext(), hostname);
    realmSpotlightRoomRepository = new RealmSpotlightRoomRepository(hostname);
    RealmUserRepository userRepository = new RealmUserRepository(hostname);
    AbsoluteUrlHelper absoluteUrlHelper = new AbsoluteUrlHelper(hostname, new RealmServerInfoRepository(), userRepository, new SessionInteractor(new RealmSessionRepository(hostname)));
    presenter = new SidebarMainPresenter(hostname, new RoomInteractor(new RealmRoomRepository(hostname)), userRepository, new RocketChatCache(getContext()), absoluteUrlHelper, TextUtils.isEmpty(hostname) ? null : new MethodCallHelper(getContext(), hostname));
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) RealmSpotlightRoomRepository(chat.rocket.persistence.realm.repositories.RealmSpotlightRoomRepository) AbsoluteUrlHelper(chat.rocket.android.helper.AbsoluteUrlHelper) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) RoomInteractor(chat.rocket.core.interactors.RoomInteractor) Bundle(android.os.Bundle) RocketChatCache(chat.rocket.android.RocketChatCache) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmServerInfoRepository(chat.rocket.persistence.realm.repositories.RealmServerInfoRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository)

Example 2 with RoomInteractor

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

the class MainActivity method onHostnameUpdated.

@DebugLog
@Override
protected void onHostnameUpdated() {
    super.onHostnameUpdated();
    if (presenter != null) {
        presenter.release();
    }
    RoomInteractor roomInteractor = new RoomInteractor(new RealmRoomRepository(hostname));
    CanCreateRoomInteractor createRoomInteractor = new CanCreateRoomInteractor(new RealmUserRepository(hostname), new SessionInteractor(new RealmSessionRepository(hostname)));
    SessionInteractor sessionInteractor = new SessionInteractor(new RealmSessionRepository(hostname));
    presenter = new MainPresenter(roomInteractor, createRoomInteractor, sessionInteractor, new MethodCallHelper(this, hostname), ConnectivityManager.getInstance(getApplicationContext()), new RocketChatCache(this));
    updateSidebarMainFragment();
    presenter.bindView(this);
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) CanCreateRoomInteractor(chat.rocket.core.interactors.CanCreateRoomInteractor) RoomInteractor(chat.rocket.core.interactors.RoomInteractor) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) CanCreateRoomInteractor(chat.rocket.core.interactors.CanCreateRoomInteractor) RocketChatCache(chat.rocket.android.RocketChatCache) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository) DebugLog(hugo.weaving.DebugLog)

Aggregations

RocketChatCache (chat.rocket.android.RocketChatCache)2 MethodCallHelper (chat.rocket.android.api.MethodCallHelper)2 RoomInteractor (chat.rocket.core.interactors.RoomInteractor)2 SessionInteractor (chat.rocket.core.interactors.SessionInteractor)2 RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)2 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)2 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)2 Bundle (android.os.Bundle)1 AbsoluteUrlHelper (chat.rocket.android.helper.AbsoluteUrlHelper)1 CanCreateRoomInteractor (chat.rocket.core.interactors.CanCreateRoomInteractor)1 RealmServerInfoRepository (chat.rocket.persistence.realm.repositories.RealmServerInfoRepository)1 RealmSpotlightRoomRepository (chat.rocket.persistence.realm.repositories.RealmSpotlightRoomRepository)1 DebugLog (hugo.weaving.DebugLog)1