Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/main/kotlin/com/wire/android/navigation/Navigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
package com.wire.android.navigation

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import androidx.navigation.NavHostController
import com.ramcosta.composedestinations.generated.app.navgraphs.WireRootGraph
import com.ramcosta.composedestinations.utils.findDestination

@Stable
class Navigator(
val finish: () -> Unit,
val navController: NavHostController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ package com.wire.android.navigation
import com.ramcosta.composedestinations.annotation.ExternalNavGraph
import com.ramcosta.composedestinations.annotation.NavHostGraph
import com.ramcosta.composedestinations.generated.cells.navgraphs.CellsGraph
import com.ramcosta.composedestinations.generated.meetings.navgraphs.NewMeetingGraph
import com.ramcosta.composedestinations.generated.sketch.navgraphs.SketchGraph
import com.wire.android.navigation.style.DefaultRootNavGraphAnimations

@NavHostGraph(defaultTransitions = DefaultRootNavGraphAnimations::class)
annotation class WireRootNavGraph {
@ExternalNavGraph<CellsGraph>
@ExternalNavGraph<SketchGraph>
@ExternalNavGraph<NewMeetingGraph>
companion object Includes
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ package com.wire.android.ui.home.meetings

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import com.ramcosta.composedestinations.generated.meetings.destinations.NewMeetingScreenDestination
import com.wire.android.feature.meetings.ui.AllMeetingsScreen
import com.wire.android.feature.meetings.ui.NewMeetingBottomSheet
import com.wire.android.navigation.HomeDestination
import com.wire.android.navigation.annotation.app.WireHomeDestination
import com.wire.android.ui.common.dimensions
import com.wire.android.feature.meetings.ui.create.NewMeetingType
import com.wire.android.navigation.NavigationCommand
import com.wire.android.ui.home.HomeStateHolder

@WireHomeDestination
Expand All @@ -37,10 +40,14 @@ fun MeetingsScreen(homeStateHolder: HomeStateHolder) {
NewMeetingBottomSheet(
sheetState = homeStateHolder.newMeetingBottomSheetState,
onMeetNowClick = {
// TODO to be implemented later
homeStateHolder.newMeetingBottomSheetState.hide {
homeStateHolder.navigator.navigate(NavigationCommand(NewMeetingScreenDestination(NewMeetingType.MeetNow)))
}
},
onScheduleClick = {
// TODO to be implemented later
homeStateHolder.newMeetingBottomSheetState.hide {
homeStateHolder.navigator.navigate(NavigationCommand(NewMeetingScreenDestination(NewMeetingType.Schedule)))
}
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/
package com.wire.android.navigation

import androidx.compose.runtime.Stable

@Stable
interface WireNavigator {
fun navigate(navigationCommand: NavigationCommand)
fun navigateBack()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.util.lerp
import com.wire.android.ui.common.R
import com.wire.android.ui.common.colorsScheme
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.theme.WireTheme
import com.wire.android.util.PreviewMultipleThemes

@Composable
fun WireDragHandle(
modifier: Modifier = Modifier,
modifier: Modifier = defaultDragHandleModifier(),
progress: Float = 0f, // 0f: line, 1f: arrow
color: Color = colorsScheme().secondaryText
) {
Expand Down Expand Up @@ -71,10 +75,18 @@ fun WireDragHandle(
}
}

@Composable
private fun defaultDragHandleModifier(): Modifier {
val defaultContentDescription = stringResource(R.string.content_description_drag_handle)
return Modifier.semantics {
this.contentDescription = defaultContentDescription
}
}

@PreviewMultipleThemes
@Composable
fun WireDragHandlePreview_Line() = WireTheme {
WireDragHandle(progress = 0f)
WireDragHandle(progress = 0f)
}

@PreviewMultipleThemes
Expand Down
1 change: 1 addition & 0 deletions core/ui-common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@
<string name="content_description_conversation_search_icon">Search icon</string>
<string name="content_description_conversation_search_input">Search input</string>
<string name="content_description_clear_content">Clear content</string>
<string name="content_description_drag_handle">Drag handle</string>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Wire
* Copyright (C) 2024 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.wire.android.feature.meetings.navigation

import com.ramcosta.composedestinations.annotation.ExternalModuleGraph
import com.ramcosta.composedestinations.annotation.NavGraph

@NavGraph<ExternalModuleGraph>
annotation class NewMeetingNavGraph(
val start: Boolean = false
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package com.wire.android.feature.meetings.ui

import com.wire.android.feature.meetings.ui.create.NewMeetingType
import com.wire.android.feature.meetings.ui.create.NewMeetingViewModelImpl
import com.wire.android.feature.meetings.ui.list.MeetingListViewModelImpl
import com.wire.android.feature.meetings.ui.options.MeetingOptionsMenuViewModelImpl
import com.wire.android.feature.meetings.ui.usecase.GetMeetingUseCase
Expand All @@ -39,4 +41,6 @@
)

internal fun meetingOptionsMenuViewModel() = MeetingOptionsMenuViewModelImpl(getMeeting = getMeeting)

internal fun newMeetingViewModel(type: NewMeetingType) = NewMeetingViewModelImpl(type)

Check warning on line 45 in features/meetings/src/main/java/com/wire/android/feature/meetings/ui/MeetingsViewModelFactory.kt

View check run for this annotation

Codecov / codecov/patch

features/meetings/src/main/java/com/wire/android/feature/meetings/ui/MeetingsViewModelFactory.kt#L45

Added line #L45 was not covered by tests
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ package com.wire.android.feature.meetings.ui
import androidx.compose.runtime.Composable
import com.wire.android.di.metro.MetroViewModelGraph
import com.wire.android.di.metro.metroViewModel
import com.wire.android.feature.meetings.ui.create.NewMeetingType
import com.wire.android.feature.meetings.ui.create.NewMeetingViewModel
import com.wire.android.feature.meetings.ui.create.NewMeetingViewModelImpl
import com.wire.android.feature.meetings.ui.list.MeetingListViewModel
import com.wire.android.feature.meetings.ui.list.MeetingListViewModelImpl
import com.wire.android.feature.meetings.ui.options.MeetingOptionsMenuViewModel
Expand All @@ -40,3 +43,9 @@ fun meetingOptionsMenuListViewModel(): MeetingOptionsMenuViewModel =
metroViewModel<MeetingsViewModelGraph, MeetingOptionsMenuViewModelImpl> {
meetingsViewModelFactory.meetingOptionsMenuViewModel()
}

@Composable
fun newMeetingViewModel(type: NewMeetingType): NewMeetingViewModel =
metroViewModel<MeetingsViewModelGraph, NewMeetingViewModelImpl>(key = "new_meeting_${type.name}") {
meetingsViewModelFactory.newMeetingViewModel(type)
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fun NewMeetingBottomSheet(
MenuItemIcon(
id = com.wire.android.ui.common.R.drawable.ic_video_call,
tint = colorsScheme().onSurface,
contentDescription = stringResource(R.string.content_description_new_meeting_now_icon),
contentDescription = null, // no separate content description as the title already describes the action
)
},
onItemClick = onMeetNowClick,
Expand All @@ -60,7 +60,7 @@ fun NewMeetingBottomSheet(
MenuItemIcon(
id = com.wire.android.ui.common.R.drawable.ic_calendar,
tint = colorsScheme().onSurface,
contentDescription = stringResource(R.string.content_description_new_meeting_schedule_icon),
contentDescription = null, // no separate content description as the title already describes the action
)
},
onItemClick = onScheduleClick,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Wire
* Copyright (C) 2025 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.wire.android.feature.meetings.ui.create

import android.os.Parcelable
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import com.wire.android.feature.meetings.R
import kotlinx.parcelize.Parcelize
import com.wire.android.ui.common.R as CommonUiR

data class NewMeetingNavArgs(
val type: NewMeetingType
)

@Parcelize

Check warning on line 31 in features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt

View check run for this annotation

Codecov / codecov/patch

features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt#L31

Added line #L31 was not covered by tests
enum class NewMeetingType(
@StringRes val title: Int,
@StringRes val action: Int,
@DrawableRes val icon: Int,

Check warning on line 35 in features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt

View check run for this annotation

Codecov / codecov/patch

features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt#L33-L35

Added lines #L33 - L35 were not covered by tests
) : Parcelable {
MeetNow(
title = R.string.new_meeting_now,
action = R.string.new_meeting_action_start,
icon = CommonUiR.drawable.ic_video_call,

Check warning on line 40 in features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt

View check run for this annotation

Codecov / codecov/patch

features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt#L37-L40

Added lines #L37 - L40 were not covered by tests
),
Schedule(
title = R.string.new_meeting_schedule,
action = R.string.new_meeting_action_schedule,
icon = CommonUiR.drawable.ic_calendar,

Check warning on line 45 in features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt

View check run for this annotation

Codecov / codecov/patch

features/meetings/src/main/java/com/wire/android/feature/meetings/ui/create/NewMeetingNavArgs.kt#L42-L45

Added lines #L42 - L45 were not covered by tests
)
}
Loading
Loading