Browse Source

Minor code style fixes.

Removed propTypes from example-redux screens
Guy Carmeli 8 years ago
parent
commit
6412a29029

+ 7
- 10
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java View File

94
         }
94
         }
95
     }
95
     }
96
 
96
 
97
-
98
     @Override
97
     @Override
99
     public boolean onCreateOptionsMenu(Menu menu) {
98
     public boolean onCreateOptionsMenu(Menu menu) {
100
         boolean ret = super.onCreateOptionsMenu(menu);
99
         boolean ret = super.onCreateOptionsMenu(menu);
142
         setNavigationStyle(mScreenStacks.get(mCurrentStackPosition).peek());
141
         setNavigationStyle(mScreenStacks.get(mCurrentStackPosition).peek());
143
     }
142
     }
144
 
143
 
145
-
146
     private static class SetupTabsTask extends AsyncTask<Void, Void, Map<Screen, Drawable>> {
144
     private static class SetupTabsTask extends AsyncTask<Void, Void, Map<Screen, Drawable>> {
147
-
148
-        private BottomTabActivity activity;
149
-        private ArrayList<Screen> screens;
145
+        private BottomTabActivity mActivity;
146
+        private ArrayList<Screen> mScreens;
150
 
147
 
151
         public SetupTabsTask(BottomTabActivity context, ArrayList<Screen> screens) {
148
         public SetupTabsTask(BottomTabActivity context, ArrayList<Screen> screens) {
152
-            this.activity = context;
153
-            this.screens = screens;
149
+            mActivity = context;
150
+            mScreens = screens;
154
         }
151
         }
155
 
152
 
156
         @Override
153
         @Override
157
         protected Map<Screen, Drawable> doInBackground(Void... params) {
154
         protected Map<Screen, Drawable> doInBackground(Void... params) {
158
             Map<Screen, Drawable> icons = new HashMap<>();
155
             Map<Screen, Drawable> icons = new HashMap<>();
159
-            for (Screen screen : this.screens) {
156
+            for (Screen screen : mScreens) {
160
                 if (screen.icon != null) {
157
                 if (screen.icon != null) {
161
-                    icons.put(screen, screen.getIcon(this.activity));
158
+                    icons.put(screen, screen.getIcon(this.mActivity));
162
                 }
159
                 }
163
             }
160
             }
164
             return icons;
161
             return icons;
166
 
163
 
167
         @Override
164
         @Override
168
         protected void onPostExecute(Map<Screen, Drawable> icons) {
165
         protected void onPostExecute(Map<Screen, Drawable> icons) {
169
-            activity.setTabsWithIcons(this.screens, icons);
166
+            mActivity.setTabsWithIcons(mScreens, icons);
170
         }
167
         }
171
     }
168
     }
172
 
169
 

+ 0
- 1
android/app/src/main/java/com/reactnativenavigation/modules/RctActivityModule.java View File

13
 import com.reactnativenavigation.activities.BaseReactActivity;
13
 import com.reactnativenavigation.activities.BaseReactActivity;
14
 import com.reactnativenavigation.activities.BottomTabActivity;
14
 import com.reactnativenavigation.activities.BottomTabActivity;
15
 import com.reactnativenavigation.activities.SingleScreenActivity;
15
 import com.reactnativenavigation.activities.SingleScreenActivity;
16
-import com.reactnativenavigation.activities.TabActivity;
17
 import com.reactnativenavigation.controllers.ModalController;
16
 import com.reactnativenavigation.controllers.ModalController;
18
 import com.reactnativenavigation.core.objects.Screen;
17
 import com.reactnativenavigation.core.objects.Screen;
19
 import com.reactnativenavigation.modal.RnnModal;
18
 import com.reactnativenavigation.modal.RnnModal;

+ 0
- 2
android/app/src/main/java/com/reactnativenavigation/utils/IconUtils.java View File

15
  * Created by yedidyak on 29/05/2016.
15
  * Created by yedidyak on 29/05/2016.
16
  */
16
  */
17
 public class IconUtils {
17
 public class IconUtils {
18
-
19
-
20
     public static final String LOCAL_RESOURCE_URI_SCHEME = "res";
18
     public static final String LOCAL_RESOURCE_URI_SCHEME = "res";
21
     private static ResourceDrawableIdHelper sResDrawableIdHelper = new ResourceDrawableIdHelper();
19
     private static ResourceDrawableIdHelper sResDrawableIdHelper = new ResourceDrawableIdHelper();
22
 
20
 

+ 0
- 6
example-redux/src/screens/FirstTabScreen.js View File

37
     ]
37
     ]
38
   };
38
   };
39
 
39
 
40
-  static propTypes = {
41
-    str: PropTypes.string.isRequired,
42
-    obj: PropTypes.object.isRequired,
43
-    num: PropTypes.number.isRequired
44
-  };
45
-
46
   constructor(props) {
40
   constructor(props) {
47
     super(props);
41
     super(props);
48
     // if you want to listen on navigator events, set this up
42
     // if you want to listen on navigator events, set this up

+ 0
- 6
example-redux/src/screens/SecondTabScreen.js View File

19
     navBarTranslucent: true
19
     navBarTranslucent: true
20
   };
20
   };
21
 
21
 
22
-  static propTypes = {
23
-    str: PropTypes.string.isRequired,
24
-    obj: PropTypes.object.isRequired,
25
-    num: PropTypes.number.isRequired
26
-  };
27
-
28
   constructor(props) {
22
   constructor(props) {
29
     super(props);
23
     super(props);
30
     this.buttonsCounter = 0;
24
     this.buttonsCounter = 0;