diff --git a/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/components/shorts/ShortList.kt b/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/components/shorts/ShortList.kt index 1605e697..47c5a1fd 100644 --- a/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/components/shorts/ShortList.kt +++ b/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/components/shorts/ShortList.kt @@ -255,7 +255,6 @@ fun ShortItem( } } - // Video Interaction Buttons Column( modifier = Modifier .padding(top = 140.dp) @@ -721,7 +720,6 @@ fun ShortItem( tonalElevation = 8.dp, scrimColor = Color.Transparent, dragHandle = null, - //windowInsets = BottomSheetDefaults.windowInsets, ) { Column( modifier = Modifier.fillMaxWidth() @@ -901,7 +899,7 @@ fun ShortItem( fontSize = MaterialTheme.typography.bodyLarge.fontSize, modifier = Modifier.fillMaxWidth().padding( horizontal = 16.dp, vertical = 8.dp - ), // Adjust padding as needed + ), maxLines = 1, textAlign = TextAlign.Justify, overflow = TextOverflow.Ellipsis, diff --git a/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/screens/channel_detail/ChannelDetail.kt b/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/screens/channel_detail/ChannelDetail.kt index 3c92e1aa..c17bca9b 100644 --- a/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/screens/channel_detail/ChannelDetail.kt +++ b/composeApp/src/commonMain/kotlin/org/company/app/presentation/ui/screens/channel_detail/ChannelDetail.kt @@ -96,7 +96,7 @@ class ChannelDetail( } Spacer(modifier = Modifier.height(16.dp)) - //Description + Text( text = "Description", fontSize = MaterialTheme.typography.titleMedium.fontSize, @@ -120,7 +120,7 @@ class ChannelDetail( Spacer(modifier = Modifier.height(16.dp)) - //Links + Text( text = "Links", fontSize = MaterialTheme.typography.titleMedium.fontSize, @@ -148,7 +148,7 @@ class ChannelDetail( text = "Follow", fontSize = MaterialTheme.typography.titleSmall.fontSize, ) - // Use regular expressions to find social links + val socialLinks = Regex("(?i)\\b(?:twitter|instagram|facebook|linkedin|youtube)\\b[\\w/@]+") .findAll(description.toString()) @@ -167,7 +167,6 @@ class ChannelDetail( } Spacer(modifier = Modifier.height(16.dp)) - //Links Text( text = "Categories", fontSize = MaterialTheme.typography.titleMedium.fontSize, @@ -204,7 +203,7 @@ class ChannelDetail( } Spacer(modifier = Modifier.height(16.dp)) - //More Info + Text( text = "More info", fontSize = MaterialTheme.typography.titleMedium.fontSize, @@ -218,7 +217,6 @@ class ChannelDetail( Spacer(modifier = Modifier.height(8.dp)) - // Channel Link Row( modifier = Modifier.fillMaxWidth() .padding(start = 12.dp), @@ -242,7 +240,6 @@ class ChannelDetail( Spacer(modifier = Modifier.height(6.dp)) } - // Country Row( modifier = Modifier.fillMaxWidth() .padding(start = 12.dp), @@ -259,7 +256,6 @@ class ChannelDetail( Spacer(modifier = Modifier.height(6.dp)) } - // View Info Row( modifier = Modifier.fillMaxWidth() .padding(start = 12.dp), @@ -276,7 +272,7 @@ class ChannelDetail( } Spacer(modifier = Modifier.height(16.dp)) - //More Info + Text( text = "Verification", fontSize = MaterialTheme.typography.titleMedium.fontSize, @@ -288,7 +284,7 @@ class ChannelDetail( overflow = TextOverflow.Ellipsis ) Spacer(modifier = Modifier.height(8.dp)) - // Verification + Row( modifier = Modifier.fillMaxWidth() .padding(start = 12.dp), diff --git a/composeApp/src/commonMain/kotlin/org/company/app/presentation/viewmodel/MainViewModel.kt b/composeApp/src/commonMain/kotlin/org/company/app/presentation/viewmodel/MainViewModel.kt index e4cac5e5..7dfc1b66 100644 --- a/composeApp/src/commonMain/kotlin/org/company/app/presentation/viewmodel/MainViewModel.kt +++ b/composeApp/src/commonMain/kotlin/org/company/app/presentation/viewmodel/MainViewModel.kt @@ -48,8 +48,8 @@ class MainViewModel( private val _channelBranding = MutableStateFlow(ResultState.LOADING) val channelBranding: StateFlow = _channelBranding.asStateFlow() - private val _relevance_videos = MutableStateFlow(ResultState.LOADING) - val relevanceVideos: StateFlow = _relevance_videos.asStateFlow() + private val _relevanceVideos = MutableStateFlow(ResultState.LOADING) + val relevanceVideos: StateFlow = _relevanceVideos.asStateFlow() private val _search = MutableStateFlow(ResultState.LOADING) val search: StateFlow = _search.asStateFlow() @@ -187,13 +187,13 @@ class MainViewModel( fun getRelevanceVideos() { viewModelScope.launch { - _relevance_videos.value = ResultState.LOADING + _relevanceVideos.value = ResultState.LOADING try { val response = repository.getRelevanceVideos() - _relevance_videos.value = ResultState.SUCCESS(response) + _relevanceVideos.value = ResultState.SUCCESS(response) } catch (e: Exception) { val error = e.message.toString() - _relevance_videos.value = ResultState.ERROR(error) + _relevanceVideos.value = ResultState.ERROR(error) } } @@ -402,7 +402,7 @@ class MainViewModel( try { val exitingVideo = database.youtubeEntityQueries.getVideoByTitle(title).executeAsOneOrNull() - if (exitingVideo == null || exitingVideo.id == null && !exitingVideo.title.contains( + if (exitingVideo == null || exitingVideo.id.toString().isBlank() && !exitingVideo.title.contains( title ) ) {