Completes modal layout

This commit is contained in:
ericdecanini 2022-05-05 12:37:36 +02:00
parent b6ab0bdc53
commit 9fc189efce
3 changed files with 40 additions and 13 deletions

View File

@ -238,7 +238,7 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
initUiAndData()
window.statusBarColor = ContextCompat.getColor(this, android.R.color.white)
window.statusBarColor = ContextCompat.getColor(this, android.R.color.white, "somethingelse", "another thing", "awdawdwad", "awnoidwnadoinwaiodnawoindioawniodaw")
window.navigationBarColor = ContextCompat.getColor(this, android.R.color.white)
val titleRes = getTitleRes()
if (titleRes != -1) {
@ -262,15 +262,17 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
private fun handleGlobalError(globalError: GlobalError) {
when (globalError) {
is GlobalError.InvalidToken ->
is GlobalError.InvalidToken ->
handleInvalidToken(globalError)
is GlobalError.ConsentNotGivenError ->
consentNotGivenHelper.displayDialog(globalError.consentUri,
activeSessionHolder.getActiveSession().sessionParams.homeServerHost ?: "")
is GlobalError.CertificateError ->
consentNotGivenHelper.displayDialog(
globalError.consentUri,
activeSessionHolder.getActiveSession().sessionParams.homeServerHost ?: ""
)
is GlobalError.CertificateError ->
handleCertificateError(globalError)
GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration
is GlobalError.InitialSyncRequest -> handleInitialSyncRequest(globalError)
GlobalError.ExpiredAccount -> Unit // TODO Handle account expiration
is GlobalError.InitialSyncRequest -> handleInitialSyncRequest(globalError)
}
}
@ -278,11 +280,13 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
MaterialAlertDialogBuilder(this)
.setTitle(R.string.initial_sync_request_title)
.setMessage(
getString(R.string.initial_sync_request_content, getString(
getString(
R.string.initial_sync_request_content, getString(
when (initialSyncRequest.reason) {
InitialSyncRequestReason.IGNORED_USERS_LIST_CHANGE -> R.string.initial_sync_request_reason_unignored_users
}
))
)
)
)
.setPositiveButton(R.string.ok) { _, _ ->
MainActivity.restartApp(this, MainActivityArgs(clearCache = true))
@ -320,7 +324,8 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver
mainActivityStarted = true
MainActivity.restartApp(this,
MainActivity.restartApp(
this,
MainActivityArgs(
clearCredentials = !globalError.softLogout,
isUserLoggedOut = true,

View File

@ -8,22 +8,43 @@
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/header_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="?attr/vctr_content_tertiary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"
android:text="@string/choose_a_space"
android:textAllCaps="true" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/room_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/header_text"
tools:itemCount="3"
tools:listitem="@layout/item_modal_space" />
<com.google.android.material.divider.MaterialDivider
android:id="@+id/bottom_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/room_list" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/add_space_icon_background"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginTop="16dp"
android:background="#4D8D97A5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/room_list"
app:layout_constraintTop_toBottomOf="@id/bottom_divider"
app:shapeAppearanceOverlay="@style/SpaceListModalImageShapeOverlay" />
<ImageView

View File

@ -3039,4 +3039,5 @@
<string name="screen_sharing_notification_title">${app_name} Screen Sharing</string>
<string name="screen_sharing_notification_description">Screen sharing is in progress</string>
<string name="all_chats">All Chats</string>
<string name="choose_a_space">Choose a space</string>
</resources>