Skip to content
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

ALTAPPS-1004: iOS rearrange home screen #709

Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -10,15 +10,13 @@ import androidx.lifecycle.ViewModelProvider
import by.kirich1409.viewbindingdelegate.viewBinding
import org.hyperskill.app.android.HyperskillApp
import org.hyperskill.app.android.R
import org.hyperskill.app.android.core.view.ui.dialog.dismissDialogFragmentIfExists
import org.hyperskill.app.android.core.view.ui.navigation.requireRouter
import org.hyperskill.app.android.core.view.ui.setHyperskillColors
import org.hyperskill.app.android.core.view.ui.updateIsRefreshing
import org.hyperskill.app.android.databinding.FragmentHomeBinding
import org.hyperskill.app.android.gamification_toolbar.view.ui.delegate.GamificationToolbarDelegate
import org.hyperskill.app.android.main.view.ui.navigation.MainScreenRouter
import org.hyperskill.app.android.problem_of_day.view.delegate.ProblemOfDayCardFormDelegate
import org.hyperskill.app.android.stage_implementation.view.dialog.UnsupportedStageBottomSheet
import org.hyperskill.app.android.step.view.screen.StepScreen
import org.hyperskill.app.android.topics_repetitions.view.delegate.TopicsRepetitionCardFormDelegate
import org.hyperskill.app.android.topics_repetitions.view.screen.TopicsRepetitionScreen
Expand All @@ -32,8 +30,7 @@ import ru.nobird.app.presentation.redux.container.ReduxView

class HomeFragment :
Fragment(R.layout.fragment_home),
ReduxView<HomeFeature.State, HomeFeature.Action.ViewAction>,
UnsupportedStageBottomSheet.Callback {
ReduxView<HomeFeature.State, HomeFeature.Action.ViewAction> {
companion object {
fun newInstance(): Fragment =
HomeFragment()
Expand Down Expand Up @@ -221,19 +218,4 @@ class HomeFragment :
)
}
}

// UnsupportedStageBottomSheet.Callback methods
override fun onShow() {
homeViewModel.onNewMessage(HomeFeature.Message.StageImplementUnsupportedModalShownEventMessage)
}

override fun onDismiss() {
homeViewModel.onNewMessage(HomeFeature.Message.StageImplementUnsupportedModalHiddenEventMessage)
}

