-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:ooni/probe-multiplatform into feat/…
…flavor-support
- Loading branch information
Showing
18 changed files
with
123 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 22 additions & 4 deletions
26
composeApp/src/androidMain/kotlin/org/ooni/probe/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,38 @@ | ||
package org.ooni.probe | ||
|
||
import android.os.Build | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import org.ooni.engine.AndroidOonimkallBridge | ||
import org.ooni.probe.di.Dependencies | ||
import org.ooni.probe.shared.Platform | ||
import org.ooni.probe.shared.PlatformInfo | ||
|
||
class MainActivity : ComponentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
val bridge = AndroidOonimkallBridge() | ||
val dependencies = Dependencies(bridge, filesDir.absolutePath) | ||
|
||
setContent { | ||
App(dependencies) | ||
App(setupDependencies()) | ||
} | ||
} | ||
|
||
private fun setupDependencies(): Dependencies { | ||
val platformInfo = | ||
object : PlatformInfo { | ||
override val version = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})" | ||
override val platform = Platform.Android | ||
override val osVersion = Build.VERSION.SDK_INT.toString() | ||
override val model = "${Build.MANUFACTURER} ${Build.MODEL}" | ||
} | ||
val bridge = AndroidOonimkallBridge() | ||
val dependencies = | ||
Dependencies( | ||
platformInfo = platformInfo, | ||
oonimkallBridge = bridge, | ||
baseFileDir = filesDir.absolutePath, | ||
) | ||
return dependencies | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
composeApp/src/commonMain/kotlin/org/ooni/probe/shared/PlatformInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.ooni.probe.shared | ||
|
||
interface PlatformInfo { | ||
val version: String | ||
val platform: Platform | ||
val osVersion: String | ||
val model: String | ||
} | ||
|
||
enum class Platform { | ||
Android, | ||
Ios, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
config/dw/src/commonMain/composeResources/drawable/compose-multiplatform.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
config/ooni/src/commonMain/composeResources/drawable/compose-multiplatform.xml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
config/ooni/src/commonMain/composeResources/values/strings.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.