@preeternal/react-native-godot 0.0.0-stage → 0.2.0

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.
Files changed (109) hide show
  1. package/LICENSE +22 -0
  2. package/Package.swift +106 -0
  3. package/README.md +590 -2
  4. package/android/build.gradle +291 -0
  5. package/android/consumer-rules.pro +20 -0
  6. package/android/fix-prefab.gradle +54 -0
  7. package/android/src/main/AndroidManifest.xml +2 -0
  8. package/android/src/main/cpp/CMakeLists.txt +78 -0
  9. package/android/src/main/cpp/GodotModule.cpp +764 -0
  10. package/android/src/main/cpp/OnLoad.cpp +66 -0
  11. package/android/src/main/cpp/libgodot_android.h +73 -0
  12. package/android/src/main/cpp/libgodot_jni.cpp +658 -0
  13. package/android/src/main/cpp/libgodot_jni.h +116 -0
  14. package/android/src/main/cpp/native_godot_module_jni.cpp +86 -0
  15. package/android/src/main/cpp/native_godot_module_jni.h +58 -0
  16. package/android/src/main/java/com/preeternal/reactnativegodot/NativeGodotModuleModule.kt +83 -0
  17. package/android/src/main/java/com/preeternal/reactnativegodot/NativeGodotModulePackage.kt +41 -0
  18. package/android/src/main/java/com/preeternal/reactnativegodot/NativeLibraryLoader.kt +5 -0
  19. package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotIO.kt +123 -0
  20. package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotView.kt +92 -0
  21. package/android/src/main/java/com/preeternal/reactnativegodot/RTNGodotViewManager.kt +34 -0
  22. package/android/src/main/java/com/preeternal/reactnativegodot/RTNLibGodot.kt +215 -0
  23. package/android/src/main/res/layout/downloading_expansion.xml +165 -0
  24. package/android/src/main/res/layout/godot_app_layout.xml +5 -0
  25. package/android/src/main/res/layout/snackbar.xml +27 -0
  26. package/android/src/main/res/layout/status_bar_ongoing_event_progress_bar.xml +108 -0
  27. package/android/src/main/res/mipmap/icon.png +0 -0
  28. package/android/src/main/res/mipmap/icon_background.png +0 -0
  29. package/android/src/main/res/mipmap/icon_foreground.png +0 -0
  30. package/android/src/main/res/mipmap/icon_monochrome.png +0 -0
  31. package/android/src/main/res/mipmap-anydpi-v26/icon.xml +8 -0
  32. package/android/src/main/res/mipmap-anydpi-v26/themed_icon.xml +11 -0
  33. package/android/src/main/res/mipmap-hdpi/icon.png +0 -0
  34. package/android/src/main/res/mipmap-hdpi/icon_background.png +0 -0
  35. package/android/src/main/res/mipmap-hdpi/icon_foreground.png +0 -0
  36. package/android/src/main/res/mipmap-hdpi/icon_monochrome.png +0 -0
  37. package/android/src/main/res/mipmap-mdpi/icon.png +0 -0
  38. package/android/src/main/res/mipmap-mdpi/icon_background.png +0 -0
  39. package/android/src/main/res/mipmap-mdpi/icon_foreground.png +0 -0
  40. package/android/src/main/res/mipmap-mdpi/icon_monochrome.png +0 -0
  41. package/android/src/main/res/mipmap-xhdpi/icon.png +0 -0
  42. package/android/src/main/res/mipmap-xhdpi/icon_background.png +0 -0
  43. package/android/src/main/res/mipmap-xhdpi/icon_foreground.png +0 -0
  44. package/android/src/main/res/mipmap-xhdpi/icon_monochrome.png +0 -0
  45. package/android/src/main/res/mipmap-xxhdpi/icon.png +0 -0
  46. package/android/src/main/res/mipmap-xxhdpi/icon_background.png +0 -0
  47. package/android/src/main/res/mipmap-xxhdpi/icon_foreground.png +0 -0
  48. package/android/src/main/res/mipmap-xxhdpi/icon_monochrome.png +0 -0
  49. package/android/src/main/res/mipmap-xxxhdpi/icon.png +0 -0
  50. package/android/src/main/res/mipmap-xxxhdpi/icon_background.png +0 -0
  51. package/android/src/main/res/mipmap-xxxhdpi/icon_foreground.png +0 -0
  52. package/android/src/main/res/mipmap-xxxhdpi/icon_monochrome.png +0 -0
  53. package/android/src/main/res/values/dimens.xml +9 -0
  54. package/android/src/main/res/values/strings.xml +61 -0
  55. package/android/src/main/res/values/styles.xml +25 -0
  56. package/android/src/main/res/values-fa/strings.xml +14 -0
  57. package/android/src/main/res/values-ko/strings.xml +54 -0
  58. package/android/src/main/res/xml/godot_provider_paths.xml +15 -0
  59. package/android/src/test/java/com/preeternal/reactnativegodot/NativeGodotModulePackageTest.kt +26 -0
  60. package/app.plugin.js +169 -0
  61. package/cpp/AppleRendererPolicy.h +95 -0
  62. package/cpp/GodotModule.h +126 -0
  63. package/cpp/LibGodotABI.h +52 -0
  64. package/cpp/NativeGodotModule.cpp +825 -0
  65. package/cpp/NativeGodotModule.h +45 -0
  66. package/cpp/godot-log.h +64 -0
  67. package/ios/GodotModule.mm +695 -0
  68. package/ios/NativeGodotModuleProvider.h +35 -0
  69. package/ios/NativeGodotModuleProvider.mm +42 -0
  70. package/ios/RTNGodotView.h +42 -0
  71. package/ios/RTNGodotView.mm +671 -0
  72. package/ios/log.mm +38 -0
  73. package/lib/module/NativeNativeGodotModule.js +59 -0
  74. package/lib/module/NativeNativeGodotModule.js.map +1 -0
  75. package/lib/module/RTNGodotView.js +6 -0
  76. package/lib/module/RTNGodotView.js.map +1 -0
  77. package/lib/module/RTNGodotView.native.js +5 -0
  78. package/lib/module/RTNGodotView.native.js.map +1 -0
  79. package/lib/module/RTNGodotViewNativeComponent.ts +37 -0
  80. package/lib/module/index.js +30 -0
  81. package/lib/module/index.js.map +1 -0
  82. package/lib/module/package.json +1 -0
  83. package/lib/typescript/package.json +1 -0
  84. package/lib/typescript/src/NativeNativeGodotModule.d.ts +26 -0
  85. package/lib/typescript/src/NativeNativeGodotModule.d.ts.map +1 -0
  86. package/lib/typescript/src/RTNGodotView.d.ts +7 -0
  87. package/lib/typescript/src/RTNGodotView.d.ts.map +1 -0
  88. package/lib/typescript/src/RTNGodotView.native.d.ts +3 -0
  89. package/lib/typescript/src/RTNGodotView.native.d.ts.map +1 -0
  90. package/lib/typescript/src/RTNGodotViewNativeComponent.d.ts +11 -0
  91. package/lib/typescript/src/RTNGodotViewNativeComponent.d.ts.map +1 -0
  92. package/lib/typescript/src/index.d.ts +6 -0
  93. package/lib/typescript/src/index.d.ts.map +1 -0
  94. package/package.json +282 -4
  95. package/prebuilt-utils.rb +46 -0
  96. package/react-native-godot.podspec +41 -0
  97. package/react-native.config.js +16 -0
  98. package/scripts/check-16kb.sh +136 -0
  99. package/scripts/check-packaged-artifacts.sh +156 -0
  100. package/scripts/ci/verify-ios-simulator.py +48 -0
  101. package/scripts/ci/verify-prebuilt-install.cjs +41 -0
  102. package/scripts/download-prebuilt.js +283 -0
  103. package/scripts/prebuilt-config.js +80 -0
  104. package/scripts/spm-autolinking-plugin.js +87 -0
  105. package/src/NativeNativeGodotModule.ts +90 -0
  106. package/src/RTNGodotView.native.tsx +2 -0
  107. package/src/RTNGodotView.tsx +12 -0
  108. package/src/RTNGodotViewNativeComponent.ts +37 -0
  109. package/src/index.tsx +28 -0