override fun onHomeClick() {
homeViewModel.onNewMessage(HomeFeature.Message.StageImplementUnsupportedModalGoToHomeClicked)
childFragmentManager
.dismissDialogFragmentIfExists(UnsupportedStageBottomSheet.TAG)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.hyperskill.app.android.topics_repetitions.view.delegate

import android.content.Context
import androidx.core.view.isVisible
import org.hyperskill.app.android.R
import org.hyperskill.app.android.databinding.LayoutTopicsRepetitionHeaderBinding
import org.hyperskill.app.topics_repetitions.presentation.TopicsRepetitionsFeature
import org.hyperskill.app.topics_repetitions.view.model.RepetitionsStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import androidx.core.content.ContextCompat
import org.hyperskill.app.android.R
import ru.nobird.android.view.base.ui.extension.Dp
import ru.nobird.android.view.base.ui.extension.toPx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.hyperskill.app.android.view.base.ui.extension
import android.content.Context
import androidx.annotation.ColorInt
import androidx.annotation.Dimension
import org.hyperskill.app.android.R
import ru.nobird.android.view.base.ui.extension.resolveColorAttribute

object ColorExtensions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.hyperskill.app.android.view.base.ui.extension

import java.util.ArrayList

object TimeIntervalUtil {
val values: Array<String>

Expand Down
24 changes: 0 additions & 24 deletions iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,6 @@
E9B55A5529C8A03E0066900E /* ProblemsLimitFeatureViewStateKsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9B55A5429C8A03E0066900E /* ProblemsLimitFeatureViewStateKsExtensions.swift */; };
E9B55A5929C8A0760066900E /* ProblemsLimitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9B55A5829C8A0760066900E /* ProblemsLimitView.swift */; };
E9B55A5D29C978E40066900E /* ProblemsLimitReachedModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9B55A5C29C978E40066900E /* ProblemsLimitReachedModalViewController.swift */; };
E9B642012A6BCC16001A9653 /* NextLearningActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9B642002A6BCC16001A9653 /* NextLearningActivityView.swift */; };
E9B642032A6BDC8E001A9653 /* NextLearningActivitySkeletonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9B642022A6BDC8E001A9653 /* NextLearningActivitySkeletonView.swift */; };
E9BDB4052A7BE1E30069EF98 /* BadgeImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9BDB4042A7BE1E30069EF98 /* BadgeImageView.swift */; };
E9C3506D2886B0FE0080D277 /* MainBundleInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C3506C2886B0FE0080D277 /* MainBundleInfo.swift */; };
E9C3506F2886D0600080D277 /* OpenURLInsideAppButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C3506E2886D0600080D277 /* OpenURLInsideAppButton.swift */; };
Expand Down Expand Up @@ -1136,8 +1134,6 @@
E9B55A5429C8A03E0066900E /* ProblemsLimitFeatureViewStateKsExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProblemsLimitFeatureViewStateKsExtensions.swift; sourceTree = "<group>"; };
E9B55A5829C8A0760066900E /* ProblemsLimitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProblemsLimitView.swift; sourceTree = "<group>"; };
E9B55A5C29C978E40066900E /* ProblemsLimitReachedModalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProblemsLimitReachedModalViewController.swift; sourceTree = "<group>"; };
E9B642002A6BCC16001A9653 /* NextLearningActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NextLearningActivityView.swift; sourceTree = "<group>"; };
E9B642022A6BDC8E001A9653 /* NextLearningActivitySkeletonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NextLearningActivitySkeletonView.swift; sourceTree = "<group>"; };
E9BDB4042A7BE1E30069EF98 /* BadgeImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeImageView.swift; sourceTree = "<group>"; };
E9C3506C2886B0FE0080D277 /* MainBundleInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainBundleInfo.swift; sourceTree = "<group>"; };
E9C3506E2886D0600080D277 /* OpenURLInsideAppButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenURLInsideAppButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1477,7 +1473,6 @@
E9A1DA642ACFF10D006A9D4B /* FirstProblemOnboarding */,
2C5F4A582971C6C500677530 /* GamificationToolbar */,
2C963BC32812D16C0036DD53 /* Home */,
E9B641FE2A6BCBCA001A9653 /* NextLearningActivity */,
B58361EACE24BF4B761F10BA /* NotificationsOnboarding */,
E9F923F428A2632800C065A7 /* Onboarding */,
E9F655CF2875B31B00291143 /* ProblemOfDay */,
Expand Down Expand Up @@ -3453,23 +3448,6 @@
path = Modals;
sourceTree = "<group>";
};
E9B641FE2A6BCBCA001A9653 /* NextLearningActivity */ = {
isa = PBXGroup;
children = (
E9B641FF2A6BCC03001A9653 /* Views */,
);
path = NextLearningActivity;
sourceTree = "<group>";
};
E9B641FF2A6BCC03001A9653 /* Views */ = {
isa = PBXGroup;
children = (
E9B642022A6BDC8E001A9653 /* NextLearningActivitySkeletonView.swift */,
E9B642002A6BCC16001A9653 /* NextLearningActivityView.swift */,
);
path = Views;
sourceTree = "<group>";
};
E9CC6C0529893EFC00D8D070 /* InputOutput */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -4220,7 +4198,6 @@
2C1F5870280D0CB700372A37 /* WebCacheCleaner.swift in Sources */,
E9D2D673284E0A97000757AC /* StepQuizMatchingItemView.swift in Sources */,
E94BB04E2A9E034700736B7C /* StepQuizParsonsAssembly.swift in Sources */,
E9B642012A6BCC16001A9653 /* NextLearningActivityView.swift in Sources */,
2C9E5E8429B2156D003AEC16 /* StageImplementAssembly.swift in Sources */,
2C2ECCA5288C0661008DDCBA /* StepQuizRetryButton.swift in Sources */,
2C336A082A4D38F300A01F26 /* ProgressScreenTrackProgressContentView.swift in Sources */,
Expand Down Expand Up @@ -4356,7 +4333,6 @@
2CD3652C287987FA00D61855 /* ProfileSocialAccount.swift in Sources */,
E90DF95929AE288600EC40DA /* StageImplementUnsupportedModalViewController.swift in Sources */,
E9F655CA2875914200291143 /* StreakCardView.swift in Sources */,
E9B642032A6BDC8E001A9653 /* NextLearningActivitySkeletonView.swift in Sources */,
2C9ECBA3284736090015CFD2 /* StepViewDataMapper.swift in Sources */,
2CAE8CF2280525C900E6C83D /* StepView.swift in Sources */,
2C023C8B285DCA2100D2D5A9 /* ReplyExtensions.swift in Sources */,
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@ extension Images {

static let down = "chevron.down"
}

