forked from PeterCxy/OpenEUICC
Compare commits
No commits in common. "02ef31199b8a07028c1dc0249fc42c35d3d12aec" and "2270e4aa53df4d5ee2a6847b715b949e60b4bccd" have entirely different histories.
02ef31199b
...
2270e4aa53
10 changed files with 5 additions and 113 deletions
|
@ -2,8 +2,8 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
<application
|
<application
|
||||||
tools:replace="android:icon,android:roundIcon,android:name"
|
tools:replace="android:icon,android:roundIcon"
|
||||||
android:name="im.angry.openeuicc.JmpSimManagerApplication"
|
android:name="im.angry.openeuicc.UnprivilegedOpenEuiccApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher_jmp"
|
android:icon="@mipmap/ic_launcher_jmp"
|
||||||
android:roundIcon="@mipmap/ic_launcher_jmp"
|
android:roundIcon="@mipmap/ic_launcher_jmp"
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
package im.angry.openeuicc
|
|
||||||
|
|
||||||
import im.angry.openeuicc.di.JmpAppContainer
|
|
||||||
|
|
||||||
class JmpSimManagerApplication : UnprivilegedOpenEuiccApplication() {
|
|
||||||
override val appContainer by lazy {
|
|
||||||
JmpAppContainer(this)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package im.angry.openeuicc.di
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
|
|
||||||
class JmpAppContainer(context: Context) : UnprivilegedAppContainer(context) {
|
|
||||||
override val uiComponentFactory by lazy {
|
|
||||||
JmpUiComponentFactory()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package im.angry.openeuicc.di
|
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import im.angry.openeuicc.ui.JmpNoEuiccPlaceholderFragment
|
|
||||||
|
|
||||||
class JmpUiComponentFactory : UnprivilegedUiComponentFactory() {
|
|
||||||
override fun createNoEuiccPlaceholderFragment(): Fragment =
|
|
||||||
JmpNoEuiccPlaceholderFragment()
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package im.angry.openeuicc.ui
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.net.Uri
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import im.angry.easyeuicc.R
|
|
||||||
|
|
||||||
class JmpNoEuiccPlaceholderFragment : Fragment() {
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater,
|
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?
|
|
||||||
): View? {
|
|
||||||
val view = inflater.inflate(
|
|
||||||
R.layout.fragment_no_euicc_placeholder_jmp,
|
|
||||||
container,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
view.findViewById<View>(R.id.compatibility_check).setOnClickListener {
|
|
||||||
startActivity(Intent(requireContext(), CompatibilityCheckActivity::class.java))
|
|
||||||
}
|
|
||||||
|
|
||||||
view.findViewById<View>(R.id.purchase_esim).setOnClickListener {
|
|
||||||
startActivity(
|
|
||||||
Intent(
|
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
Uri.parse(getString(R.string.purchase_sim_url))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return view
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/no_euicc_placeholder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="40dp"
|
|
||||||
android:layout_marginEnd="40dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/no_euicc"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/compatibility_check"
|
|
||||||
android:text="@string/compatibility_check"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/no_euicc_placeholder"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/purchase_esim"
|
|
||||||
android:text="@string/purchase_esim"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/compatibility_check"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
@ -1,8 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">JMP SIM Manager</string>
|
<string name="app_name" translatable="false">JMP SIM Manager</string>
|
||||||
<string name="no_euicc">No JMP eSIM Adapter found on this device.</string>
|
|
||||||
<string name="purchase_esim">Buy JMP eSIM Adapter</string>
|
|
||||||
<string name="purchase_sim_url" translatable="false">https://jmp.chat/esim-adapter</string>
|
|
||||||
<string name="pref_info_source_code_url" translatable="false">https://gitea.angry.im/jmp-sim/jmp-sim-manager</string>
|
|
||||||
</resources>
|
</resources>
|
|
@ -7,7 +7,7 @@ import im.angry.openeuicc.util.*
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
open class UnprivilegedOpenEuiccApplication : OpenEuiccApplication() {
|
class UnprivilegedOpenEuiccApplication : OpenEuiccApplication() {
|
||||||
override val appContainer by lazy {
|
override val appContainer by lazy {
|
||||||
UnprivilegedAppContainer(this)
|
UnprivilegedAppContainer(this)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package im.angry.openeuicc.di
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
|
||||||
open class UnprivilegedAppContainer(context: Context) : DefaultAppContainer(context) {
|
class UnprivilegedAppContainer(context: Context) : DefaultAppContainer(context) {
|
||||||
override val uiComponentFactory by lazy {
|
override val uiComponentFactory by lazy {
|
||||||
UnprivilegedUiComponentFactory()
|
UnprivilegedUiComponentFactory()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package im.angry.openeuicc.di
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import im.angry.openeuicc.ui.UnprivilegedNoEuiccPlaceholderFragment
|
import im.angry.openeuicc.ui.UnprivilegedNoEuiccPlaceholderFragment
|
||||||
|
|
||||||
open class UnprivilegedUiComponentFactory : DefaultUiComponentFactory() {
|
class UnprivilegedUiComponentFactory : DefaultUiComponentFactory() {
|
||||||
override fun createNoEuiccPlaceholderFragment(): Fragment =
|
override fun createNoEuiccPlaceholderFragment(): Fragment =
|
||||||
UnprivilegedNoEuiccPlaceholderFragment()
|
UnprivilegedNoEuiccPlaceholderFragment()
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue