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();
}
}
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);
}
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));
}
Aggregations