Skip to content

Commit

Permalink
change navigation (replace HomeScreen with StudyPlan) & remove home m…
Browse files Browse the repository at this point in the history
…entions from strings
  • Loading branch information
vladkash committed Oct 11, 2023
1 parent 9968764 commit 47b066b
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ class TopicPracticeCompletedBottomSheet : BottomSheetDialogFragment() {
completedDailyStepGoBackButton.isVisible = isNextStepAvailable
completedDailyStepGoBackButton.setOnClickListener {
dismiss()
onNewMessage(StepCompletionFeature.Message.TopicCompletedModalGoToHomeScreenClicked)
onNewMessage(StepCompletionFeature.Message.TopicCompletedModalGoToStudyPlanClicked)
}

completedDailyStepPrimaryButton.setText(
if (isNextStepAvailable) {
org.hyperskill.app.R.string.step_quiz_topic_completed_continue_with_next_topic_button_text
} else {
org.hyperskill.app.R.string.go_to_homescreen
org.hyperskill.app.R.string.go_to_study_plan
}
)
completedDailyStepPrimaryButton.setOnClickListener {
Expand All @@ -94,7 +94,7 @@ class TopicPracticeCompletedBottomSheet : BottomSheetDialogFragment() {
if (isNextStepAvailable) {
StepCompletionFeature.Message.TopicCompletedModalContinueNextTopicClicked
} else {
StepCompletionFeature.Message.TopicCompletedModalGoToHomeScreenClicked
StepCompletionFeature.Message.TopicCompletedModalGoToStudyPlanClicked
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/action_button_height"
style="@style/ThemeOverlay.Blue"
android:text="@string/go_to_homescreen"
android:text="@string/go_to_training"
android:layout_marginTop="32dp"
android:layout_marginHorizontal="20dp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/action_button_height"
app:strokeColor="@color/color_primary_alpha_38"
android:text="@string/go_to_homescreen"
android:text="@string/go_to_training"
android:layout_marginTop="32dp"
android:layout_marginHorizontal="20dp"
app:layout_constraintTop_toBottomOf="@+id/problemsLimitReachedDescription"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
android:layout_height="@dimen/action_button_height"
style="@style/Widget.AppTheme.Button.OutlinedButton"
app:strokeColor="?colorPrimary"
android:text="@string/go_to_homescreen"
android:text="@string/go_to_study_plan"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="20dp"
app:layout_goneMarginBottom="20dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
android:id="@+id/unsupportedStageTitleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/unsupported_stage_dialog_title"
android:text="@string/stage_implement_unsupported_modal_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:fontFamily="@font/roboto_bold"
android:textSize="34sp"
Expand All @@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:textSize="16sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/unsupported_stage_dialog_description"
android:text="@string/stage_implement_unsupported_modal_description"
android:layout_marginTop="20dp"
app:layout_constraintTop_toBottomOf="@+id/unsupportedStageTitleTextView"
/>
Expand All @@ -58,7 +58,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/action_button_height"
style="@style/ThemeOverlay.Blue"
android:text="@string/go_to_homescreen"
android:text="@string/go_to_training"
android:layout_marginTop="32dp"
app:layout_constraintTop_toBottomOf="@+id/unsupportedStageDescriptionTextView"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ interface AppFeature {

sealed interface ViewAction : Action {
sealed interface NavigateTo : ViewAction {
object HomeScreen : NavigateTo
data class AuthScreen(val isInSignUpMode: Boolean = false) : NavigateTo
object TrackSelectionScreen : NavigateTo
object OnboardingScreen : NavigateTo

object NotificationOnBoardingScreen : NavigateTo

data class FirstProblemOnBoardingScreen(val isNewUserMode: Boolean) : NavigateTo
data class HomeScreenWithStep(val stepRoute: StepRoute) : NavigateTo
data class StudyPlanWithStep(val stepRoute: StepRoute) : NavigateTo
object StudyPlan : NavigateTo
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class AppReducer(
message.profile.isNewUser ->
add(Action.ViewAction.NavigateTo.TrackSelectionScreen)
else ->
add(Action.ViewAction.NavigateTo.HomeScreen)
add(Action.ViewAction.NavigateTo.StudyPlan)
}
addAll(getOnAuthorizedAppStartUpActions(message.profile.id, platformType))
} else {
Expand Down Expand Up @@ -178,7 +178,7 @@ class AppReducer(
if (!message.wasFirstProblemOnboardingShown) {
Action.ViewAction.NavigateTo.FirstProblemOnBoardingScreen(isNewUserMode = false)
} else {
Action.ViewAction.NavigateTo.HomeScreen
Action.ViewAction.NavigateTo.StudyPlan
}
)
} else {
Expand All @@ -192,7 +192,7 @@ class AppReducer(
if (state is State.Ready) {
state to setOf(
message.firstProblemStepRoute?.let { stepRoute ->
Action.ViewAction.NavigateTo.HomeScreenWithStep(stepRoute)
Action.ViewAction.NavigateTo.StudyPlanWithStep(stepRoute)
} ?: Action.ViewAction.NavigateTo.StudyPlan
)
} else {
Expand All @@ -215,7 +215,7 @@ class AppReducer(
if (profile.isNewUser) {
Action.ViewAction.NavigateTo.TrackSelectionScreen
} else {
Action.ViewAction.NavigateTo.HomeScreen
Action.ViewAction.NavigateTo.StudyPlan
}

private fun reduceStreakRecoveryMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ object NotificationClickHandlingFeature {
sealed interface NavigateTo : ViewAction {
object TopicRepetition : NavigateTo

object Home : NavigateTo

object Profile : NavigateTo

object StudyPlan : NavigateTo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class NotificationClickHandlingReducer : StateReducer<State, Message, Action> {
}

PushNotificationType.UNKNOWN ->
setOf(Action.ViewAction.NavigateTo.Home)
setOf(Action.ViewAction.NavigateTo.StudyPlan)
}

return actions + analyticsAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ interface ProfileFeature {
}

sealed interface NavigateTo : ViewAction {
object HomeScreen : NavigateTo
object StudyPlan : NavigateTo
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ProfileReducer : StateReducer<State, Message, Action> {
)
),
Action.ViewAction.HideStreakFreezeModal,
Action.ViewAction.NavigateTo.HomeScreen
Action.ViewAction.NavigateTo.StudyPlan
)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ import org.hyperskill.app.analytic.domain.model.hyperskill.HyperskillAnalyticRou
import org.hyperskill.app.analytic.domain.model.hyperskill.HyperskillAnalyticTarget

/**
* Represents click on the "Go to homescreen" button analytic event.
* Represents click on the "Go to study plan" button analytic event.
*
* JSON payload:
* ```
* {
* "route": "/learn/step/1",
* "action": "click",
* "part": "topic_completed_modal",
* "target": "go_to_home_screen"
* "target": "go_to_study_plan"
* }
* ```
* @see HyperskillAnalyticEvent
*/
class StepCompletionTopicCompletedModalClickedGoToHomeScreenHyperskillAnalyticEvent(
class StepCompletionTopicCompletedModalClickedGoToStudyPlanHyperskillAnalyticEvent(
route: HyperskillAnalyticRoute
) : HyperskillAnalyticEvent(
route,
HyperskillAnalyticAction.CLICK,
HyperskillAnalyticPart.TOPIC_COMPLETED_MODAL,
HyperskillAnalyticTarget.GO_TO_HOME_SCREEN
HyperskillAnalyticTarget.GO_TO_STUDY_PLAN
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface StepCompletionFeature {
}

sealed interface ContinueButtonAction {
object NavigateToHomeScreen : ContinueButtonAction
object NavigateToStudyPlan : ContinueButtonAction
object NavigateToBack : ContinueButtonAction
object FetchNextStepQuiz : ContinueButtonAction
object CheckTopicCompletion : ContinueButtonAction
Expand All @@ -68,7 +68,7 @@ interface StepCompletionFeature {
object Error : CheckTopicCompletionStatus
}

object TopicCompletedModalGoToHomeScreenClicked : Message
object TopicCompletedModalGoToStudyPlanClicked : Message
object TopicCompletedModalContinueNextTopicClicked : Message

sealed interface FetchNextRecommendedStepResult : Message {
Expand Down Expand Up @@ -122,7 +122,7 @@ interface StepCompletionFeature {

sealed interface NavigateTo : ViewAction {
object Back : NavigateTo
object HomeScreen : NavigateTo
object StudyPlan : NavigateTo
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.hyperskill.app.step_completion.domain.analytic.StepCompletionDailySte
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionHiddenDailyNotificationsNoticeHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionShownDailyNotificationsNoticeHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionTopicCompletedModalClickedContinueNextTopicHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionTopicCompletedModalClickedGoToHomeScreenHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionTopicCompletedModalClickedGoToStudyPlanHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionTopicCompletedModalHiddenHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.domain.analytic.StepCompletionTopicCompletedModalShownHyperskillAnalyticEvent
import org.hyperskill.app.step_completion.presentation.StepCompletionFeature.Action
Expand All @@ -35,14 +35,14 @@ class StepCompletionReducer(private val stepRoute: StepRoute) : StateReducer<Sta
is ContinueButtonAction.CheckTopicCompletion ->
true
ContinueButtonAction.NavigateToBack,
ContinueButtonAction.NavigateToHomeScreen ->
ContinueButtonAction.NavigateToStudyPlan ->
false
}
) to setOf(
Action.LogAnalyticEvent(analyticEvent),
when (state.continueButtonAction) {
ContinueButtonAction.NavigateToBack -> Action.ViewAction.NavigateTo.Back
ContinueButtonAction.NavigateToHomeScreen -> Action.ViewAction.NavigateTo.HomeScreen
ContinueButtonAction.NavigateToStudyPlan -> Action.ViewAction.NavigateTo.StudyPlan
ContinueButtonAction.FetchNextStepQuiz -> Action.FetchNextRecommendedStep(
currentStep = state.currentStep
)
Expand Down Expand Up @@ -81,7 +81,7 @@ class StepCompletionReducer(private val stepRoute: StepRoute) : StateReducer<Sta
is Message.CheckTopicCompletionStatus.Completed -> {
val nextStepRoute = getNextStepRouteForLearningActivity(message.nextLearningActivity)
state.copy(
continueButtonAction = ContinueButtonAction.NavigateToHomeScreen,
continueButtonAction = ContinueButtonAction.NavigateToStudyPlan,
isPracticingLoading = false,
nextStepRoute = nextStepRoute
) to setOf(
Expand All @@ -98,11 +98,11 @@ class StepCompletionReducer(private val stepRoute: StepRoute) : StateReducer<Sta
continueButtonAction = ContinueButtonAction.CheckTopicCompletion,
isPracticingLoading = false
) to emptySet()
is Message.TopicCompletedModalGoToHomeScreenClicked ->
is Message.TopicCompletedModalGoToStudyPlanClicked ->
state to setOf(
Action.ViewAction.NavigateTo.HomeScreen,
Action.ViewAction.NavigateTo.StudyPlan,
Action.LogAnalyticEvent(
StepCompletionTopicCompletedModalClickedGoToHomeScreenHyperskillAnalyticEvent(
StepCompletionTopicCompletedModalClickedGoToStudyPlanHyperskillAnalyticEvent(
route = stepRoute.analyticRoute
)
)
Expand Down
10 changes: 3 additions & 7 deletions shared/src/commonMain/resources/MR/base/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<string name="back">Back</string>
<string name="later">Later</string>
<string name="good_job">Good job!</string>
<string name="go_to_homescreen">Go to home</string>
<string name="go_to_training">Go to training</string>
<string name="go_to_study_plan">Go to study plan</string>
<string name="new_word">New</string>
<string name="progress">Progress</string>
Expand Down Expand Up @@ -168,12 +168,12 @@
<string name="stage_implement_title">Work on project. Stage %d/%d</string>
<string name="stage_implement_unsupported_modal_title">IDE required</string>
<string name="stage_implement_unsupported_modal_description">To proceed, you need an IDE. Please continue learning
on a computer.\n\nIf this is not an option for you right now, check out the available activities on your home
on a computer.\n\nIf this is not an option for you right now, check out the available activities on your training
screen.
</string>

<!-- Tab bar -->
<string name="tab_bar_home_title">Home</string>
<string name="tab_bar_training_title">Training</string>
<string name="tab_bar_track_title">Track</string>
<string name="tab_bar_study_plan_title">Study Plan</string>
<string name="tab_bar_profile_title">Profile</string>
Expand Down Expand Up @@ -398,10 +398,6 @@
<!--Topics widget-->
<string name="topics_widget_learn_next_badge">Learn next</string>

<!--Unsupported stage bottom sheet-->
<string name="unsupported_stage_dialog_title">IDE required</string>
<string name="unsupported_stage_dialog_description">To proceed, you need an IDE. Please continue learning on a computer.\n\n If this is not an option for you right now, check out the available activities on your home screen.</string>

<!-- Problems limit reached modal -->
<string name="problems_limit_reached_modal_title">You\'ve reached your daily limit</string>
<string name="problems_limit_reached_modal_description">You\'ve solved %d problems today. Great job! Tomorrow new problems will be available to you.</string>
Expand Down

0 comments on commit 47b066b

Please sign in to comment.