]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/fragments/GuideTabFragment.java
Finish creating the bookmark drawer. https://redmine.stoutner.com/issues/132
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / fragments / GuideTabFragment.java
index 9e5f568d0d2d0af4ecf1c0c1a94efc96d55bb579..a89ced02132f5d58c6946d36930bfb3d5fb5fc54 100644 (file)
@@ -34,21 +34,28 @@ public class GuideTabFragment extends Fragment {
     // `tabNumber` is used in `onCreate()` and `onCreateView()`.
     private int tabNumber;
 
-    // GuideTabFragment.createTab stores the tab number in the bundle arguments so it can be referenced from onCreate().
+    // Store the tab number in the arguments bundle.
     public static GuideTabFragment createTab (int tab) {
-        Bundle thisTabArguments = new Bundle();
-        thisTabArguments.putInt("Tab", tab);
+        // Create a bundle.
+        Bundle bundle = new Bundle();
 
-        GuideTabFragment thisTab = new GuideTabFragment();
-        thisTab.setArguments(thisTabArguments);
-        return thisTab;
+        // Store the tab number in the bundle.
+        bundle.putInt("Tab", tab);
+
+        // Add the bundle to the fragment.
+        GuideTabFragment guideTabFragment = new GuideTabFragment();
+        guideTabFragment.setArguments(bundle);
+
+        // Return the new fragment.
+        return guideTabFragment;
     }
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
+        // Run the default commands.
         super.onCreate(savedInstanceState);
 
-        // Store the tab number in `tabNumber`.
+        // Store the tab number in a class variable.
         tabNumber = getArguments().getInt("Tab");
     }