Search in sources :

Example 6 with RealmSessionRepository

use of chat.rocket.persistence.realm.repositories.RealmSessionRepository in project Rocket.Chat.Android by RocketChat.

the class LoginActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    String hostname = null;
    Intent intent = getIntent();
    if (intent != null && intent.getExtras() != null) {
        hostname = intent.getStringExtra(KEY_HOSTNAME);
    }
    presenter = new LoginPresenter(hostname, new SessionInteractor(new RealmSessionRepository(hostname)), ConnectivityManager.getInstance(getApplicationContext()));
}
Also used : SessionInteractor(chat.rocket.core.interactors.SessionInteractor) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) Intent(android.content.Intent)

Example 7 with RealmSessionRepository

use of chat.rocket.persistence.realm.repositories.RealmSessionRepository 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

SessionInteractor (chat.rocket.core.interactors.SessionInteractor)7 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)7 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)5 MethodCallHelper (chat.rocket.android.api.MethodCallHelper)4 AbsoluteUrlHelper (chat.rocket.android.helper.AbsoluteUrlHelper)4 RealmServerInfoRepository (chat.rocket.persistence.realm.repositories.RealmServerInfoRepository)4 RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)3 Bundle (android.os.Bundle)2 RocketChatCache (chat.rocket.android.RocketChatCache)2 RoomInteractor (chat.rocket.core.interactors.RoomInteractor)2 SuppressLint (android.annotation.SuppressLint)1 Intent (android.content.Intent)1 View (android.view.View)1 AutoCompleteTextView (android.widget.AutoCompleteTextView)1 TextView (android.widget.TextView)1 Logger (chat.rocket.android.helper.Logger)1 CanCreateRoomInteractor (chat.rocket.core.interactors.CanCreateRoomInteractor)1 MessageInteractor (chat.rocket.core.interactors.MessageInteractor)1 RealmMessageRepository (chat.rocket.persistence.realm.repositories.RealmMessageRepository)1 RealmSpotlightRoomRepository (chat.rocket.persistence.realm.repositories.RealmSpotlightRoomRepository)1