react-native-navigation 7.30.0-alpha → 7.30.0-alpha.1
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/lib/android/app/build.gradle +24 -3
- package/lib/android/app/src/main/AndroidManifest.xml +4 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java +12 -5
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/animations/BaseViewAnimator.kt +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/IconBackgroundDrawable.kt +9 -11
- package/lib/android/build.gradle +1 -0
- package/package.json +1 -1
|
@@ -12,9 +12,9 @@ def safeExtGetFallbackLowerBound(prop, fallback) {
|
|
|
12
12
|
Math.max(safeExtGet(prop,fallback),fallback)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
def DEFAULT_COMPILE_SDK_VERSION =
|
|
15
|
+
def DEFAULT_COMPILE_SDK_VERSION = 33
|
|
16
16
|
def DEFAULT_MIN_SDK_VERSION = 21
|
|
17
|
-
def DEFAULT_TARGET_SDK_VERSION =
|
|
17
|
+
def DEFAULT_TARGET_SDK_VERSION = 33
|
|
18
18
|
def DEFAULT_KOTLIN_VERSION = "1.5.31"
|
|
19
19
|
def DEFAULT_KOTLIN_STDLIB = 'kotlin-stdlib-jdk8'
|
|
20
20
|
def kotlinVersion = safeExtGet("RNNKotlinVersion", DEFAULT_KOTLIN_VERSION)
|
|
@@ -22,7 +22,7 @@ def kotlinStdlib = safeExtGet('RNNKotlinStdlib',DEFAULT_KOTLIN_STDLIB )
|
|
|
22
22
|
def kotlinCoroutinesCore = safeExtGet('RNNKotlinCoroutinesCore', '1.5.2')
|
|
23
23
|
android {
|
|
24
24
|
compileSdkVersion safeExtGetFallbackLowerBound('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
|
25
|
-
|
|
25
|
+
buildToolsVersion = "33.0.0"
|
|
26
26
|
defaultConfig {
|
|
27
27
|
minSdkVersion safeExtGetFallbackLowerBound('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
|
28
28
|
targetSdkVersion safeExtGetFallbackLowerBound('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
|
@@ -167,6 +167,27 @@ List reactNativeVersionComponents(rnPackageJsonFile) {
|
|
|
167
167
|
return reactNativeVersion.tokenize('-')[0].tokenize('.')
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
task installBuildToolsAndRenameD8IfNeeded {
|
|
171
|
+
def buildToolsVersion = android.getBuildToolsVersion()
|
|
172
|
+
def sdkDir = android.sdkDirectory
|
|
173
|
+
def buildToolsDir = new File(sdkDir, "/build-tools/" + buildToolsVersion)
|
|
174
|
+
|
|
175
|
+
if (!buildToolsDir.exists()) {
|
|
176
|
+
def command = sdkDir.absolutePath + "/cmdline-tools/latest/bin/sdkmanager build-tools;" + buildToolsVersion
|
|
177
|
+
command.execute().waitForProcessOutput(System.out, System.err)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
def d8File = new File(buildToolsDir, "d8")
|
|
181
|
+
def dxFile = new File(buildToolsDir, "dx")
|
|
182
|
+
d8File.renameTo(dxFile)
|
|
183
|
+
|
|
184
|
+
def buildToolsLibDir = new File(buildToolsDir, "lib")
|
|
185
|
+
d8File = new File(buildToolsLibDir, "d8.jar")
|
|
186
|
+
dxFile = new File(buildToolsLibDir, "dx.jar")
|
|
187
|
+
d8File.renameTo(dxFile)
|
|
188
|
+
}
|
|
189
|
+
build.dependsOn installBuildToolsAndRenameD8IfNeeded
|
|
190
|
+
|
|
170
191
|
dependencies {
|
|
171
192
|
|
|
172
193
|
implementation "androidx.core:core-ktx:1.6.0"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
|
|
2
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
3
|
+
package="com.reactnativenavigation">
|
|
3
4
|
|
|
4
|
-
<application
|
|
5
|
+
<application
|
|
6
|
+
android:enableOnBackInvokedCallback="true">
|
|
5
7
|
<activity
|
|
6
8
|
android:name="com.facebook.react.devsupport.DevSettingsActivity"
|
|
7
9
|
android:exported="false"/>
|
|
@@ -22,6 +22,7 @@ import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
|
22
22
|
import com.reactnativenavigation.viewcontrollers.modal.ModalStack;
|
|
23
23
|
import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
|
|
24
24
|
|
|
25
|
+
import androidx.activity.OnBackPressedCallback;
|
|
25
26
|
import androidx.annotation.NonNull;
|
|
26
27
|
import androidx.annotation.Nullable;
|
|
27
28
|
import androidx.appcompat.app.AppCompatActivity;
|
|
@@ -47,6 +48,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
|
|
47
48
|
);
|
|
48
49
|
navigator.bindViews();
|
|
49
50
|
getReactGateway().onActivityCreated(this);
|
|
51
|
+
setBackPressedCallback();
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
@Override
|
|
@@ -103,11 +105,6 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
|
|
103
105
|
getReactGateway().onActivityResult(this, requestCode, resultCode, data);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
@Override
|
|
107
|
-
public void onBackPressed() {
|
|
108
|
-
getReactGateway().onBackPressed();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
108
|
@Override
|
|
112
109
|
public boolean onKeyUp(final int keyCode, final KeyEvent event) {
|
|
113
110
|
return getReactGateway().onKeyUp(this, keyCode) || super.onKeyUp(keyCode, event);
|
|
@@ -152,4 +149,14 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
|
|
152
149
|
public void onCatalystInstanceDestroy() {
|
|
153
150
|
runOnUiThread(() -> navigator.destroyViews());
|
|
154
151
|
}
|
|
152
|
+
|
|
153
|
+
private void setBackPressedCallback() {
|
|
154
|
+
OnBackPressedCallback callback = new OnBackPressedCallback(true) {
|
|
155
|
+
@Override
|
|
156
|
+
public void handleOnBackPressed() {
|
|
157
|
+
getReactGateway().onBackPressed();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
getOnBackPressedDispatcher().addCallback(this, callback);
|
|
161
|
+
}
|
|
155
162
|
}
|
|
@@ -74,7 +74,7 @@ open class ButtonPresenter(private val context: Context, private val button: But
|
|
|
74
74
|
private fun applyAccessibilityLabel(menuItem: MenuItem) {
|
|
75
75
|
if (button.accessibilityLabel.hasValue()) {
|
|
76
76
|
if (button.component.hasValue()) {
|
|
77
|
-
menuItem.actionView
|
|
77
|
+
menuItem.actionView?.contentDescription = button.accessibilityLabel.get()
|
|
78
78
|
} else {
|
|
79
79
|
MenuItemCompat.setContentDescription(menuItem, button.accessibilityLabel.get())
|
|
80
80
|
}
|
package/lib/android/app/src/main/java/com/reactnativenavigation/views/animations/BaseViewAnimator.kt
CHANGED
|
@@ -43,17 +43,17 @@ open class BaseViewAnimator<T : View>(
|
|
|
43
43
|
private inner class AnimatorListener(private val startState: AnimationState, private val endVisibility: Int) : AnimatorListenerAdapter() {
|
|
44
44
|
var isCancelled = false
|
|
45
45
|
|
|
46
|
-
override fun onAnimationStart(animation: Animator
|
|
46
|
+
override fun onAnimationStart(animation: Animator) {
|
|
47
47
|
view.resetViewProperties()
|
|
48
48
|
view.visibility = View.VISIBLE
|
|
49
49
|
animationState = startState
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
override fun onAnimationCancel(animation: Animator
|
|
52
|
+
override fun onAnimationCancel(animation: Animator) {
|
|
53
53
|
isCancelled = true
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
override fun onAnimationEnd(animation: Animator
|
|
56
|
+
override fun onAnimationEnd(animation: Animator) {
|
|
57
57
|
if (!isCancelled) {
|
|
58
58
|
animationState = AnimationState.Idle
|
|
59
59
|
view.visibility = endVisibility
|
|
@@ -68,17 +68,15 @@ class IconBackgroundDrawable(
|
|
|
68
68
|
super.setBounds(r)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
override fun onBoundsChange(bounds: Rect
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
bounds.height() - (bounds.height() - bitmapHeight) / 2)
|
|
81
|
-
}
|
|
71
|
+
override fun onBoundsChange(bounds: Rect) {
|
|
72
|
+
backgroundRect = Rect((bounds.width() - backgroundWidth) / 2,
|
|
73
|
+
(bounds.height() - backgroundHeight) / 2,
|
|
74
|
+
bounds.width() - (bounds.width() - backgroundWidth) / 2,
|
|
75
|
+
bounds.height() - (bounds.height() - backgroundHeight) / 2)
|
|
76
|
+
bitmapRect = Rect((bounds.width() - bitmapWidth) / 2,
|
|
77
|
+
(bounds.height() - bitmapHeight) / 2,
|
|
78
|
+
bounds.width() - (bounds.width() - bitmapWidth) / 2,
|
|
79
|
+
bounds.height() - (bounds.height() - bitmapHeight) / 2)
|
|
82
80
|
super.onBoundsChange(bounds)
|
|
83
81
|
}
|
|
84
82
|
|
package/lib/android/build.gradle
CHANGED