Search in sources :

Example 1 with UsersOfRoomDialogFragment

use of chat.rocket.android.fragment.chatroom.dialog.UsersOfRoomDialogFragment in project Rocket.Chat.Android by RocketChat.

the class RoomFragment method setupSideMenu.

private void setupSideMenu() {
    View sideMenu = rootView.findViewById(R.id.room_side_menu);
    sideMenu.findViewById(R.id.btn_users).setOnClickListener(view -> {
        UsersOfRoomDialogFragment.create(roomId, hostname).show(getFragmentManager(), "UsersOfRoomDialogFragment");
        closeSideMenuIfNeeded();
    });
    DrawerLayout drawerLayout = (DrawerLayout) rootView.findViewById(R.id.drawer_layout);
    SlidingPaneLayout pane = (SlidingPaneLayout) getActivity().findViewById(R.id.sliding_pane);
    if (drawerLayout != null && pane != null) {
        compositeDisposable.add(RxDrawerLayout.drawerOpen(drawerLayout, GravityCompat.END).compose(bindToLifecycle()).subscribe(opened -> {
            try {
                Field fieldSlidable = pane.getClass().getDeclaredField("mCanSlide");
                fieldSlidable.setAccessible(true);
                fieldSlidable.setBoolean(pane, !opened);
            } catch (Exception exception) {
                RCLog.w(exception);
            }
        }, Logger::report));
    }
}
Also used : Bundle(android.os.Bundle) RxDrawerLayout(com.jakewharton.rxbinding2.support.v4.widget.RxDrawerLayout) Uri(android.net.Uri) RocketChatUserStatusProvider(chat.rocket.android.renderer.RocketChatUserStatusProvider) AutocompleteUserInteractor(chat.rocket.core.interactors.AutocompleteUserInteractor) DialogFragment(android.support.v4.app.DialogFragment) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) MessageInteractor(chat.rocket.core.interactors.MessageInteractor) RealmSpotlightRoomRepository(chat.rocket.persistence.realm.repositories.RealmSpotlightRoomRepository) MethodCallHelper(chat.rocket.android.api.MethodCallHelper) Manifest(android.Manifest) LoadMoreScrollListener(chat.rocket.android.helper.LoadMoreScrollListener) View(android.view.View) TextUtils(chat.rocket.android.helper.TextUtils) MessageOptionsDialogFragment(chat.rocket.android.fragment.chatroom.dialog.MessageOptionsDialogFragment) AbsoluteUrlHelper(chat.rocket.android.helper.AbsoluteUrlHelper) OnBackPressListener(chat.rocket.android.helper.OnBackPressListener) RealmServerInfoRepository(chat.rocket.persistence.realm.repositories.RealmServerInfoRepository) AbstractUploadActionItem(chat.rocket.android.layouthelper.extra_action.upload.AbstractUploadActionItem) MessageFormManager(chat.rocket.android.layouthelper.chatroom.MessageFormManager) ModelListAdapter(chat.rocket.android.layouthelper.chatroom.ModelListAdapter) SessionInteractor(chat.rocket.core.interactors.SessionInteractor) PairedMessage(chat.rocket.android.layouthelper.chatroom.PairedMessage) ChannelSource(chat.rocket.android.widget.message.autocomplete.channel.ChannelSource) AutocompleteManager(chat.rocket.android.widget.message.autocomplete.AutocompleteManager) RuntimePermissions(permissions.dispatcher.RuntimePermissions) ViewGroup(android.view.ViewGroup) Message(chat.rocket.core.models.Message) RealmMessageRepository(chat.rocket.persistence.realm.repositories.RealmMessageRepository) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) List(java.util.List) RealmSpotlightUserRepository(chat.rocket.persistence.realm.repositories.RealmSpotlightUserRepository) FileUploadProgressDialogFragment(chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment) RealmSessionRepository(chat.rocket.persistence.realm.repositories.RealmSessionRepository) Room(chat.rocket.core.models.Room) Nullable(android.support.annotation.Nullable) Snackbar(android.support.design.widget.Snackbar) BackgroundLooper(chat.rocket.android.BackgroundLooper) SlidingPaneLayout(android.support.v4.widget.SlidingPaneLayout) RealmStore(chat.rocket.persistence.realm.RealmStore) RecyclerViewScrolledToBottomListener(chat.rocket.android.helper.RecyclerViewScrolledToBottomListener) DefaultTempSpotlightUserCaller(chat.rocket.android.service.temp.DefaultTempSpotlightUserCaller) AudioUploadActionItem(chat.rocket.android.layouthelper.extra_action.upload.AudioUploadActionItem) UserSource(chat.rocket.android.widget.message.autocomplete.user.UserSource) Intent(android.content.Intent) NonNull(android.support.annotation.NonNull) AbstractNewMessageIndicatorManager(chat.rocket.android.layouthelper.chatroom.AbstractNewMessageIndicatorManager) ImageUploadActionItem(chat.rocket.android.layouthelper.extra_action.upload.ImageUploadActionItem) Single(io.reactivex.Single) ConnectivityManager(chat.rocket.android.service.ConnectivityManager) ExtraActionPickerDialogFragment(chat.rocket.android.widget.internal.ExtraActionPickerDialogFragment) ArrayList(java.util.ArrayList) GravityCompat(android.support.v4.view.GravityCompat) VideoUploadActionItem(chat.rocket.android.layouthelper.extra_action.upload.VideoUploadActionItem) UsersOfRoomDialogFragment(chat.rocket.android.fragment.chatroom.dialog.UsersOfRoomDialogFragment) R(chat.rocket.android.R) RealmRoomRepository(chat.rocket.persistence.realm.repositories.RealmRoomRepository) DrawerLayout(android.support.v4.widget.DrawerLayout) MessageFormLayout(chat.rocket.android.widget.message.MessageFormLayout) Optional(com.fernandocejas.arrow.optional.Optional) InputContentInfoCompat(android.support.v13.view.inputmethod.InputContentInfoCompat) MessageExtraActionBehavior(chat.rocket.android.layouthelper.extra_action.MessageExtraActionBehavior) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Logger(chat.rocket.android.helper.Logger) Field(java.lang.reflect.Field) RCLog(chat.rocket.android.log.RCLog) RecyclerView(android.support.v7.widget.RecyclerView) NeedsPermission(permissions.dispatcher.NeedsPermission) MessageListAdapter(chat.rocket.android.layouthelper.chatroom.MessageListAdapter) AutocompleteChannelInteractor(chat.rocket.core.interactors.AutocompleteChannelInteractor) InputConnectionCompat(android.support.v13.view.inputmethod.InputConnectionCompat) AlertDialog(android.support.v7.app.AlertDialog) Pair(android.support.v4.util.Pair) FileUploadHelper(chat.rocket.android.helper.FileUploadHelper) DeafultTempSpotlightRoomCaller(chat.rocket.android.service.temp.DeafultTempSpotlightRoomCaller) AbstractExtraActionItem(chat.rocket.android.layouthelper.extra_action.AbstractExtraActionItem) RealmUserRepository(chat.rocket.persistence.realm.repositories.RealmUserRepository) Activity(android.app.Activity) BuildCompat(android.support.v4.os.BuildCompat) RecyclerViewAutoScrollManager(chat.rocket.android.helper.RecyclerViewAutoScrollManager) Field(java.lang.reflect.Field) RxDrawerLayout(com.jakewharton.rxbinding2.support.v4.widget.RxDrawerLayout) DrawerLayout(android.support.v4.widget.DrawerLayout) SlidingPaneLayout(android.support.v4.widget.SlidingPaneLayout) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

Manifest (android.Manifest)1 Activity (android.app.Activity)1 Intent (android.content.Intent)1 Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 Snackbar (android.support.design.widget.Snackbar)1 InputConnectionCompat (android.support.v13.view.inputmethod.InputConnectionCompat)1 InputContentInfoCompat (android.support.v13.view.inputmethod.InputContentInfoCompat)1 DialogFragment (android.support.v4.app.DialogFragment)1 BuildCompat (android.support.v4.os.BuildCompat)1 Pair (android.support.v4.util.Pair)1 GravityCompat (android.support.v4.view.GravityCompat)1 DrawerLayout (android.support.v4.widget.DrawerLayout)1 SlidingPaneLayout (android.support.v4.widget.SlidingPaneLayout)1 AlertDialog (android.support.v7.app.AlertDialog)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1