Skip to content

Commit 5e77cf4

Browse files
refactor: remove deprecated APIs and clean up unused code
1 parent 860d7f0 commit 5e77cf4

9 files changed

Lines changed: 6 additions & 247 deletions

File tree

android/src/main/java/com/facebook/react/devsupport/MendixShakeDetector.kt

Lines changed: 0 additions & 46 deletions
This file was deleted.

android/src/main/java/com/mendix/mendixnative/api/RuntimeInfo.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
55
import com.mendix.mendixnative.config.AppUrl
66
import okhttp3.*
77
import okhttp3.MediaType.Companion.toMediaTypeOrNull
8+
import okhttp3.RequestBody.Companion.toRequestBody
89
import java.io.IOException
910
import java.util.concurrent.TimeUnit
1011

@@ -22,10 +23,7 @@ fun getRuntimeInfo(runtimeUrl: String, cb: (info: RuntimeInfoResponse) -> Unit)
2223
client.newCall(
2324
Request.Builder()
2425
.post(
25-
RequestBody.create(
26-
"application/json; charset=utf-8".toMediaTypeOrNull(),
27-
"{\"action\":\"info\"}"
28-
)
26+
"{\"action\":\"info\"}".toRequestBody("application/json; charset=utf-8".toMediaTypeOrNull())
2927
)
3028
.url(AppUrl.removeTrailingSlash(AppUrl.ensureProtocol(runtimeUrl)) + "/xas/")
3129
.build()

android/src/main/java/com/mendix/mendixnative/react/menu/AppMenu.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.

android/src/main/java/com/mendix/mendixnative/react/ota/OtaHelpers.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.mendix.mendixnative.react.ota
22

33
import android.content.Context
4-
import android.os.Build
54
import com.fasterxml.jackson.core.type.TypeReference
65
import com.fasterxml.jackson.databind.ObjectMapper
76
import com.mendix.mendixnative.util.ResourceReader
@@ -22,14 +21,7 @@ fun resolveAppVersion(context: Context): String {
2221
return context.packageManager.getPackageInfo(
2322
context.packageName,
2423
0
25-
).let { info ->
26-
info.versionName.let { versionName ->
27-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
28-
"$versionName-${info.longVersionCode}"
29-
else
30-
"$versionName-${info.versionCode}"
31-
}
32-
}
24+
).let { info -> "${info.versionName}-${info.longVersionCode}" }
3325
}
3426

3527
fun getNativeDependencies(context: Context): Map<String, String> {

android/src/main/java/com/mendix/mendixnative/util/MendixDoubleTapRecognizer.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.mendix.mendixnative.util
22

33
import android.os.Handler
4+
import android.os.Looper
45
import android.view.KeyEvent
56
import android.view.View
67
import android.widget.EditText
@@ -16,7 +17,7 @@ class MendixDoubleTapRecognizer {
1617
return true
1718
} else {
1819
mDoRefresh = true
19-
Handler()
20+
Handler(Looper.getMainLooper())
2021
.postDelayed(
2122
{ mDoRefresh = false },
2223
DOUBLE_TAP_DELAY)

android/src/main/java/com/mendix/mendixnative/util/ReflectionUtils.java

Lines changed: 0 additions & 132 deletions
This file was deleted.

ios/Modules/Extensions/RNCAsyncStorageExt.h

Lines changed: 0 additions & 4 deletions
This file was deleted.

ios/Modules/WarningFilter/WarningsFilter.swift

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,6 @@ import Foundation
1616
return "none"
1717
}
1818
}
19-
20-
/// Static array for Objective-C compatibility (equivalent to WarningsFilter_toString)
21-
static let toString: [String] = [
22-
"all",
23-
"partial",
24-
"none"
25-
]
26-
27-
/// Get string representation for a given index (Objective-C compatibility)
28-
static func string(for index: Int) -> String? {
29-
guard index >= 0 && index < toString.count else {
30-
return nil
31-
}
32-
return toString[index]
33-
}
34-
35-
/// Create WarningsFilter from string value
36-
static func from(string: String) -> WarningsFilter? {
37-
switch string.lowercased() {
38-
case "all":
39-
return .all
40-
case "partial":
41-
return .partial
42-
case "none":
43-
return WarningsFilter.none
44-
default:
45-
return nil
46-
}
47-
}
4819
}
4920

5021
// MARK: - CustomStringConvertible
@@ -53,19 +24,3 @@ extension WarningsFilter: CustomStringConvertible {
5324
return stringValue
5425
}
5526
}
56-
57-
// MARK: - Objective-C Bridge Functions
58-
@objc class WarningsFilterBridge: NSObject {
59-
/// Bridge function to get string representation (for Objective-C compatibility)
60-
@objc static func toString(for filter: WarningsFilter) -> String {
61-
return filter.stringValue
62-
}
63-
64-
/// Bridge function to get WarningsFilter from index (for Objective-C compatibility)
65-
@objc static func filter(for index: Int) -> WarningsFilter {
66-
guard let filter = WarningsFilter(rawValue: index) else {
67-
return .none // Default fallback
68-
}
69-
return filter
70-
}
71-
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "./lib/typescript/src/index.d.ts",
77
"exports": {
88
".": {
9-
"source": "./src/index.tsx",
9+
"source": "./src/index.ts",
1010
"types": "./lib/typescript/src/index.d.ts",
1111
"default": "./lib/module/index.js"
1212
},

0 commit comments

Comments
 (0)