@@ -74,40 +74,7 @@ public class MainActivity extends AppCompatActivity {
74
74
private int lastExpandedGroup = -1 ;
75
75
private int lastChildExpandedGroup = -1 ;
76
76
private String [] runTimePermissions = new String []{Manifest .permission .ACCESS_FINE_LOCATION , Manifest .permission .SEND_SMS , Manifest .permission .CALL_PHONE , Manifest .permission .READ_CONTACTS };
77
-
78
- public static void swapFragmentIn (FragmentActivity activity , Fragment fragment , String TAG , boolean addToBackStack ) {
79
- FragmentManager fragmentManager = activity .getSupportFragmentManager ();
80
- // Insert the fragment by replacing any existing fragment
81
- FRAGMENT_TAG = TAG ;
82
- int animEnter = R .anim .push_down_in ;
83
- int animExit = R .anim .push_down_out ;
84
- int animPopEnter = R .anim .fade_in ;
85
- int animPopExit = R .anim .fade_out ;
86
-
87
- if (addToBackStack ) {
88
- if (TAG .equals (ContactOtherStaff .TAG )) {
89
- animEnter = R .anim .fade_in ;
90
- animExit = R .anim .fade_out ;
91
- animPopEnter = R .anim .fade_in_back ;
92
- animPopExit = R .anim .fade_out_back ;
93
- }
94
- fragmentManager .beginTransaction ()
95
- .setCustomAnimations (animEnter , animExit , animPopEnter , animPopExit )
96
- .replace (R .id .fragment_container
97
- , fragment , TAG )
98
- .addToBackStack (TAG )
99
- .commit ();
100
- } else {
101
- animEnter = R .anim .fade_in ;
102
- animExit = R .anim .fade_out ;
103
- fragmentManager .beginTransaction ()
104
- .setCustomAnimations (animEnter , animExit , animPopEnter , animPopExit )
105
- .replace (R .id .fragment_container
106
- , fragment , TAG )
107
- .commit ();
108
- }
109
- }
110
-
77
+
111
78
@ Override
112
79
protected void onCreate (Bundle savedInstanceState ) {
113
80
super .onCreate (savedInstanceState );
@@ -302,6 +269,41 @@ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition
302
269
});
303
270
}
304
271
272
+
273
+ public static void swapFragmentIn (FragmentActivity activity , Fragment fragment , String TAG , boolean addToBackStack )
274
+ {
275
+ FragmentManager fragmentManager = activity .getSupportFragmentManager ();
276
+ // Insert the fragment by replacing any existing fragment
277
+ FRAGMENT_TAG = TAG ;
278
+ int animEnter = R .anim .fade_in ;
279
+ int animExit = R .anim .fade_out ;
280
+ int animPopEnter = R .anim .fade_in_back ;
281
+ int animPopExit = R .anim .fade_out_back ;
282
+
283
+ if (addToBackStack ){
284
+ if (TAG .equals (ContactOtherStaff .TAG )) {
285
+ animEnter = R .anim .fade_in ;
286
+ animExit = R .anim .fade_out ;
287
+ animPopEnter = R .anim .fade_in_back ;
288
+ animPopExit = R .anim .fade_out_back ;
289
+ }
290
+ fragmentManager .beginTransaction ()
291
+ .setCustomAnimations (animEnter , animExit , animPopEnter , animPopExit )
292
+ .replace (R .id .fragment_container
293
+ , fragment ,TAG )
294
+ .addToBackStack (TAG )
295
+ .commit ();
296
+ } else {
297
+ animEnter = R .anim .fade_in ;
298
+ animExit = R .anim .fade_out ;
299
+ fragmentManager .beginTransaction ()
300
+ .setCustomAnimations (animEnter , animExit , animPopEnter , animPopExit )
301
+ .replace (R .id .fragment_container
302
+ , fragment ,TAG )
303
+ .commit ();
304
+ }
305
+ }
306
+
305
307
/**
306
308
* Populating the expandable list of the Navigation Drawer
307
309
*/
0 commit comments