Skip to content

ALTAPPS-1282: Shared, iOS comments section #1097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ object StepDelegate {
is StepFeature.Action.ViewAction.StepToolbarViewAction -> {
// no op
}
is StepFeature.Action.ViewAction.NavigateTo.CommentsScreen -> {
// TODO: ALTAPPS-1283 Implement navigation to comments screen
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.hyperskill.app.core.view.mapper.ResourceProvider
import org.hyperskill.app.core.view.mapper.date.SharedDateFormatter
import org.hyperskill.app.step.domain.model.Step
import org.hyperskill.app.step.domain.model.StepRoute
import org.hyperskill.app.step.view.mapper.CommentThreadTitleMapper
import org.hyperskill.app.step_completion.presentation.StepCompletionFeature
import ru.nobird.android.view.base.ui.extension.argument

Expand All @@ -45,7 +44,6 @@ class StepTheoryFragment :

private lateinit var resourceProvider: ResourceProvider
private lateinit var dateFormatter: SharedDateFormatter
private lateinit var commentThreadTitleMapper: CommentThreadTitleMapper

private val viewBinding: FragmentStepTheoryBinding by viewBinding(FragmentStepTheoryBinding::bind)

Expand All @@ -59,10 +57,8 @@ class StepTheoryFragment :
}

