feat: show profile class with unfiltered profile list #87
4 changed files with 43 additions and 25 deletions
|
@ -5,6 +5,7 @@ import android.content.ClipData
|
|||
import android.content.ClipboardManager
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
|
@ -20,6 +21,7 @@ import android.widget.Toast
|
|||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
@ -339,6 +341,7 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
|
|||
private val name: TextView = root.requireViewById(R.id.name)
|
||||
private val state: TextView = root.requireViewById(R.id.state)
|
||||
private val provider: TextView = root.requireViewById(R.id.provider)
|
||||
private val profileClass: TextView = root.requireViewById(R.id.profile_class)
|
||||
private val profileMenu: ImageButton = root.requireViewById(R.id.profile_menu)
|
||||
|
||||
init {
|
||||
|
@ -374,7 +377,22 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
|
|||
R.string.disabled
|
||||
}
|
||||
)
|
||||
provider.text = profile.providerName
|
||||
provider.text = Html.fromHtml(
|
||||
getString(R.string.provider, profile.providerName),
|
||||
Html.FROM_HTML_MODE_COMPACT
|
||||
)
|
||||
val profileClassName = getString(
|
||||
when (profile.profileClass) {
|
||||
LocalProfileInfo.Clazz.Testing -> R.string.profile_class_testing
|
||||
LocalProfileInfo.Clazz.Provisioning -> R.string.profile_class_provisioning
|
||||
LocalProfileInfo.Clazz.Operational -> R.string.profile_class_operational
|
||||
}
|
||||
)
|
||||
profileClass.isVisible = unfilteredProfileListFlow.value
|
||||
profileClass.text = Html.fromHtml(
|
||||
getString(R.string.profile_class, profileClassName),
|
||||
Html.FROM_HTML_MODE_COMPACT
|
||||
)
|
||||
iccid.text = profile.iccid
|
||||
iccid.transformationMethod = PasswordTransformationMethod.getInstance()
|
||||
}
|
||||
|
|
|
@ -49,32 +49,29 @@
|
|||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/name"
|
||||
app:layout_constraintBottom_toTopOf="@+id/provider_label"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/provider_label"
|
||||
android:text="@string/provider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/state"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iccid_label"/>
|
||||
app:layout_constraintBottom_toTopOf="@+id/provider"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/provider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toRightOf="@id/provider_label"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/state"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iccid"/>
|
||||
app:layout_constraintBottom_toTopOf="@+id/profile_class"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profile_class"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/provider"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iccid_label"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iccid_label"
|
||||
|
@ -86,7 +83,7 @@
|
|||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/provider_label"
|
||||
app:layout_constraintTop_toBottomOf="@id/profile_class"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<TextView
|
||||
|
@ -94,11 +91,11 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:textSize="14sp"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintLeft_toRightOf="@id/iccid_label"
|
||||
app:layout_constraintTop_toBottomOf="@id/provider"
|
||||
app:layout_constraintTop_toBottomOf="@id/profile_class"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
<string name="omapi">OpenMobile API (OMAPI)</string>
|
||||
<string name="enabled">有効済み</string>
|
||||
<string name="disabled">無効済み</string>
|
||||
<string name="provider">プロバイダー:</string>
|
||||
<string name="iccid">ICCID:</string>
|
||||
<string name="provider"><b>プロバイダー:</b> %s</string>
|
||||
<string name="enable">有効化</string>
|
||||
<string name="disable">無効化</string>
|
||||
<string name="delete">削除</string>
|
||||
|
|
|
@ -12,8 +12,12 @@
|
|||
|
||||
<string name="enabled">Enabled</string>
|
||||
<string name="disabled">Disabled</string>
|
||||
<string name="provider">Provider:</string>
|
||||
<string name="iccid">ICCID:</string>
|
||||
<string name="provider"><b>Provider:</b> %s</string>
|
||||
<string name="profile_class"><b>Class:</b> %s</string>
|
||||
<string name="profile_class_testing">Testing</string>
|
||||
<string name="profile_class_provisioning">Provisioning</string>
|
||||
<string name="profile_class_operational">Operational</string>
|
||||
<string name="iccid" translatable="false">ICCID:</string>
|
||||
|
||||
<string name="enable">Enable</string>
|
||||
<string name="disable">Disable</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue