contentFragment = new DossierDetailFragment();
contentFragment.setRetainInstance(true);
- FragmentTransaction contenttransaction = getFragmentManager().beginTransaction();
- contenttransaction.replace(R.id.dossier_detail_layout, contentFragment, DossierDetailFragment.FRAGMENT_TAG);
- contenttransaction.commit();
+ FragmentTransaction contentTransaction = getFragmentManager().beginTransaction();
+ contentTransaction.replace(R.id.dossier_detail_layout, contentFragment, DossierDetailFragment.FRAGMENT_TAG);
+ contentTransaction.commit();
// Menu Fragment restore
- MenuFragment menuFragment = (MenuFragment) getFragmentManager().findFragmentByTag(MenuFragment.FRAGMENT_TAG);
- if (menuFragment == null)
- menuFragment = new MenuFragment();
- menuFragment.setRetainInstance(true);
-
- FragmentTransaction menuTransaction = getFragmentManager().beginTransaction();
- menuTransaction.replace(R.id.menu_layout, menuFragment, MenuFragment.FRAGMENT_TAG);
- menuTransaction.commit();
}
@Override protected void onPostCreate(Bundle savedInstanceState) {
import org.adullact.iparapheur.utils.CollectionUtils;
import org.adullact.iparapheur.utils.DeviceUtils;
import org.adullact.iparapheur.utils.IParapheurException;
+import org.adullact.iparapheur.utils.StringUtils;
import org.adullact.iparapheur.utils.ViewUtils;
import java.util.ArrayList;
// <editor-fold desc="LifeCycle">
- @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.menu_fragment, container, false);
+ setRetainInstance(true);
// Retrieve Views
mBureauListView.setVisibility(View.VISIBLE);
mBureauEmptyView.setVisibility(View.INVISIBLE);
- if (mSelectedBureau != null) {
+ if (mSelectedBureau != null)
mViewSwitcher.setDisplayedChild(1);
- }
}
//
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:baselineAligned="false"
- android:orientation="vertical">
+<ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:baselineAligned="false"
+ android:orientation="vertical">
- <FrameLayout
- android:id="@+id/menu_layout"
+ <fragment
+ android:id="@+id/account_list_fragment"
+ android:name="org.adullact.iparapheur.controller.account.AccountListFragment"
android:layout_width="match_parent"
- android:layout_height="match_parent" />
-</FrameLayout>
\ No newline at end of file
+ android:layout_height="match_parent"
+ android:tag="account_list_fragment"
+ tools:layout="@layout/account_list_fragment"/>
+
+ <fragment
+ android:id="@+id/menu_fragment"
+ android:name="org.adullact.iparapheur.controller.MenuFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:tag="menu_fragment"/>
+
+</ViewSwitcher>
\ No newline at end of file
android:baselineAligned="false"
android:orientation="horizontal">
- <FrameLayout
- android:id="@+id/menu_layout"
+ <fragment android:name="org.adullact.iparapheur.controller.MenuFragment"
+ android:id="@+id/menu_fragment"
android:layout_width="@dimen/left_menu_size"
android:layout_height="match_parent"
android:elevation="2dp"