|
@@ -4,13 +4,14 @@ import android.annotation.SuppressLint;
|
4
|
4
|
import android.content.Context;
|
5
|
5
|
import android.support.annotation.ColorInt;
|
6
|
6
|
import android.support.annotation.IntRange;
|
7
|
|
-import android.view.View;
|
8
|
7
|
|
9
|
8
|
import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
|
10
|
9
|
import com.reactnativenavigation.BuildConfig;
|
11
|
10
|
import com.reactnativenavigation.parse.params.Text;
|
12
|
11
|
import com.reactnativenavigation.utils.CompatUtils;
|
13
|
12
|
|
|
13
|
+import static com.reactnativenavigation.utils.ObjectUtils.perform;
|
|
14
|
+
|
14
|
15
|
@SuppressLint("ViewConstructor")
|
15
|
16
|
public class BottomTabs extends AHBottomNavigation {
|
16
|
17
|
public BottomTabs(Context context) {
|
|
@@ -20,10 +21,11 @@ public class BottomTabs extends AHBottomNavigation {
|
20
|
21
|
}
|
21
|
22
|
|
22
|
23
|
public void setTabTestId(int index, Text testId) {
|
23
|
|
- if (!testId.hasValue()) return;
|
24
|
|
- View view = getViewAtPosition(index);
|
25
|
|
- view.setTag(testId.get());
|
26
|
|
- if (BuildConfig.DEBUG) view.setContentDescription(testId.get());
|
|
24
|
+ if (!testId.hasValue() ) return;
|
|
25
|
+ perform(getViewAtPosition(index), view -> {
|
|
26
|
+ view.setTag(testId.get());
|
|
27
|
+ if (BuildConfig.DEBUG) view.setContentDescription(testId.get());
|
|
28
|
+ });
|
27
|
29
|
}
|
28
|
30
|
|
29
|
31
|
public void setBadge(int bottomTabIndex, String badge) {
|