Browse Source

fix: profile class always display (#92)

Reviewed-on: https://gitea.angry.im/PeterCxy/OpenEUICC/pulls/92
Co-authored-by: septs <github@septs.pw>
Co-committed-by: septs <github@septs.pw>
septs 1 year ago
parent
commit
9e637f766d

+ 3 - 5
app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt

@@ -367,10 +367,6 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
         private lateinit var profile: LocalProfileInfo
 
         fun setProfile(profile: LocalProfileInfo) {
-            if (unfilteredProfileListFlow.value) {
-                profileClassLabel.isVisible = true
-                profileClass.isVisible = true
-            }
             this.profile = profile
             name.text = profile.displayName
 
@@ -382,7 +378,9 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
                 }
             )
             provider.text = profile.providerName
-            if (profileClass.isVisible) profileClass.setText(
+            profileClassLabel.isVisible = unfilteredProfileListFlow.value
+            profileClass.isVisible = unfilteredProfileListFlow.value
+            profileClass.setText(
                 when (profile.profileClass) {
                     LocalProfileInfo.Clazz.Testing -> R.string.profile_class_testing
                     LocalProfileInfo.Clazz.Provisioning -> R.string.profile_class_provisioning

+ 2 - 0
app-common/src/main/res/layout/euicc_profile.xml

@@ -85,6 +85,7 @@
                 android:textSize="14sp"
                 android:textStyle="bold"
                 android:singleLine="true"
+                android:visibility="gone"
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintTop_toBottomOf="@id/provider_label"
                 app:layout_constraintBottom_toTopOf="@+id/iccid_label"/>
@@ -97,6 +98,7 @@
                 android:layout_marginStart="7dp"
                 android:textSize="14sp"
                 android:singleLine="true"
+                android:visibility="gone"
                 app:layout_constraintLeft_toRightOf="@id/profile_class_label"
                 app:layout_constraintTop_toBottomOf="@id/provider"
                 app:layout_constraintBottom_toTopOf="@+id/iccid"/>