Skip to content

Commit

Permalink
Merge branch 'feature/event-deeplink' of github.com:DimensionSrl/it.b…
Browse files Browse the repository at this point in the history
…z.noi.community.android into feature/event-deeplink

# Conflicts:
#	app/src/main/java/it/bz/noi/community/ui/eventDetails/EventDetailsFragment.kt
#	app/src/main/java/it/bz/noi/community/ui/today/events/EventsFragment.kt
#	app/src/main/res/navigation/mobile_navigation.xml
  • Loading branch information
s1g53gv committed Dec 17, 2024
2 parents 0fb97fc + 0b6ad72 commit 9281e9e
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 197 deletions.
10 changes: 4 additions & 6 deletions app/src/main/java/it/bz/noi/community/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import it.bz.noi.community.ui.onboarding.OnboardingActivity.Companion.LOGOUT_REQUEST
import it.bz.noi.community.databinding.ActivityMainBinding
import it.bz.noi.community.data.repository.AccountsManager
import it.bz.noi.community.databinding.ActivityMainBinding
import it.bz.noi.community.notifications.MessagingService
import it.bz.noi.community.oauth.AuthManager
import it.bz.noi.community.oauth.AuthStateStatus
import it.bz.noi.community.notifications.MessagingService
import it.bz.noi.community.storage.getWelcomeUnderstood
import it.bz.noi.community.ui.WebViewFragment
import it.bz.noi.community.ui.onboarding.OnboardingActivity
import it.bz.noi.community.ui.onboarding.OnboardingActivity.Companion.LOGOUT_REQUEST
import it.bz.noi.community.utils.Utils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import net.openid.appauth.AuthorizationException

class MainActivity : AppCompatActivity() {
Expand Down Expand Up @@ -93,7 +91,7 @@ class MainActivity : AppCompatActivity() {
setupActionBarWithNavController(navController, appBarConfiguration)
binding.navView.setupWithNavController(navController)

navController.addOnDestinationChangedListener { controller, destination, arguments ->
navController.addOnDestinationChangedListener { _, destination, arguments ->
when (destination.id) {
R.id.navigation_more -> {
supportActionBar?.hide()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface OpendatahubApiService {
@GET("v1/EventShort/{id}")
suspend fun getEventDetails(
@Path("id") eventID: String,
): EventsResponse.Event
): Event

/*@GET("v1/EventShort/Detail/{id}")
suspend fun getEventDetails(
Expand Down
95 changes: 51 additions & 44 deletions app/src/main/java/it/bz/noi/community/data/models/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,60 @@

package it.bz.noi.community.data.models

import android.os.Parcelable
import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName
import java.util.*
import kotlinx.parcelize.Parcelize
import java.util.Date


data class EventsResponse(
@SerializedName("Items")
val events: List<Event>
) {
data class Event(
@SerializedName("Id")
val eventId: String? = null,
@SerializedName("EventDescription")
val name: String? = null,
@SerializedName("EventDescriptionEN")
val nameEN: String? = null,
@SerializedName("EventDescriptionIT")
val nameIT: String? = null,
@SerializedName("EventDescriptionDE")
val nameDE: String? = null,
@SerializedName("EventTextEN")
val descriptionEN: String? = null,
@SerializedName("EventTextIT")
val descriptionIT: String? = null,
@SerializedName("EventTextDE")
val descriptionDE: String? = null,
@SerializedName("AnchorVenue")
val location: String? = null,
@SerializedName("Display5")
val eventOrganizer: String? = null,
@SerializedName("CompanyName")
val eventOrganizerFallback: String? = null,
@SerializedName("StartDate")
val startDate: Date,
@SerializedName("EndDate")
val endDate: Date,
@SerializedName("TechnologyFields")
val technologyFields: List<String>? = null,
@SerializedName("ImageGallery")
val imageGallery: List<ImageGallery>? = null,
@SerializedName("AnchorVenueRoomMapping")
val roomName: String? = null,
@SerializedName("WebAddress")
val webAddress: String? = null
) {
data class ImageGallery(
@SerializedName("ImageUrl")
val imageUrl: String? = null
)
}
}
)

@Keep
@Parcelize
data class Event(
@SerializedName("Id")
val eventId: String? = null,
@SerializedName("EventDescription")
val name: String? = null,
@SerializedName("EventDescriptionEN")
val nameEN: String? = null,
@SerializedName("EventDescriptionIT")
val nameIT: String? = null,
@SerializedName("EventDescriptionDE")
val nameDE: String? = null,
@SerializedName("EventTextEN")
val descriptionEN: String? = null,
@SerializedName("EventTextIT")
val descriptionIT: String? = null,
@SerializedName("EventTextDE")
val descriptionDE: String? = null,
@SerializedName("AnchorVenue")
val location: String? = null,
@SerializedName("Display5")
val eventOrganizer: String? = null,
@SerializedName("CompanyName")
val eventOrganizerFallback: String? = null,
@SerializedName("StartDate")
val startDate: Date,
@SerializedName("EndDate")
val endDate: Date,
@SerializedName("TechnologyFields")
val technologyFields: List<String>? = null,
@SerializedName("ImageGallery")
val imageGallery: List<ImageGallery>? = null,
@SerializedName("AnchorVenueRoomMapping")
val roomName: String? = null,
@SerializedName("WebAddress")
val webAddress: String? = null
) : Parcelable {
@Keep
@Parcelize
data class ImageGallery(
@SerializedName("ImageUrl")
val imageUrl: String? = null
) : Parcelable
}
2 changes: 1 addition & 1 deletion app/src/main/java/it/bz/noi/community/ui/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class MainViewModel(
/**
* mediator live data that emits the events to the observers
*/
val mediatorEvents = MediatorLiveData<Resource<List<EventsResponse.Event>>>()
val mediatorEvents = MediatorLiveData<Resource<List<Event>>>()

init {
mediatorEvents.addSource(events) {
Expand Down
Loading

0 comments on commit 9281e9e

Please sign in to comment.