Skip to content

Commit

Permalink
DO NOT MERGE: androidApp: Initial support for tickets
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Gupta <[email protected]>
  • Loading branch information
theimpulson committed Oct 10, 2024
1 parent e165fbe commit 64a5644
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import app.opass.ccip.android.ui.screens.event.EventScreen
import app.opass.ccip.android.ui.screens.eventpreview.EventPreviewScreen
import app.opass.ccip.android.ui.screens.schedule.ScheduleScreen
import app.opass.ccip.android.ui.screens.session.SessionScreen
import app.opass.ccip.android.ui.screens.ticket.TicketScreen

@Composable
fun SetupNavGraph(navHostController: NavHostController, startDestination: Screen) {
Expand Down Expand Up @@ -51,6 +52,10 @@ fun SetupNavGraph(navHostController: NavHostController, startDestination: Screen
composable<Screen.Session> { backStackEntry ->
backStackEntry.toRoute<Screen.Session>().SessionScreen(navHostController)
}

composable<Screen.Ticket> { backStackEntry ->
backStackEntry.toRoute<Screen.Ticket>().TicketScreen(navHostController)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ sealed class Screen(@StringRes val title: Int, @DrawableRes val icon: Int) {
title = R.string.session,
icon = R.drawable.ic_podium
)

@Serializable
data class Ticket(val eventId: String) : Screen(
title = R.string.ticket,
icon = R.drawable.ic_ticket
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ fun Screen.Event.EventScreen(
FeatureItem(
label = stringResource(id = R.string.ticket),
iconRes = R.drawable.ic_ticket
)
) {
navHostController.navigate(Screen.Ticket(this@EventScreen.id))
}
}

FeatureType.VENUE -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package app.opass.ccip.android.ui.screens.ticket

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavHostController
import app.opass.ccip.android.ui.components.TopAppBar
import app.opass.ccip.android.ui.navigation.Screen

@Composable
fun Screen.Ticket.TicketScreen(
navHostController: NavHostController,
viewModel: TicketViewModel = hiltViewModel()
) {
Scaffold(
modifier = Modifier.fillMaxSize(),
topBar = {
TopAppBar(
title = stringResource(this.title),
navHostController = navHostController
)
}
) { paddingValues ->
Column(modifier = Modifier.padding(paddingValues)) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package app.opass.ccip.android.ui.screens.ticket

import androidx.lifecycle.ViewModel
import app.opass.ccip.helpers.PortalHelper
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class TicketViewModel @Inject constructor(
private val portalHelper: PortalHelper
): ViewModel() {

}
4 changes: 3 additions & 1 deletion androidApp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<string name="venue">Venue</string>
<string name="sponsors">Sponsors</string>
<string name="staff">Staff</string>
<string name="ticket">Ticket</string>
<string name="wifi">WiFi</string>
<string name="irc" translatable="false">IRC</string>

Expand All @@ -29,4 +28,7 @@

<!-- SessionScreen -->
<string name="session">Session</string>

<!-- TicketScreen -->
<string name="ticket">Ticket</string>
</resources>

0 comments on commit 64a5644

Please sign in to comment.