Search in sources :

Example 6 with MethodCallHelper

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

Example 7 with MethodCallHelper

use of chat.rocket.android.api.MethodCallHelper 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 8 with MethodCallHelper

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

the class AbstractOAuthFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    if (!hasValidArgs(args)) {
        throw new IllegalArgumentException("hostname required");
    }
    hostname = args.getString("hostname");
    presenter = new OAuthPresenter(new RealmLoginServiceConfigurationRepository(hostname), new MethodCallHelper(getContext(), hostname));
}
Also used : MethodCallHelper(chat.rocket.android.api.MethodCallHelper) RealmLoginServiceConfigurationRepository(chat.rocket.persistence.realm.repositories.RealmLoginServiceConfigurationRepository) Bundle(android.os.Bundle)

Aggregations

MethodCallHelper (chat.rocket.android.api.MethodCallHelper)8 Bundle (android.os.Bundle)5 SessionInteractor (chat.rocket.core.interactors.SessionInteractor)4 RealmSessionRepository (chat.rocket.persistence.realm.repositories.RealmSessionRepository)4 RealmRoomRepository (chat.rocket.persistence.realm.repositories.RealmRoomRepository)3 RealmUserRepository (chat.rocket.persistence.realm.repositories.RealmUserRepository)3 RocketChatCache (chat.rocket.android.RocketChatCache)2 AbsoluteUrlHelper (chat.rocket.android.helper.AbsoluteUrlHelper)2 RoomInteractor (chat.rocket.core.interactors.RoomInteractor)2 RealmServerInfoRepository (chat.rocket.persistence.realm.repositories.RealmServerInfoRepository)2 Dialog (android.app.Dialog)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 DialogFragment (android.support.v4.app.DialogFragment)1 AlertDialog (android.support.v7.app.AlertDialog)1 Patterns (android.util.Patterns)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 TextView (android.widget.TextView)1 Toast (android.widget.Toast)1