Explorar el Código

Remove tabs specific methods from base activity

Guy Carmeli hace 8 años
padre
commit
1b49216a17

+ 0
- 12
android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java Ver fichero

@@ -371,18 +371,6 @@ public abstract class BaseReactActivity extends AppCompatActivity implements Def
371 371
         mToolbar.setTitle(title.getString(KEY_TITLE));
372 372
     }
373 373
 
374
-    public void setTabBadge(ReadableMap params) {
375
-        return;
376
-    }
377
-
378
-    public void switchToTab(ReadableMap params) {
379
-        return;
380
-    }
381
-
382
-    public void toggleTabs(ReadableMap params) {
383
-        return;
384
-    }
385
-
386 374
     public void toggleNavigationBar(ReadableMap params) {
387 375
         if (mToolbar == null) {
388 376
             return;

+ 0
- 3
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java Ver fichero

@@ -190,7 +190,6 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
190 190
         }
191 191
     }
192 192
 
193
-    @Override
194 193
     public void setTabBadge(ReadableMap params) {
195 194
         // Badge comes across as int, but if it's 0 clear the notification
196 195
         int badgeCount = params.getInt(KEY_BADGE);
@@ -205,13 +204,11 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
205 204
         mBottomNavigation.setNotification(badge, tabIndex);
206 205
     }
207 206
 
208
-    @Override
209 207
     public void switchToTab(ReadableMap params) {
210 208
         int tabIndex = params.getInt(KEY_TAB_INDEX);
211 209
         mBottomNavigation.setCurrentItem(tabIndex);
212 210
     }
213 211
 
214
-    @Override
215 212
     public void toggleTabs(ReadableMap params) {
216 213
         boolean hide = params.getBoolean(KEY_HIDDEN);
217 214
         boolean animated = params.getBoolean(KEY_ANIMATED);

+ 3
- 3
android/app/src/main/java/com/reactnativenavigation/modules/RctActivityModule.java Ver fichero

@@ -129,7 +129,7 @@ public class RctActivityModule extends ReactContextBaseJavaModule {
129 129
         context.runOnUiThread(new Runnable() {
130 130
             @Override
131 131
             public void run() {
132
-                context.setTabBadge(params);
132
+                ((BottomTabActivity) context).setTabBadge(params);
133 133
             }
134 134
         });
135 135
     }
@@ -143,7 +143,7 @@ public class RctActivityModule extends ReactContextBaseJavaModule {
143 143
         context.runOnUiThread(new Runnable() {
144 144
             @Override
145 145
             public void run() {
146
-                context.switchToTab(params);
146
+                ((BottomTabActivity) context).switchToTab(params);
147 147
             }
148 148
         });
149 149
     }
@@ -171,7 +171,7 @@ public class RctActivityModule extends ReactContextBaseJavaModule {
171 171
         context.runOnUiThread(new Runnable() {
172 172
             @Override
173 173
             public void run() {
174
-                context.toggleTabs(params);
174
+                ((BottomTabActivity) context).toggleTabs(params);
175 175
             }
176 176
         });
177 177
     }