From 885ad6928724d840457814a2540fdf1b3d0914be Mon Sep 17 00:00:00 2001 From: sergeibakhtiarov Date: Thu, 2 Jan 2025 19:34:51 +0100 Subject: [PATCH 01/12] fix: show no connection banner faster [#WPB-11568] (#3776) Co-authored-by: sergei.bakhtiarov --- .../topappbar/CommonTopAppBarViewModel.kt | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt index 0e58a698ce1..d682035168b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt @@ -29,9 +29,14 @@ import com.wire.android.util.CurrentScreenManager import com.wire.kalium.logic.CoreLogic import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.data.call.CallStatus -import com.wire.kalium.logic.data.sync.SyncState +import com.wire.kalium.logic.data.sync.SyncState.Failed +import com.wire.kalium.logic.data.sync.SyncState.GatheringPendingEvents +import com.wire.kalium.logic.data.sync.SyncState.Live +import com.wire.kalium.logic.data.sync.SyncState.SlowSync +import com.wire.kalium.logic.data.sync.SyncState.Waiting import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.session.CurrentSessionResult +import com.wire.kalium.network.NetworkState import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow @@ -40,7 +45,6 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf -import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import org.jetbrains.annotations.VisibleForTesting import javax.inject.Inject @@ -59,12 +63,19 @@ class CommonTopAppBarViewModel @Inject constructor( private fun connectivityFlow(userId: UserId): Flow = coreLogic.sessionScope(userId) { - observeSyncState().map { - when (it) { - SyncState.Waiting -> Connectivity.WaitingConnection(null, null) - is SyncState.Failed -> Connectivity.WaitingConnection(it.cause, it.retryDelay) - SyncState.GatheringPendingEvents, SyncState.SlowSync -> Connectivity.Connecting - SyncState.Live -> Connectivity.Connected + combine(observeSyncState(), coreLogic.networkStateObserver.observeNetworkState()) { syncState, networkState -> + when (syncState) { + is Waiting -> Connectivity.WaitingConnection(null, null) + is Failed -> Connectivity.WaitingConnection(syncState.cause, syncState.retryDelay) + is GatheringPendingEvents, + is SlowSync -> Connectivity.Connecting + + is Live -> + if (networkState is NetworkState.ConnectedWithInternet) { + Connectivity.Connected + } else { + Connectivity.WaitingConnection(null, null) + } } } } From 73cf82e0323e5cb17e0d5fde6d6f018d15229d96 Mon Sep 17 00:00:00 2001 From: Oussama Hassine Date: Fri, 3 Jan 2025 19:11:49 +0100 Subject: [PATCH 02/12] chore: wrong url when opening team management after migration - cherrypick (WPB-14872) (#3720) Co-authored-by: Mohamad Jaara --- .../com/wire/android/di/CoreLogicModule.kt | 10 +++++-- .../android/di/accountScoped/UserModule.kt | 6 ----- .../userprofile/self/SelfUserProfileScreen.kt | 5 ++++ .../self/SelfUserProfileViewModel.kt | 6 ++--- .../teammigration/TeamMigrationState.kt | 2 ++ .../teammigration/TeamMigrationViewModel.kt | 27 ++++++++++++++++++- .../step4/TeamMigrationDoneStepScreen.kt | 9 ++++--- app/src/main/res/values/strings.xml | 1 - .../TeamMigrationViewModelTest.kt | 13 +++++++++ 9 files changed, 62 insertions(+), 17 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt b/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt index 3bdf323e37e..01e0ea54c89 100644 --- a/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt @@ -498,6 +498,12 @@ class UseCaseModule { fun provideMigrateFromPersonalToTeamUseCase( @KaliumCoreLogic coreLogic: CoreLogic, @CurrentAccount currentAccount: UserId - ) = - coreLogic.getSessionScope(currentAccount).migrateFromPersonalToTeam + ) = coreLogic.getSessionScope(currentAccount).migrateFromPersonalToTeam + + @ViewModelScoped + @Provides + fun provideGetTeamUrlUseCase( + @KaliumCoreLogic coreLogic: CoreLogic, + @CurrentAccount currentAccount: UserId + ) = coreLogic.getSessionScope(currentAccount).getTeamUrlUseCase } diff --git a/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt b/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt index 2c8c7ac115c..e4ed7d01bfa 100644 --- a/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt @@ -37,7 +37,6 @@ import com.wire.kalium.logic.feature.personaltoteamaccount.CanMigrateFromPersona import com.wire.kalium.logic.feature.publicuser.GetAllContactsUseCase import com.wire.kalium.logic.feature.publicuser.GetKnownUserUseCase import com.wire.kalium.logic.feature.publicuser.RefreshUsersWithoutMetadataUseCase -import com.wire.kalium.logic.feature.server.GetTeamUrlUseCase import com.wire.kalium.logic.feature.user.DeleteAccountUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import com.wire.kalium.logic.feature.user.GetUserInfoUseCase @@ -192,11 +191,6 @@ class UserModule { fun provideGetSelfUseCase(userScope: UserScope): GetSelfUserUseCase = userScope.getSelfUser - @ViewModelScoped - @Provides - fun provideGetTeamUrlUseCase(userScope: UserScope): GetTeamUrlUseCase = - userScope.getTeamUrl - @ViewModelScoped @Provides fun provideGetAvatarAssetUseCase(userScope: UserScope): GetAvatarAssetUseCase = diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt index 60d081bf260..c562b1ba5dc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt @@ -120,6 +120,11 @@ fun SelfUserProfileScreen( ) { val legalHoldSubjectDialogState = rememberVisibilityState() + LaunchedEffect(Unit) { + // Check if the user is able to migrate to a team account, every time the screen is shown + viewModelSelf.checkIfUserAbleToMigrateToTeamAccount() + } + SelfUserProfileContent( state = viewModelSelf.userProfileState, onCloseClick = navigator::navigateBack, diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileViewModel.kt index 2820cc43ae5..d3e812b466d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileViewModel.kt @@ -112,7 +112,6 @@ class SelfUserProfileViewModel @Inject constructor( init { viewModelScope.launch { fetchSelfUser() - checkIfUserAbleToMigrateToTeamAccount() observeEstablishedCall() fetchIsReadOnlyAccount() observeLegalHoldStatus() @@ -120,9 +119,8 @@ class SelfUserProfileViewModel @Inject constructor( } } - private suspend fun checkIfUserAbleToMigrateToTeamAccount() { - val isAbleToMigrateToTeamAccount = canMigrateFromPersonalToTeam() && userProfileState.teamName.isNullOrBlank() - userProfileState = userProfileState.copy(isAbleToMigrateToTeamAccount = isAbleToMigrateToTeamAccount) + suspend fun checkIfUserAbleToMigrateToTeamAccount() { + userProfileState = userProfileState.copy(isAbleToMigrateToTeamAccount = canMigrateFromPersonalToTeam()) } private suspend fun fetchIsReadOnlyAccount() { diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt index be2d3d9625e..8feb6d1708e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt @@ -24,5 +24,7 @@ data class TeamMigrationState( val teamNameTextState: TextFieldState = TextFieldState(), val shouldShowMigrationLeaveDialog: Boolean = false, val currentStep: Int = 0, + val username: String = "", + val teamUrl: String = "", val migrationFailure: MigrateFromPersonalToTeamFailure? = null ) diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt index 818a70b9b27..d58b88d1bef 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt @@ -24,6 +24,8 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.wire.android.feature.analytics.AnonymousAnalyticsManager import com.wire.android.feature.analytics.model.AnalyticsEvent +import com.wire.kalium.logic.feature.server.GetTeamUrlUseCase +import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamFailure import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamResult import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamUseCase @@ -34,12 +36,19 @@ import javax.inject.Inject @HiltViewModel class TeamMigrationViewModel @Inject constructor( private val anonymousAnalyticsManager: AnonymousAnalyticsManager, - private val migrateFromPersonalToTeam: MigrateFromPersonalToTeamUseCase + private val migrateFromPersonalToTeam: MigrateFromPersonalToTeamUseCase, + private val getSelfUser: GetSelfUserUseCase, + private val getTeamUrl: GetTeamUrlUseCase ) : ViewModel() { var teamMigrationState by mutableStateOf(TeamMigrationState()) private set + init { + setUsername() + setTeamUrl() + } + fun showMigrationLeaveDialog() { teamMigrationState = teamMigrationState.copy(shouldShowMigrationLeaveDialog = true) } @@ -117,4 +126,20 @@ class TeamMigrationViewModel @Inject constructor( private fun onMigrationFailure(failure: MigrateFromPersonalToTeamFailure) { teamMigrationState = teamMigrationState.copy(migrationFailure = failure) } + + private fun setUsername() { + viewModelScope.launch { + getSelfUser().collect { selfUser -> + selfUser.name?.let { + teamMigrationState = teamMigrationState.copy(username = it) + } + } + } + } + + private fun setTeamUrl() { + viewModelScope.launch { + teamMigrationState = teamMigrationState.copy(teamUrl = getTeamUrl()) + } + } } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step4/TeamMigrationDoneStepScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step4/TeamMigrationDoneStepScreen.kt index 2f582d61aa3..9cfbd4bc63e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step4/TeamMigrationDoneStepScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step4/TeamMigrationDoneStepScreen.kt @@ -65,7 +65,6 @@ fun TeamMigrationDoneStepScreen( ) { val context = LocalContext.current - val teamManagementUrl = stringResource(R.string.url_team_management) TeamMigrationDoneStepContent( onBackToWireClicked = { teamMigrationViewModel.sendPersonalTeamCreationFlowCompletedEvent( @@ -79,11 +78,14 @@ fun TeamMigrationDoneStepScreen( ) }, onOpenTeamManagementClicked = { + val teamManagementUrl = teamMigrationViewModel.teamMigrationState.teamUrl + teamMigrationViewModel.sendPersonalTeamCreationFlowCompletedEvent( modalOpenTeamManagementButtonClicked = true ) CustomTabsHelper.launchUrl(context, teamManagementUrl) }, + username = teamMigrationViewModel.teamMigrationState.username, teamName = teamMigrationViewModel.teamMigrationState.teamNameTextState.text.toString() ) @@ -98,6 +100,7 @@ fun TeamMigrationDoneStepScreen( private fun TeamMigrationDoneStepContent( onBackToWireClicked: () -> Unit, onOpenTeamManagementClicked: () -> Unit, + username: String, teamName: String, modifier: Modifier = Modifier ) { @@ -130,7 +133,7 @@ private fun TeamMigrationDoneStepContent( bottom = dimensions().spacing56x ) .align(alignment = Alignment.CenterHorizontally), - text = stringResource(R.string.personal_to_team_migration_done_step, teamName), + text = stringResource(R.string.personal_to_team_migration_done_step, username), style = MaterialTheme.wireTypography.title01, color = colorsScheme().onBackground ) @@ -187,6 +190,6 @@ private fun TeamMigrationDoneStepContent( @Composable private fun TeamMigrationDoneStepScreenPreview() { WireTheme { - TeamMigrationDoneStepContent({}, {}, teamName = "teamName") + TeamMigrationDoneStepContent({}, {}, username = "John", teamName = "teamName") } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6f271514800..153151ac9a1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -284,7 +284,6 @@ https://support.wire.com/hc/articles/360002855557 https://support.wire.com/hc/articles/360002855817 https://wire.com/pricing - https://teams.wire.com/ https://teams.wire.com/login https://wire.com/en/enterprise diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt index ef00ce0c20c..fc30d21f0a0 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt @@ -22,6 +22,8 @@ import com.wire.android.config.CoroutineTestExtension import com.wire.android.feature.analytics.AnonymousAnalyticsManager import com.wire.android.feature.analytics.model.AnalyticsEvent import com.wire.kalium.logic.NetworkFailure +import com.wire.kalium.logic.feature.server.GetTeamUrlUseCase +import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamFailure import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamResult import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamUseCase @@ -31,6 +33,7 @@ import io.mockk.coVerify import io.mockk.impl.annotations.MockK import io.mockk.mockk import io.mockk.verify +import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.runTest import org.amshove.kluent.internal.assertEquals import org.junit.jupiter.api.Assertions @@ -267,13 +270,23 @@ class TeamMigrationViewModelTest { @MockK lateinit var migrateFromPersonalToTeam: MigrateFromPersonalToTeamUseCase + @MockK + lateinit var getSelfUser: GetSelfUserUseCase + + @MockK + lateinit var getTeamUrl: GetTeamUrlUseCase + init { MockKAnnotations.init(this, relaxUnitFun = true) + coEvery { getSelfUser() } returns flowOf() + coEvery { getTeamUrl() } returns "TeamUrl" } fun arrange() = this to TeamMigrationViewModel( anonymousAnalyticsManager = anonymousAnalyticsManager, migrateFromPersonalToTeam = migrateFromPersonalToTeam, + getSelfUser = getSelfUser, + getTeamUrl = getTeamUrl ).also { viewModel -> viewModel.teamMigrationState.teamNameTextState.setTextAndPlaceCursorAtEnd(TEAM_NAME) } From 4883d0e387d061a4e3e95a64f602a1f79697854b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:48:32 +0100 Subject: [PATCH 03/12] =?UTF-8?q?feat:=20show=20Guest=20label=20for=20pers?= =?UTF-8?q?onal=20users=20after=20migration=20in=20conversations=20screen?= =?UTF-8?q?=20-=20cherrypick=20(WPB-14871)=20=20=F0=9F=8D=92=20(#3783)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Oussama Hassine --- .../userprofile/teammigration/TeamMigrationState.kt | 1 + .../teammigration/TeamMigrationViewModel.kt | 4 ++++ .../teammigration/common/BottomLineButtons.kt | 12 ++++++++++-- .../step3/TeamMigrationConfirmationStepScreen.kt | 7 ++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt index 8feb6d1708e..925b5b0a19a 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationState.kt @@ -23,6 +23,7 @@ import com.wire.kalium.logic.feature.user.migration.MigrateFromPersonalToTeamFai data class TeamMigrationState( val teamNameTextState: TextFieldState = TextFieldState(), val shouldShowMigrationLeaveDialog: Boolean = false, + val isMigrating: Boolean = false, val currentStep: Int = 0, val username: String = "", val teamUrl: String = "", diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt index d58b88d1bef..f4c900f4491 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt @@ -101,6 +101,10 @@ class TeamMigrationViewModel @Inject constructor( ) } + fun setIsMigratingState(isMigrating: Boolean) { + teamMigrationState = teamMigrationState.copy(isMigrating = isMigrating) + } + fun migrateFromPersonalToTeamAccount(onSuccess: () -> Unit) { viewModelScope.launch { migrateFromPersonalToTeam.invoke( diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/common/BottomLineButtons.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/common/BottomLineButtons.kt index 65ef95d4bac..1d901d895ba 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/common/BottomLineButtons.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/common/BottomLineButtons.kt @@ -42,6 +42,7 @@ import com.wire.android.ui.theme.WireTheme fun BottomLineButtons( isContinueButtonEnabled: Boolean, modifier: Modifier = Modifier, + isMigrating: Boolean = false, isBackButtonVisible: Boolean = true, backButtonContentDescription: String = stringResource(R.string.personal_to_team_migration_back_button_label), onBack: () -> Unit = { }, @@ -67,7 +68,12 @@ fun BottomLineButtons( .fillMaxWidth() .semantics(true) { contentDescription = backButtonContentDescription }, text = stringResource(R.string.personal_to_team_migration_back_button_label), - onClick = onBack + onClick = onBack, + state = if (isMigrating) { + WireButtonState.Disabled + } else { + WireButtonState.Default + } ) } @@ -77,7 +83,8 @@ fun BottomLineButtons( .padding(top = dimensions().spacing6x), text = stringResource(R.string.label_continue), onClick = onContinue, - state = if (isContinueButtonEnabled) { + loading = isMigrating, + state = if (isContinueButtonEnabled && !isMigrating) { WireButtonState.Default } else { WireButtonState.Disabled @@ -91,6 +98,7 @@ fun BottomLineButtons( private fun BottomLineButtonsPreview() { WireTheme { BottomLineButtons( + isMigrating = false, isContinueButtonEnabled = true ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step3/TeamMigrationConfirmationStepScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step3/TeamMigrationConfirmationStepScreen.kt index 996e6a2a4fc..5d0d2e32dc5 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step3/TeamMigrationConfirmationStepScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step3/TeamMigrationConfirmationStepScreen.kt @@ -78,11 +78,14 @@ fun TeamMigrationConfirmationStepScreen( val state = teamMigrationViewModel.teamMigrationState TeamMigrationConfirmationStepScreenContent( + isMigrating = state.isMigrating, onContinueButtonClicked = { + teamMigrationViewModel.setIsMigratingState(true) teamMigrationViewModel.migrateFromPersonalToTeamAccount( onSuccess = { + teamMigrationViewModel.setIsMigratingState(false) navigator.navigate(TeamMigrationDoneStepScreenDestination) - }, + } ) }, onBackPressed = { @@ -179,6 +182,7 @@ private fun ErrorDialog( @Composable private fun TeamMigrationConfirmationStepScreenContent( modifier: Modifier = Modifier, + isMigrating: Boolean = false, onContinueButtonClicked: () -> Unit = { }, onBackPressed: () -> Unit = { } ) { @@ -254,6 +258,7 @@ private fun TeamMigrationConfirmationStepScreenContent( } val isContinueButtonEnabled = agreedToMigrationTerms.value && acceptedWireTermsOfUse.value BottomLineButtons( + isMigrating = isMigrating, isContinueButtonEnabled = isContinueButtonEnabled, onContinue = onContinueButtonClicked, backButtonContentDescription = stringResource(R.string.personal_to_team_migration_back_button_confirmation_content_description), From 9d5c57ca952267548374d436cb2122f44922771a Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Mon, 6 Jan 2025 13:19:18 -0300 Subject: [PATCH 04/12] ci: update s3 config to adjust to private (WPB-8645) (#3784) --- .github/actions/deploy-to-s3/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/deploy-to-s3/action.yml b/.github/actions/deploy-to-s3/action.yml index 1847a65456c..74e312278f5 100644 --- a/.github/actions/deploy-to-s3/action.yml +++ b/.github/actions/deploy-to-s3/action.yml @@ -40,8 +40,8 @@ runs: aws-bucket: ${{ inputs.aws-bucket }} destination-dir: "megazord/android/reloaded/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/PR-${{ github.event.pull_request.number }}/" file-path: ${{ steps.path.outputs.apk_full_path }} - output-file-url: 'true' - public: true + output-file-url: 'false' + public: false - name: Upload to S3 from branch if: github.event.pull_request.number == '' id: upload-from-branch @@ -53,8 +53,8 @@ runs: aws-bucket: ${{ inputs.aws-bucket }} destination-dir: "megazord/android/reloaded/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/" file-path: ${{ steps.path.outputs.apk_full_path }} - output-file-url: 'true' - public: true + output-file-url: 'false' + public: false - name: Show URL if: github.event.pull_request.number != '' shell: bash From eaa35af33ba49fb31985cbb897b0425e1a69b001 Mon Sep 17 00:00:00 2001 From: sergeibakhtiarov Date: Tue, 7 Jan 2025 14:59:43 +0100 Subject: [PATCH 05/12] chore: update emoji picker ui [#WPB-14254] (#3786) Co-authored-by: sergei.bakhtiarov --- .../com/wire/android/ui/emoji/EmojiPicker.kt | 26 ++++---- app/src/main/res/layout/view_emoji_picker.xml | 64 +++++++++++++++++++ app/src/main/res/values-night/colors.xml | 3 + app/src/main/res/values/colors.xml | 3 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/themes.xml | 5 ++ 6 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 app/src/main/res/layout/view_emoji_picker.xml diff --git a/app/src/main/kotlin/com/wire/android/ui/emoji/EmojiPicker.kt b/app/src/main/kotlin/com/wire/android/ui/emoji/EmojiPicker.kt index 5205500d865..c0dc587d7fc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/emoji/EmojiPicker.kt +++ b/app/src/main/kotlin/com/wire/android/ui/emoji/EmojiPicker.kt @@ -17,12 +17,13 @@ */ package com.wire.android.ui.emoji -import android.widget.LinearLayout +import android.view.View import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext import androidx.emoji2.emojipicker.EmojiPickerView import com.google.android.material.bottomsheet.BottomSheetDragHandleView +import com.wire.android.R @Composable fun EmojiPickerBottomSheet( @@ -33,21 +34,18 @@ fun EmojiPickerBottomSheet( val context = LocalContext.current val dialog = remember { HandleDraggableBottomSheetDialog(context).apply { - setContentView( - LinearLayout(context).apply { - orientation = LinearLayout.VERTICAL - val handle = BottomSheetDragHandleView(context) + setContentView(R.layout.view_emoji_picker).run { + findViewById(R.id.emoji_picker_back_button)?.setOnClickListener { + dismiss() + onDismiss.invoke() + } + findViewById(R.id.emoji_picker)?.setOnEmojiPickedListener { emojiViewItem -> + onEmojiSelected(emojiViewItem.emoji) + } + findViewById(R.id.handle)?.let { handle -> getBehavior().dragHandle = handle - addView(handle) - addView( - EmojiPickerView(context).apply { - setOnEmojiPickedListener { emojiViewItem -> - onEmojiSelected(emojiViewItem.emoji) - } - } - ) } - ) + } setOnCancelListener { onDismiss.invoke() } } } diff --git a/app/src/main/res/layout/view_emoji_picker.xml b/app/src/main/res/layout/view_emoji_picker.xml new file mode 100644 index 00000000000..0cb5edd7798 --- /dev/null +++ b/app/src/main/res/layout/view_emoji_picker.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index be377ca64bc..b88bf72821e 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -21,6 +21,9 @@ #17181A #EDEFF0 + #C5C6CF + #C5C6CF + #17181A diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 5fc9bc9b7ef..607c6077505 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -21,6 +21,9 @@ #EDEFF0 #34373D + #34373D + #34373D + #FFFFFF diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 153151ac9a1..d7a73827876 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1674,4 +1674,5 @@ In group conversations, the group admin can overwrite this setting. Wire could not complete your team creation due to a slow internet connection. Wire could not complete your team creation due to an unknown error. You + Select Reaction diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 564774fecbf..a568f7c0977 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -26,6 +26,11 @@ @color/background + + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index a568f7c0977..d35c62cd6a2 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -21,8 +21,6 @@ @@ -33,8 +31,6 @@