@@ -0,0 +1,215 @@
1
+ package com.preeternal.reactnativegodot
2
+
3
+ import android.app.Activity
4
+ import android.content.res.AssetManager
5
+ import android.graphics.PixelFormat
6
+ import android.util.DisplayMetrics
7
+ import android.util.Log
8
+ import android.view.Surface
9
+ import android.view.SurfaceControl
10
+ import android.view.SurfaceHolder
11
+ import org.godotengine.godot.io.directory.DirectoryAccessHandler
12
+ import org.godotengine.godot.io.file.FileAccessHandler
13
+ import org.godotengine.godot.plugin.GodotPlugin
14
+ import org.godotengine.godot.utils.GodotNetUtils
15
+
16
+ class RTNLibGodot private constructor() {
17
+ private class WindowSurfaceData(
18
+ val control: SurfaceControl,
19
+ width: Int,
20
+ height: Int,
21
+ val persistent: Boolean,
22
+ ) {
23
+ var attachedControl: SurfaceControl? = null
24
+ var attachedSurface: Surface? = null
25
+ val surface: Surface = Surface(control)
26
+ var width: Int = width
27
+ var height: Int = height
28
+ }
29
+
30
+ fun updateWindow(
31
+ name: String,
32
+ control: SurfaceControl,
33
+ holder: SurfaceHolder,
34
+ format: Int,
35
+ width: Int,
36
+ height: Int,
37
+ ) {
38
+ if (name.isNotEmpty()) {
39
+ updateWindowNative(name, holder.surface, width, height)
40
+ return
41
+ }
42
+
43
+ val window = getOrCreateWindowSurface(name, width, height)
44
+ val holderSurface = holder.surface
45
+ val surfaceChanged = window.attachedControl != control || window.attachedSurface != holderSurface
46
+
47
+ if (surfaceChanged) {
48
+ window.attachedControl = null
49
+ window.attachedSurface = null
50
+ Log.i(TAG, "Attaching and resizing surface to: $width $height")
51
+ SurfaceControl.Transaction().use { transaction ->
52
+ transaction.reparent(window.control, control)
53
+ transaction.setLayer(window.control, 1)
54
+ transaction.setVisibility(window.control, true)
55
+ if (window.width != width || window.height != height) {
56
+ transaction.setBufferSize(window.control, width, height)
57
+ window.width = width
58
+ window.height = height
59
+ }
60
+ transaction.apply()
61
+ }
62
+ window.attachedControl = control
63
+ window.attachedSurface = holderSurface
64
+ } else if (window.width != width || window.height != height) {
65
+ Log.i(TAG, "Resizing surface to: $width $height")
66
+ SurfaceControl.Transaction().use { transaction ->
67
+ transaction.setBufferSize(window.control, width, height)
68
+ window.width = width
69
+ window.height = height
70
+ transaction.apply()
71
+ }
72
+ }
73
+
74
+ updateWindowNative(name, window.surface, width, height)
75
+ }
76
+
77
+ fun removeWindow(name: String) {
78
+ val window = windowData[name]
79
+ if (window == null) {
80
+ removeWindowNative(name)
81
+ return
82
+ }
83
+
84
+ SurfaceControl.Transaction().use { transaction ->
85
+ transaction.reparent(window.control, null)
86
+ transaction.setVisibility(window.control, false)
87
+ transaction.apply()
88
+ }
89
+ window.attachedControl = null
90
+ window.attachedSurface = null
91
+ removeWindowNative(name)
92
+ if (!window.persistent) windowData.remove(name)
93
+ }
94
+
95
+ @Synchronized
96
+ fun init(newActivity: Activity?) {
97
+ hostActivity = newActivity ?: hostActivity
98
+ if (inited) return
99
+ val currentActivity = hostActivity
100
+ if (currentActivity == null) {
101
+ Log.e(TAG, "Activity not set, abort init")
102
+ return
103
+ }
104
+
105
+ val metrics = DisplayMetrics()
106
+ @Suppress("DEPRECATION")
107
+ currentActivity.windowManager.defaultDisplay.getMetrics(metrics)
108
+ getOrCreateWindowSurface("", metrics.widthPixels, metrics.heightPixels)
109
+
110
+ // Embedded creation owns the engine. Do not call Godot.initEngine(), which
111
+ // initializes a second engine through the standalone Android JNI API.
112
+ val context = currentActivity.applicationContext
113
+ initialize(
114
+ context.assets,
115
+ GodotNetUtils(context),
116
+ DirectoryAccessHandler(context),
117
+ FileAccessHandler(context),
118
+ RTNGodotIO(context) { hostActivity },
119
+ checkNotNull(windowData[""]).surface,
120
+ metrics.widthPixels,
121
+ metrics.heightPixels,
122
+ )
123
+ inited = true
124
+ }
125
+
126
+ fun shutdown() {
127
+ if (inited) {
128
+ cleanup()
129
+ inited = false
130
+ }
131
+ }
132
+
133
+ @Deprecated("Standalone Godot Android plugins are not supported by the embedded engine")
134
+ fun addHostPlugin(plugin: GodotPlugin) {
135
+ throw UnsupportedOperationException("Cannot register standalone Android plugin: ${plugin.javaClass.name}")
136
+ }
137
+
138
+ private external fun updateWindowNative(name: String, surface: Surface, width: Int, height: Int)
139
+ private external fun removeWindowNative(name: String)
140
+
141
+ private external fun cleanup()
142
+
143
+ external fun dispatchTouchEvent(
144
+ windowName: String,
145
+ event: Int,
146
+ pointer: Int,
147
+ pointerCount: Int,
148
+ positions: FloatArray,
149
+ doubleTap: Boolean,
150
+ )
151
+
152
+ external fun dispatchMouseEvent(
153
+ windowName: String,
154
+ event: Int,
155
+ buttonMask: Int,
156
+ x: Float,
157
+ y: Float,
158
+ deltaX: Float,
159
+ deltaY: Float,
160
+ doubleClick: Boolean,
161
+ sourceMouseRelative: Boolean,
162
+ pressure: Float,
163
+ tiltX: Float,
164
+ tiltY: Float,
165
+ )
166
+
167
+ companion object {
168
+ private const val TAG = "LibGodot"
169
+ private var inited = false
170
+ @Volatile private var hostActivity: Activity? = null
171
+
172
+ private val INSTANCE = RTNLibGodot()
173
+ private val windowData = HashMap<String, WindowSurfaceData>()
174
+
175
+ @JvmStatic
176
+ fun getInstance(): RTNLibGodot = INSTANCE
177
+
178
+ private fun createWindowSurface(name: String, width: Int, height: Int) {
179
+ val control = SurfaceControl.Builder()
180
+ .setBufferSize(width, height)
181
+ .setFormat(PixelFormat.RGBA_8888)
182
+ .setName(name)
183
+ .build()
184
+ windowData[name] = WindowSurfaceData(control, width, height, name.isEmpty())
185
+ }
186
+
187
+ private fun getOrCreateWindowSurface(name: String, width: Int, height: Int): WindowSurfaceData =
188
+ windowData[name] ?: run {
189
+ createWindowSurface(name, width, height)
190
+ checkNotNull(windowData[name])
191
+ }
192
+
193
+ @JvmStatic
194
+ private external fun initialize(
195
+ assetManager: AssetManager,
196
+ netUtils: GodotNetUtils,
197
+ directoryAccessHandler: DirectoryAccessHandler,
198
+ fileAccessHandler: FileAccessHandler,
199
+ io: RTNGodotIO,
200
+ mainSurface: Surface,
201
+ width: Int,
202
+ height: Int,
203
+ )
204
+
205
+ @JvmStatic
206
+ private external fun registerWindowUpdateCallbackNative(
207
+ name: String,
208
+ handle: Any,
209
+ runnable: Runnable,
210
+ )
211
+
212
+ @JvmStatic
213
+ private external fun unregisterWindowUpdateCallbackNative(handle: Any)
214
+ }
215
+ }
@@ -0,0 +1,165 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:layout_width="match_parent"
4
+ android:layout_height="match_parent"
5
+ android:orientation="vertical" >
6
+
7
+ <LinearLayout
8
+ android:layout_width="match_parent"
9
+ android:layout_height="wrap_content"
10
+ android:layout_weight="0"
11
+ android:orientation="vertical" >
12
+
13
+ <TextView
14
+ android:id="@+id/statusText"
15
+ android:layout_width="match_parent"
16
+ android:layout_height="wrap_content"
17
+ android:layout_marginBottom="10dp"
18
+ android:layout_marginStart="5dp"
19
+ android:layout_marginTop="10dp"
20
+ android:textStyle="bold" />
21
+
22
+ <LinearLayout
23
+ android:id="@+id/downloaderDashboard"
24
+ android:layout_width="fill_parent"
25
+ android:layout_height="wrap_content"
26
+ android:orientation="vertical" >
27
+
28
+ <RelativeLayout
29
+ android:layout_width="match_parent"
30
+ android:layout_height="0dp"
31
+ android:layout_weight="1" >
32
+
33
+ <TextView
34
+ android:id="@+id/progressAsFraction"
35
+ style="@android:style/TextAppearance.Small"
36
+ android:layout_width="wrap_content"
37
+ android:layout_height="wrap_content"
38
+ android:layout_alignParentStart="true"
39
+ android:layout_marginStart="5dp" />
40
+
41
+ <TextView
42
+ android:id="@+id/progressAsPercentage"
43
+ style="@android:style/TextAppearance.Small"
44
+ android:layout_width="wrap_content"
45
+ android:layout_height="wrap_content"
46
+ android:layout_alignEnd="@+id/progressBar" />
47
+
48
+ <ProgressBar
49
+ android:id="@+id/progressBar"
50
+ style="?android:attr/progressBarStyleHorizontal"
51
+ android:layout_width="match_parent"
52
+ android:layout_height="wrap_content"
53
+ android:layout_below="@+id/progressAsFraction"
54
+ android:layout_marginBottom="10dp"
55
+ android:layout_marginLeft="10dp"
56
+ android:layout_marginRight="10dp"
57
+ android:layout_marginTop="10dp" />
58
+
59
+ <TextView
60
+ android:id="@+id/progressAverageSpeed"
61
+ style="@android:style/TextAppearance.Small"
62
+ android:layout_width="wrap_content"
63
+ android:layout_height="wrap_content"
64
+ android:layout_alignParentStart="true"
65
+ android:layout_below="@+id/progressBar"
66
+ android:layout_marginStart="5dp" />
67
+
68
+ <TextView
69
+ android:id="@+id/progressTimeRemaining"
70
+ style="@android:style/TextAppearance.Small"
71
+ android:layout_width="wrap_content"
72
+ android:layout_height="wrap_content"
73
+ android:layout_alignEnd="@+id/progressBar"
74
+ android:layout_below="@+id/progressBar" />
75
+ </RelativeLayout>
76
+
77
+ <LinearLayout
78
+ android:id="@+id/downloadButton"
79
+ android:layout_width="fill_parent"
80
+ android:layout_height="wrap_content"
81
+ android:orientation="horizontal" >
82
+
83
+ <Button
84
+ android:id="@+id/cancelButton"
85
+ android:layout_width="wrap_content"
86
+ android:layout_height="wrap_content"
87
+ android:layout_gravity="center_vertical"
88
+ android:layout_marginBottom="10dp"
89
+ android:layout_marginLeft="5dp"
90
+ android:layout_marginRight="5dp"
91
+ android:layout_marginTop="10dp"
92
+ android:layout_weight="0"
93
+ android:minHeight="40dp"
94
+ android:minWidth="94dp"
95
+ android:text="@string/text_button_cancel"
96
+ android:visibility="gone"
97
+ style="?android:attr/buttonBarButtonStyle" />
98
+
99
+ <Button
100
+ android:id="@+id/pauseButton"
101
+ android:layout_width="wrap_content"
102
+ android:layout_height="wrap_content"
103
+ android:layout_gravity="center_vertical"
104
+ android:layout_marginBottom="10dp"
105
+ android:layout_marginStart="10dp"
106
+ android:layout_marginEnd="5dp"
107
+ android:layout_marginTop="10dp"
108
+ android:layout_weight="0"
109
+ android:minHeight="40dp"
110
+ android:minWidth="94dp"
111
+ android:text="@string/text_button_pause"
112
+ style="?android:attr/buttonBarButtonStyle" />
113
+ </LinearLayout>
114
+ </LinearLayout>
115
+ </LinearLayout>
116
+
117
+ <LinearLayout
118
+ android:id="@+id/approveCellular"
119
+ android:layout_width="match_parent"
120
+ android:layout_height="match_parent"
121
+ android:layout_weight="1"
122
+ android:orientation="vertical"
123
+ android:visibility="gone" >
124
+
125
+ <TextView
126
+ android:layout_width="match_parent"
127
+ android:layout_height="wrap_content"
128
+ android:layout_margin="10dp"
129
+ android:id="@+id/textPausedParagraph1"
130
+ android:text="@string/text_paused_cellular" />
131
+
132
+ <TextView
133
+ android:layout_width="match_parent"
134
+ android:layout_height="wrap_content"
135
+ android:layout_margin="10dp"
136
+ android:id="@+id/textPausedParagraph2"
137
+ android:text="@string/text_paused_cellular_2" />
138
+
139
+ <LinearLayout
140
+ android:id="@+id/buttonRow"
141
+ android:layout_width="match_parent"
142
+ android:layout_height="wrap_content"
143
+ android:orientation="horizontal" >
144
+
145
+ <Button
146
+ android:id="@+id/resumeOverCellular"
147
+ android:layout_width="wrap_content"
148
+ android:layout_height="wrap_content"
149
+ android:layout_gravity="center"
150
+ android:layout_margin="10dp"
151
+ android:text="@string/text_button_resume_cellular"
152
+ style="?android:attr/buttonBarButtonStyle" />
153
+
154
+ <Button
155
+ android:id="@+id/wifiSettingsButton"
156
+ android:layout_width="wrap_content"
157
+ android:layout_height="wrap_content"
158
+ android:layout_gravity="center"
159
+ android:layout_margin="10dp"
160
+ android:text="@string/text_button_wifi_settings"
161
+ style="?android:attr/buttonBarButtonStyle" />
162
+ </LinearLayout>
163
+ </LinearLayout>
164
+
165
+ </LinearLayout>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:id="@+id/godot_fragment_container"
4
+ android:layout_width="match_parent"
5
+ android:layout_height="match_parent" />
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:layout_width="match_parent"
4
+ android:layout_height="wrap_content"
5
+ android:background="@android:drawable/dialog_holo_dark_frame"
6
+ android:gravity="center_vertical"
7
+ android:orientation="horizontal">
8
+
9
+ <TextView
10
+ android:id="@+id/snackbar_text"
11
+ android:layout_width="0dp"
12
+ android:layout_height="wrap_content"
13
+ android:layout_weight="1"
14
+ android:text=""
15
+ android:textColor="@android:color/white"
16
+ android:textSize="14sp"
17
+ android:padding="8dp"/>
18
+
19
+ <Button
20
+ android:id="@+id/snackbar_action"
21
+ android:layout_width="wrap_content"
22
+ android:layout_height="wrap_content"
23
+ android:background="#00FFFFFF"
24
+ android:text="Action"
25
+ android:textColor="#61B7FC"
26
+ android:paddingHorizontal="8dp"/>
27
+ </LinearLayout>
@@ -0,0 +1,108 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ /*
4
+ ** Copyright 2008, The Android Open Source Project
5
+ **
6
+ ** Licensed under the Apache License, Version 2.0 (the "License");
7
+ ** you may not use this file except in compliance with the License.
8
+ ** You may obtain a copy of the License at
9
+ **
10
+ ** http://www.apache.org/licenses/LICENSE-2.0
11
+ **
12
+ ** Unless required by applicable law or agreed to in writing, software
13
+ ** distributed under the License is distributed on an "AS IS" BASIS,
14
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ ** See the License for the specific language governing permissions and
16
+ ** limitations under the License.
17
+ */
18
+ -->
19
+
20
+ <LinearLayout xmlns:tools="http://schemas.android.com/tools"
21
+ android:layout_width="match_parent"
22
+ android:layout_height="match_parent"
23
+ android:baselineAligned="false"
24
+ android:orientation="horizontal" android:id="@+id/notificationLayout" xmlns:android="http://schemas.android.com/apk/res/android">
25
+
26
+ <RelativeLayout
27
+ android:layout_width="35dp"
28
+ android:layout_height="fill_parent"
29
+ android:paddingTop="10dp"
30
+ android:paddingBottom="8dp" >
31
+
32
+ <ImageView
33
+ android:id="@+id/appIcon"
34
+ android:layout_width="fill_parent"
35
+ android:layout_height="25dp"
36
+ android:scaleType="centerInside"
37
+ android:layout_alignParentStart="true"
38
+ android:layout_alignParentTop="true"
39
+ android:src="@android:drawable/stat_sys_download"
40
+ android:contentDescription="@string/godot_project_name_string" />
41
+
42
+ <TextView
43
+ android:id="@+id/progress_text"
44
+ style="@style/NotificationText"
45
+ android:layout_width="fill_parent"
46
+ android:layout_height="wrap_content"
47
+ android:layout_alignParentStart="true"
48
+ android:layout_alignParentBottom="true"
49
+ android:layout_gravity="center_horizontal"
50
+ android:singleLine="true"
51
+ android:gravity="center" />
52
+ </RelativeLayout>
53
+
54
+ <RelativeLayout
55
+ android:layout_width="0dip"
56
+ android:layout_height="match_parent"
57
+ android:layout_weight="1.0"
58
+ android:clickable="true"
59
+ android:focusable="true"
60
+ android:paddingTop="10dp"
61
+ android:paddingEnd="8dp"
62
+ android:paddingBottom="8dp"
63
+ tools:ignore="RtlSymmetry">
64
+
65
+ <TextView
66
+ android:id="@+id/title"
67
+ style="@style/NotificationTitle"
68
+ android:layout_width="wrap_content"
69
+ android:layout_height="wrap_content"
70
+ android:layout_alignParentStart="true"
71
+ android:singleLine="true"/>
72
+
73
+ <TextView
74
+ android:id="@+id/time_remaining"
75
+ style="@style/NotificationText"
76
+ android:layout_width="wrap_content"
77
+ android:layout_height="wrap_content"
78
+ android:layout_alignParentEnd="true"
79
+ android:singleLine="true"
80
+ tools:ignore="RelativeOverlap" />
81
+ <!-- Only one of progress_bar and paused_text will be visible. -->
82
+
83
+ <FrameLayout
84
+ android:id="@+id/progress_bar_frame"
85
+ android:layout_width="fill_parent"
86
+ android:layout_height="wrap_content"
87
+ android:layout_alignParentBottom="true" >
88
+
89
+ <ProgressBar
90
+ android:id="@+id/progress_bar"
91
+ style="?android:attr/progressBarStyleHorizontal"
92
+ android:layout_width="fill_parent"
93
+ android:layout_height="wrap_content"
94
+ android:paddingEnd="25dp" />
95
+
96
+ <TextView
97
+ android:id="@+id/description"
98
+ style="@style/NotificationTextShadow"
99
+ android:layout_width="wrap_content"
100
+ android:layout_height="wrap_content"
101
+ android:layout_gravity="center"
102
+ android:paddingEnd="25dp"
103
+ android:singleLine="true" />
104
+ </FrameLayout>
105
+
106
+ </RelativeLayout>
107
+
108
+ </LinearLayout>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ WARNING: The content of this file must always match the constant 'platform/android/export/export_plugin.cpp#ICON_XML_TEMPLATE'.
4
+ -->
5
+ <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
6
+ <background android:drawable="@mipmap/icon_background"/>
7
+ <foreground android:drawable="@mipmap/icon_foreground"/>
8
+ </adaptive-icon>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ This file is created to work alongside the icon.xml file.
4
+ If the user provides a Monochrome icon in the export settings, its data will be used to overwrite the icon.xml file.
5
+ We needed to create this file to get a reference for icon_monochrome.
6
+ -->
7
+ <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
8
+ <background android:drawable="@mipmap/icon_background"/>
9
+ <foreground android:drawable="@mipmap/icon_foreground"/>
10
+ <monochrome android:drawable="@mipmap/icon_monochrome"/>
11
+ </adaptive-icon>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <dimen name="text_edit_height">48dp</dimen>
4
+ <dimen name="button_height">48dp</dimen>
5
+ <dimen name="button_padding">10dp</dimen>
6
+ <dimen name="dialog_padding_horizontal">16dp</dimen>
7
+ <dimen name="dialog_padding_vertical">8dp</dimen>
8
+ <dimen name="snackbar_bottom_margin">10dp</dimen>
9
+ </resources>