use of chat.rocket.persistence.realm.repositories.RealmSessionRepository 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));
}
use of chat.rocket.persistence.realm.repositories.RealmSessionRepository in project Rocket.Chat.Android by RocketChat.
the class AddDirectMessageDialogFragment method onSetupDialog.
@SuppressLint("RxLeakedSubscription")
@Override
protected void onSetupDialog() {
View buttonAddDirectMessage = getDialog().findViewById(R.id.btn_add_direct_message);
AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) getDialog().findViewById(R.id.editor_username);
AbsoluteUrlHelper absoluteUrlHelper = new AbsoluteUrlHelper(hostname, new RealmServerInfoRepository(), new RealmUserRepository(hostname), new SessionInteractor(new RealmSessionRepository(hostname)));
compositeDisposable.add(absoluteUrlHelper.getRocketChatAbsoluteUrl().subscribeOn(AndroidSchedulers.from(BackgroundLooper.get())).observeOn(AndroidSchedulers.mainThread()).subscribe(this::setupView, Logger::report));
RxTextView.textChanges(autoCompleteTextView).map(text -> !TextUtils.isEmpty(text)).compose(bindToLifecycle()).subscribe(buttonAddDirectMessage::setEnabled, Logger::report);
buttonAddDirectMessage.setOnClickListener(view -> createRoom());
}
use of chat.rocket.persistence.realm.repositories.RealmSessionRepository in project Rocket.Chat.Android by RocketChat.
the class RetryLoginFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
presenter = new RetryLoginPresenter(new SessionInteractor(new RealmSessionRepository(hostname)), new MethodCallHelper(getContext(), hostname));
}
use of chat.rocket.persistence.realm.repositories.RealmSessionRepository in project Rocket.Chat.Android by RocketChat.
the class UsersOfRoomDialogFragment method onSetupDialog.
@Override
protected void onSetupDialog() {
AbsoluteUrlHelper absoluteUrlHelper = new AbsoluteUrlHelper(hostname, new RealmServerInfoRepository(), new RealmUserRepository(hostname), new SessionInteractor(new RealmSessionRepository(hostname)));
compositeDisposable.add(absoluteUrlHelper.getRocketChatAbsoluteUrl().subscribeOn(AndroidSchedulers.from(BackgroundLooper.get())).observeOn(AndroidSchedulers.mainThread()).subscribe(this::setupView, Logger::report));
}
use of chat.rocket.persistence.realm.repositories.RealmSessionRepository 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();
}
}
Aggregations