private fun injectComponent() {
val stepComponent = HyperskillApp.graph().buildStepComponent(stepRoute)
resourceProvider = HyperskillApp.graph().commonComponent.resourceProvider
dateFormatter = HyperskillApp.graph().commonComponent.dateFormatter
commentThreadTitleMapper = stepComponent.commentThreadTitleMapper
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down
12 changes: 3 additions & 9 deletions config/detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<ID>ComposableParamOrder:FindStage.kt$FindStage</ID>
<ID>ComposableParamOrder:FindStep.kt$FindStep</ID>
<ID>ComposableParamOrder:LinearProgressIndicator.kt$LinearProgressIndicator</ID>
<ID>ComposableParamOrder:NotificationsOnboardingScreen.kt$NotificationsOnboardingButtons</ID>
<ID>ComposableParamOrder:ServerSwitcher.kt$EndpointSwitcher</ID>
<ID>CyclomaticComplexMethod:AuthCredentialsReducer.kt$AuthCredentialsReducer$override fun reduce(state: State, message: Message): Pair&lt;State, Set&lt;Action&gt;&gt;</ID>
<ID>CyclomaticComplexMethod:DebugReducer.kt$DebugReducer$override fun reduce(state: State, message: Message): Pair&lt;State, Set&lt;Action&gt;&gt;</ID>
Expand Down Expand Up @@ -125,7 +124,6 @@
<ID>MagicNumber:NotificationCacheDataSourceImpl.kt$NotificationCacheDataSourceImpl$7</ID>
<ID>MagicNumber:NotificationCacheDataSourceImpl.kt$NotificationCacheDataSourceImpl$8</ID>
<ID>MagicNumber:NotificationCacheDataSourceImpl.kt$NotificationCacheDataSourceImpl$9</ID>
<ID>MagicNumber:NotificationsOnboardingScreen.kt$0.5f</ID>
<ID>MagicNumber:NotificationsOnboardingViewStateMapper.kt$NotificationsOnboardingViewStateMapper$10</ID>
<ID>MagicNumber:NumbersFormatter.kt$NumbersFormatter.Companion$2</ID>
<ID>MagicNumber:PercentProgressIndicator.kt$0xFF5D72E9</ID>
Expand Down Expand Up @@ -170,8 +168,6 @@
<ID>MatchingDeclarationName:FindStage.kt$FindStageInput</ID>
<ID>MatchingDeclarationName:HyperskillButton.kt$HyperskillButtonDefaults</ID>
<ID>MatchingDeclarationName:LeaderboardItem.kt$LeaderboardItemDefaults</ID>
<ID>MatchingDeclarationName:NotificationsOnboardingScreen.kt$NotificationsOnboardingDefaults</ID>
<ID>MatchingDeclarationName:PaywallScreen.kt$PaywallDefaults</ID>
<ID>MaxLineLength:ChallengeCardPreviewValues.kt$ChallengeCardPreviewValues$const</ID>
<ID>MaxLineLength:ExpandableTextView.kt$ExpandableTextView$*</ID>
<ID>MaxLineLength:HtmlText.kt$text</ID>
Expand All @@ -192,16 +188,12 @@
<ID>ModifierMissing:FirstProblemOnboardingUI.kt$FirstProblemOnboardingScreen</ID>
<ID>ModifierMissing:LeaderboardTabs.kt$LeaderboardTabs</ID>
<ID>ModifierMissing:ManageSubscriptionScreen.kt$ManageSubscriptionScreen</ID>
<ID>ModifierMissing:NotificationsOnboardingScreen.kt$NotificationsOnboardingScreen</ID>
<ID>ModifierMissing:PaywallScreen.kt$PaywallScreen</ID>
<ID>ModifierMissing:ProgressScreen.kt$ProgressScreen</ID>
<ID>ModifierMissing:RequestReviewDialog.kt$RequestReviewDialog</ID>
<ID>ModifierNotUsedAtRoot:LeaderboardPlaceInfo.kt$modifier = modifier .requiredSize(24.dp) .align(Alignment.CenterVertically)</ID>
<ID>ModifierNotUsedAtRoot:NotificationsOnboardingScreen.kt$modifier.align(Alignment.Center)</ID>
<ID>ModifierReused:LeaderboardPlaceInfo.kt$Image( painter = painterResource( id = when (placeNumber) { 1 -&gt; org.hyperskill.app.android.R.drawable.ic_leaderboard_first_place 2 -&gt; org.hyperskill.app.android.R.drawable.ic_leaderboard_second_place 3 -&gt; org.hyperskill.app.android.R.drawable.ic_leaderboard_third_place else -&gt; error("Place icon should not be visible for the place number $placeNumber") } ), contentDescription = null, modifier = modifier .requiredSize(24.dp) .align(Alignment.CenterVertically) )</ID>
<ID>ModifierReused:LeaderboardPlaceInfo.kt$Row( modifier = modifier, horizontalArrangement = Arrangement.SpaceBetween ) { Text( text = placeNumber.toString(), style = MaterialTheme.typography.body2, color = colorResource(id = R.color.color_on_surface_alpha_60), modifier = Modifier.align(Alignment.CenterVertically) ) if (placeNumber in 1..3) { Image( painter = painterResource( id = when (placeNumber) { 1 -&gt; org.hyperskill.app.android.R.drawable.ic_leaderboard_first_place 2 -&gt; org.hyperskill.app.android.R.drawable.ic_leaderboard_second_place 3 -&gt; org.hyperskill.app.android.R.drawable.ic_leaderboard_third_place else -&gt; error("Place icon should not be visible for the place number $placeNumber") } ), contentDescription = null, modifier = modifier .requiredSize(24.dp) .align(Alignment.CenterVertically) ) } }</ID>
<ID>ModifierReused:NotificationsOnboardingScreen.kt$Box( modifier = modifier .clip(RoundedCornerShape(dimensionResource(id = org.hyperskill.app.android.R.dimen.corner_radius))) ) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Center, modifier = Modifier .clickable( interactionSource = remember { MutableInteractionSource() }, indication = rememberRipple(), onClick = onTimeClick ) .padding(vertical = 4.dp, horizontal = 8.dp) ) { Text(text = stringResource(id = R.string.notifications_onboarding_daily_study_reminders_interval_prefix)) Spacer(modifier = Modifier.width(8.dp)) Text(text = formattedInterval) Spacer(modifier = Modifier.width(4.dp)) Box(modifier = Modifier.size(24.dp)) { Image( painter = painterResource( id = org.hyperskill.app.android.R.drawable.ic_notification_onboarding_arrow ), contentDescription = null, modifier.align(Alignment.Center) ) } } }</ID>
<ID>ModifierReused:NotificationsOnboardingScreen.kt$Image( painter = painterResource( id = org.hyperskill.app.android.R.drawable.ic_notification_onboarding_arrow ), contentDescription = null, modifier.align(Alignment.Center) )</ID>
<ID>ModifierWithoutDefault:BadgeImage.kt$modifier</ID>
<ID>NestedBlockDepth:AuthSocialWebViewClient.kt$AuthSocialWebViewClient$override fun shouldOverrideUrlLoading( view: WebView?, request: WebResourceRequest? ): Boolean</ID>
<ID>NestedBlockDepth:StepQuizReducer.kt$StepQuizReducer$private fun handleFetchAttemptSuccess( state: State, message: InternalMessage.FetchAttemptSuccess ): StepQuizReducerResult</ID>
Expand Down Expand Up @@ -236,6 +228,8 @@
<ID>PrintStackTrace:LatexWebView.kt$LatexWebView$e</ID>
<ID>ReturnCount:ChallengeWidgetReducer.kt$ChallengeWidgetReducer$private fun handleStepSolvedMessage(state: State): ChallengeWidgetReducerResult?</ID>
<ID>ReturnCount:ChallengeWidgetViewStateMapper.kt$ChallengeWidgetViewStateMapper$private fun getLoadedWidgetContent(state: ChallengeWidgetFeature.State.Content): ChallengeWidgetViewState</ID>
<ID>ReturnCount:CommentsScreenReducer.kt$CommentsScreenReducer$private fun handleReactionClicked( state: State, message: Message.ReactionClicked ): CommentsScreenReducerResult?</ID>
<ID>ReturnCount:CommentsScreenReducer.kt$CommentsScreenReducer$private fun handleShowDiscussionRepliesClicked( state: State, message: Message.ShowDiscussionRepliesClicked ): CommentsScreenReducerResult?</ID>
<ID>ReturnCount:ExpandableTextView.kt$ExpandableTextView$private fun resolveDisplayedText(staticLayout: StaticLayout): CharSequence?</ID>
<ID>ReturnCount:FillBlanksItemMapper.kt$FillBlanksItemMapper$internal fun map( componentsDataset: List&lt;Component&gt;, replyBlanks: List&lt;String&gt;? ): FillBlanksData?</ID>
<ID>ReturnCount:MainNotificationClickHandlingActionDispatcher.kt$MainNotificationClickHandlingActionDispatcher$override suspend fun doSuspendableAction(action: Action)</ID>
Expand Down Expand Up @@ -302,13 +296,13 @@
<ID>UnusedParameter:DebugToolsHelper.kt$DebugToolsHelper$app: Application</ID>
<ID>UnusedPrivateMember:StepQuizResolverTest.kt$StepQuizResolverTest$@Suppress("UNUSED_EXPRESSION") private fun marker( stepRoute: StepRoute, stepQuizState: StepQuizFeature.StepQuizState )</ID>
<ID>UnusedPrivateProperty:MainActivity.kt$MainActivity$val splashScreen = installSplashScreen()</ID>
<ID>UnusedPrivateProperty:TrackSelectionDetailsFragment.kt$TrackSelectionDetailsFragment$private val mainScreenRouter: MainScreenRouter by lazy(LazyThreadSafetyMode.NONE) { HyperskillApp.graph().navigationComponent.mainScreenCicerone.router }</ID>
<ID>UseCheckOrError:AndroidStepQuizTest.kt$AndroidStepQuizTest$throw IllegalStateException( "Unknown step route class: $concreteStepRouteClass. Please add it to the test." )</ID>
<ID>UseCheckOrError:CollectionToJsonElement.kt$throw IllegalStateException("Can't serialize unknown type: $this")</ID>
<ID>UseCheckOrError:ContextExtensions.kt$throw IllegalStateException("Can't find Activity in a given context")</ID>
<ID>UseCheckOrError:FragmentSerializableArgumentDelegate.kt$BundleDelegate$throw IllegalStateException("Property ${property.name} could not be read")</ID>
<ID>UseCheckOrError:FragmentSerializableArgumentDelegate.kt$FragmentSerializableArgumentDelegate$throw IllegalStateException("Cannot read property ${property.name} if no arguments have been set")</ID>
<ID>UseCheckOrError:LoadingView.kt$LoadingView$throw IllegalStateException("Visibility should be one of VISIBLE, INVISIBLE, GONE")</ID>
<ID>UseCheckOrError:MainStepQuizHintsActionDispatcher.kt$MainStepQuizHintsActionDispatcher$throw IllegalStateException("Unknown reaction type: $action.reaction")</ID>
<ID>UseCheckOrError:RepositoryCacheProxyTest.kt$RepositoryCacheProxyTest.&lt;no name provided&gt;$throw IllegalStateException("cache.clearCache should not be called")</ID>
<ID>UseCheckOrError:RequestReviewModalViewStateMapper.kt$RequestReviewModalViewStateMapper$throw IllegalStateException("State.Negative shouldn't be mapped to ViewState")</ID>
<ID>ViewModelForwarding:ManageSubscriptionScreen.kt$OnComposableShownFirstTime(viewModel) { viewModel.onNewMessage(Message.ViewedEventMessage) }</ID>
Expand Down
2 changes: 2 additions & 0 deletions iosHyperskillApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ source "https://cdn.cocoapods.org/"
inhibit_all_warnings!
use_frameworks!

ENV["SWIFT_VERSION"] = "5"

target "iosHyperskillApp" do
platform :ios, "14.0"

Expand Down
2 changes: 1 addition & 1 deletion iosHyperskillApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,6 @@ SPEC CHECKSUMS:
SVProgressHUD: 4837c74bdfe2e51e8821c397825996a8d7de6e22
SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211

PODFILE CHECKSUM: 6b40c324341c8820013d46ff08bfa629d54b84c9
PODFILE CHECKSUM: 9392d71b37a5fe79e30faedcb4e232aa00f3bc67

COCOAPODS: 1.15.2
Loading
Loading