Search in sources :

Example 6 with RocketChatCache

use of chat.rocket.android.RocketChatCache 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)

Example 7 with RocketChatCache

use of chat.rocket.android.RocketChatCache in project Rocket.Chat.Android by RocketChat.

the class AbstractAuthedActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    rocketChatCache = new RocketChatCache(this);
    if (savedInstanceState == null) {
        handleIntent(getIntent());
    }
    updateHostnameIfNeeded(rocketChatCache.getSelectedServerHostname());
    updateRoomIdIfNeeded(rocketChatCache.getSelectedRoomId());
}
Also used : RocketChatCache(chat.rocket.android.RocketChatCache)

Aggregations

RocketChatCache (chat.rocket.android.RocketChatCache)7 RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)3 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)3 Bundle (android.os.Bundle)2 MethodCallHelper (chat.rocket.android.api.MethodCallHelper)2 RoomInteractor (chat.rocket.core.interactors.RoomInteractor)2 SessionInteractor (chat.rocket.core.interactors.SessionInteractor)2 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)2 DebugLog (hugo.weaving.DebugLog)2 Dialog (android.app.Dialog)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 NonNull (android.support.annotation.NonNull)1 BottomSheetDialog (android.support.design.widget.BottomSheetDialog)1 BottomSheetDialogFragment (android.support.design.widget.BottomSheetDialogFragment)1 Pair (android.support.v4.util.Pair)1 View (android.view.View)1 TextView (android.widget.TextView)1 BackgroundLooper (chat.rocket.android.BackgroundLooper)1 R (chat.rocket.android.R)1