mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Learn more in session overview screen
This commit is contained in:
parent
400b1b0697
commit
51532687b9
@ -168,7 +168,7 @@ class VectorSettingsDevicesFragment :
|
||||
append(getString(R.string.device_manager_learn_more_sessions_unverified))
|
||||
append("\n\n")
|
||||
append(getString(R.string.device_manager_learn_more_sessions_inactive))
|
||||
}
|
||||
},
|
||||
)
|
||||
SessionLearnMoreBottomSheet.show(childFragmentManager, args)
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.isVisible
|
||||
import com.airbnb.mvrx.Success
|
||||
@ -44,6 +43,8 @@ import im.vector.app.features.settings.devices.v2.list.SessionInfoViewState
|
||||
import im.vector.app.features.workers.signout.SignOutUiWorker
|
||||
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
import im.vector.app.features.settings.devices.v2.more.SessionLearnMoreBottomSheet
|
||||
import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
@ -204,6 +205,9 @@ class SessionOverviewFragment :
|
||||
isLastSeenDetailsVisible = true,
|
||||
)
|
||||
views.sessionOverviewInfo.render(infoViewState, dateFormatter, drawableProvider, colorProvider)
|
||||
views.sessionOverviewInfo.onLearnMoreClickListener = {
|
||||
showLearnMoreInfoVerificationStatus(viewState.deviceFullInfo.roomEncryptionTrustLevel == RoomEncryptionTrustLevel.Trusted)
|
||||
}
|
||||
} else {
|
||||
views.sessionOverviewInfo.isVisible = false
|
||||
}
|
||||
@ -249,4 +253,22 @@ class SessionOverviewFragment :
|
||||
reAuthActivityResultLauncher.launch(intent)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showLearnMoreInfoVerificationStatus(isVerified: Boolean) {
|
||||
val titleResId = if (isVerified) {
|
||||
R.string.device_manager_verification_status_verified
|
||||
} else {
|
||||
R.string.device_manager_verification_status_unverified
|
||||
}
|
||||
val descriptionResId = if (isVerified) {
|
||||
R.string.device_manager_learn_more_session_verified
|
||||
} else {
|
||||
R.string.device_manager_learn_more_sessions_unverified
|
||||
}
|
||||
val args = SessionLearnMoreBottomSheet.Args(
|
||||
title = getString(titleResId),
|
||||
description = getString(descriptionResId),
|
||||
)
|
||||
SessionLearnMoreBottomSheet.show(childFragmentManager, args)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user