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