Search in sources :

Example 6 with SlidingPaneLayout

use of android.support.v4.widget.SlidingPaneLayout in project Conversations by siacs.

the class ConversationActivity method handleViewConversationIntent.

private void handleViewConversationIntent(final Intent intent) {
    final String uuid = intent.getStringExtra(CONVERSATION);
    final String downloadUuid = intent.getStringExtra(EXTRA_DOWNLOAD_UUID);
    final String text = intent.getStringExtra(TEXT);
    final String nick = intent.getStringExtra(NICK);
    final boolean pm = intent.getBooleanExtra(PRIVATE_MESSAGE, false);
    if (selectConversationByUuid(uuid)) {
        this.mConversationFragment.reInit(getSelectedConversation());
        if (nick != null) {
            if (pm) {
                Jid jid = getSelectedConversation().getJid();
                try {
                    Jid next = Jid.fromParts(jid.getLocalpart(), jid.getDomainpart(), nick);
                    this.mConversationFragment.privateMessageWith(next);
                } catch (final InvalidJidException ignored) {
                //do nothing
                }
            } else {
                this.mConversationFragment.highlightInConference(nick);
            }
        } else {
            this.mConversationFragment.appendText(text);
        }
        hideConversationsOverview();
        mUnprocessedNewIntent = false;
        openConversation();
        if (mContentView instanceof SlidingPaneLayout) {
            //fixes bug where slp isn't properly closed yet
            updateActionBarTitle(true);
        }
        if (downloadUuid != null) {
            final Message message = mSelectedConversation.findMessageWithFileAndUuid(downloadUuid);
            if (message != null) {
                startDownloadable(message);
            }
        }
    } else {
        mUnprocessedNewIntent = false;
    }
}
Also used : Jid(eu.siacs.conversations.xmpp.jid.Jid) Message(eu.siacs.conversations.entities.Message) InvalidJidException(eu.siacs.conversations.xmpp.jid.InvalidJidException) SlidingPaneLayout(android.support.v4.widget.SlidingPaneLayout)

Example 7 with SlidingPaneLayout

use of android.support.v4.widget.SlidingPaneLayout in project Conversations by siacs.

the class ConversationActivity method showConversationsOverview.

public void showConversationsOverview() {
    if (mContentView instanceof SlidingPaneLayout) {
        SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
        mShouldPanelBeOpen.set(true);
        mSlidingPaneLayout.openPane();
    }
}
Also used : SlidingPaneLayout(android.support.v4.widget.SlidingPaneLayout)

Example 8 with SlidingPaneLayout

use of android.support.v4.widget.SlidingPaneLayout in project RxBinding by JakeWharton.

the class RxSlidingPaneLayoutTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    slidingPaneLayout = new SlidingPaneLayout(this);
    slidingPaneLayout.setId(android.R.id.primary);
    FrameLayout paneOne = new FrameLayout(this);
    LayoutParams paneOneParams = new LayoutParams(300, MATCH_PARENT);
    slidingPaneLayout.addView(paneOne, paneOneParams);
    FrameLayout paneTwo = new FrameLayout(this);
    paneTwo.setBackgroundColor(Color.WHITE);
    LayoutParams paneTwoParams = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
    paneTwoParams.leftMargin = 50;
    slidingPaneLayout.addView(paneTwo, paneTwoParams);
    setContentView(slidingPaneLayout);
}
Also used : LayoutParams(android.support.v4.widget.SlidingPaneLayout.LayoutParams) FrameLayout(android.widget.FrameLayout) SlidingPaneLayout(android.support.v4.widget.SlidingPaneLayout)

Example 9 with SlidingPaneLayout

use of android.support.v4.widget.SlidingPaneLayout 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

SlidingPaneLayout (android.support.v4.widget.SlidingPaneLayout)8 View (android.view.View)3 ViewGroup (android.view.ViewGroup)2 FrameLayout (android.widget.FrameLayout)2 Manifest (android.Manifest)1 SuppressLint (android.annotation.SuppressLint)1 ActionBar (android.app.ActionBar)1 Activity (android.app.Activity)1 FragmentTransaction (android.app.FragmentTransaction)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 Fragment (android.support.v4.app.Fragment)1 BuildCompat (android.support.v4.os.BuildCompat)1