I think you are all sad :). Provide a layout for your components, I would suggest a LinearLayout with a horizontal orientation. Then you add all three fragments to it, and you hide the third containing the message.
FolderListFragment folderListFragment = new FolderListFragment(); MessageListFragment messageListFragment = new MessageListFragment(); MessageFragment messageFragment = new MessageFragment(); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.add(container_view_layout, folderListFragment); ft.add(container_view_layout, messageListFragment); ft.add(container_view_layout, messageFragment); ft.hide(messageFragment); ft.commit();
Then, when you want to show a snippet of message:
void showMessage(Message message) {
And for animations, there will be slide_in_left for the folder fragment, you can get the rest (400 is the width of the component):
<set> <objectAnimator android:propertyName="x" android:duration="500" android:valueFrom="-400" android:valueTo="0" android:valueType="intType"/> </set>
source share