enum Hammer {
static let hammerCircle = "hammer.circle"

static let hammerCircleFill = "hammer.circle.fill"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ enum Images {
static let skip = "skip"
}

// MARK: - TabBar -

enum TabBar {
static let home = "tab-bar-home"
static let homeFilled = "tab-bar-home-filled"

static let studyPlan = "tab-bar-study-plan"
static let studyPlanFilled = "tab-bar-study-plan-filled"

static let profile = "tab-bar-profile"
static let profileFilled = "tab-bar-profile-filled"
}

// MARK: - NavigationBar -

enum NavigationBar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ enum Strings {
// MARK: - TabBar -

enum TabBar {
static let home = sharedStrings.tab_bar_home_title.localized()
static let home = sharedStrings.tab_bar_training_title.localized()
static let studyPlan = sharedStrings.tab_bar_study_plan_title.localized()
static let profile = sharedStrings.tab_bar_profile_title.localized()
static let debug = sharedStrings.tab_bar_debug_title.localized()
Expand Down Expand Up @@ -229,8 +229,6 @@ enum Strings {
static let title = sharedStrings.home_title.localized()
static let keepPracticing = sharedStrings.home_keep_practicing_text.localized()

static let nextLearningActivityTitle = sharedStrings.home_next_learning_activity_title.localized()

static let solveUnlimited = sharedStrings.home_solve_unlimited.localized()
static let repeatUnlimited = sharedStrings.home_repeat_unlimited.localized()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ private extension AppViewModel {

notificationCenter.addObserver(
self,
selector: #selector(handleProjectSelectionDetailsDidRequestNavigateToHomeAsNewRootScreen),
name: .projectSelectionDetailsDidRequestNavigateToHomeAsNewRootScreen,
selector: #selector(handleProjectSelectionDetailsDidRequestNavigateToStudyPlanAsNewRootScreen),
name: .projectSelectionDetailsDidRequestNavigateToStudyPlanAsNewRootScreen,
object: nil
)

Expand All @@ -187,8 +187,8 @@ private extension AppViewModel {
}

@objc
func handleProjectSelectionDetailsDidRequestNavigateToHomeAsNewRootScreen() {
onViewAction?(AppFeatureActionViewActionNavigateToHomeScreen())
func handleProjectSelectionDetailsDidRequestNavigateToStudyPlanAsNewRootScreen() {
onViewAction?(AppFeatureActionViewActionNavigateToStudyPlan())
}

@objc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ extension AppViewController: AppViewControllerProtocol {
switch viewAction {
case .onboardingScreen:
return UIHostingController(rootView: OnboardingAssembly(output: viewModel).makeModule())
case .homeScreen:
return AppTabBarController(initialTab: .home, appTabBarControllerDelegate: viewModel)
case .studyPlan:
return AppTabBarController(initialTab: .studyPlan, appTabBarControllerDelegate: viewModel)
case .homeScreenWithStep(let navigateToHomeScreenWithStepViewAction):
case .studyPlanWithStep(let navigateToStudyPlanWithStepViewAction):
let tabBarController = AppTabBarController(
initialTab: .home,
initialTab: .studyPlan,
appTabBarControllerDelegate: viewModel
)

Expand All @@ -118,7 +116,7 @@ extension AppViewController: AppViewControllerProtocol {
return assertionFailure("Expected UINavigationController")
}

let stepAssembly = StepAssembly(stepRoute: navigateToHomeScreenWithStepViewAction.stepRoute)
let stepAssembly = StepAssembly(stepRoute: navigateToStudyPlanWithStepViewAction.stepRoute)
navigationController.pushViewController(stepAssembly.makeModule(), animated: false)
}

Expand Down Expand Up @@ -210,12 +208,10 @@ extension AppViewController: AppViewControllerProtocol {
) {
func route() {
switch viewAction {
case .home:
TabBarRouter(tab: .home).route()
case .profile:
TabBarRouter(tab: .profile).route()
case .stepScreen(let navigateToStepScreenViewAction):
navigateToHomeAndPresent {
navigateToStudyPlanAndPresent {
let assembly = StepAssembly(stepRoute: navigateToStepScreenViewAction.stepRoute)

let sourcelessRouter = SourcelessRouter()
Expand All @@ -224,7 +220,7 @@ extension AppViewController: AppViewControllerProtocol {
case .studyPlan:
TabBarRouter(tab: .studyPlan).route()
case .topicRepetition:
navigateToHomeAndPresent {
navigateToStudyPlanAndPresent {
ivan-magda marked this conversation as resolved.
Show resolved Hide resolved
let assembly = TopicsRepetitionsAssembly()

let sourcelessRouter = SourcelessRouter()
Expand All @@ -233,16 +229,16 @@ extension AppViewController: AppViewControllerProtocol {
}
}

func navigateToHomeAndPresent(_ navigateToHomeCompletionHandler: @escaping () -> Void) {
TabBarRouter(tab: .home).route()
func navigateToStudyPlanAndPresent(_ navigateToStudyPlanCompletionHandler: @escaping () -> Void) {
TabBarRouter(tab: .studyPlan).route()
DispatchQueue.main.asyncAfter(
deadline: .now() + Animation.clickedNotificationViewActionNavigateToHomeCompletionDelay,
execute: navigateToHomeCompletionHandler
execute: navigateToStudyPlanCompletionHandler
)
}

// Display home screen if needed
handleNavigateToViewAction(.homeScreen)
// Display study plan screen if needed
handleNavigateToViewAction(.studyPlan)

DispatchQueue.main.async {
route()
Expand Down
Loading