react-native-navigation 8.8.10 → 8.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/src/main/java/com/reactnativenavigation/customrow/BottomTabsCustomRowAttacher.kt
CHANGED
|
@@ -9,6 +9,7 @@ import android.view.ViewGroup
|
|
|
9
9
|
import android.view.ViewTreeObserver
|
|
10
10
|
import android.view.WindowInsets
|
|
11
11
|
import android.widget.FrameLayout
|
|
12
|
+
import com.reactnativenavigation.NavigationActivity
|
|
12
13
|
import com.reactnativenavigation.views.bottomtabs.BottomTabs
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -77,6 +78,13 @@ internal object BottomTabsCustomRowAttacher : Application.ActivityLifecycleCallb
|
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
private fun ensureLayoutObserver(activity: Activity) {
|
|
81
|
+
// BottomTabs only ever live inside RNN's own NavigationActivity (an
|
|
82
|
+
// AppCompatActivity). Touching any other activity — e.g. a third-party
|
|
83
|
+
// relay such as AppAuth's RedirectUriReceiverActivity, whose theme is not
|
|
84
|
+
// a Theme.AppCompat descendant — forces AppCompat sub-decor inflation and
|
|
85
|
+
// crashes with "You need to use a Theme.AppCompat theme". Guard here so the
|
|
86
|
+
// global lifecycle observer never operates on foreign activities.
|
|
87
|
+
if (activity !is NavigationActivity) return
|
|
80
88
|
val decor = activity.window?.decorView as? ViewGroup ?: return
|
|
81
89
|
if (decor.getTag(TAG_OBSERVING) == true) return
|
|
82
90
|
decor.setTag(TAG_OBSERVING, true)
|
|
@@ -90,10 +98,11 @@ internal object BottomTabsCustomRowAttacher : Application.ActivityLifecycleCallb
|
|
|
90
98
|
}
|
|
91
99
|
|
|
92
100
|
private fun tryAttach(activity: Activity) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
if (activity !is NavigationActivity) return
|
|
102
|
+
val scanRoot = activity.window?.decorView as? ViewGroup ?: return
|
|
103
|
+
// Resolve through the view tree: AppCompatActivity.findViewById() forces
|
|
104
|
+
// createSubDecor(), which throws unless the activity's theme is Theme.AppCompat.
|
|
105
|
+
val overlayHost = scanRoot.findViewById<View>(android.R.id.content) as? ViewGroup
|
|
97
106
|
?: scanRoot
|
|
98
107
|
|
|
99
108
|
forEachBottomTabs(scanRoot) { bottomTabs ->
|