Skip to content

Commit

Permalink
Merge pull request #823 from hyperskill/release/1.48
Browse files Browse the repository at this point in the history
Release 1.48
  • Loading branch information
XanderZhu authored Jan 8, 2024
2 parents ad2be08 + 7609bc0 commit 880a94a
Show file tree
Hide file tree
Showing 179 changed files with 3,207 additions and 350 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/automerge_into_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,18 @@ jobs:
current_version_number=$(git tag --sort=committerdate | tail -1 | cut -c 2-)
echo "Current version number is $current_version_number"
next_version_number=$(echo $current_version_number | awk -F. -v OFS=. '{$NF++;print}')
major=$(echo $current_version_number | cut -d. -f1)
minor=$(echo $current_version_number | cut -d. -f2)
patch=$(echo $current_version_number | cut -d. -f3)
echo "MAJOR: $major"
echo "MINOR: $minor"
echo "PATCH: $patch"
echo "Incrementing minor version number..."
next_minor=$((minor + 1))
next_version_number=$(printf "%d.%d" $major $next_minor)
echo "Next version number is $next_version_number"
git config user.name github-actions
Expand Down
2 changes: 1 addition & 1 deletion androidHyperskillApp/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"
ruby "3.1.0"

gem "fastlane", "2.217.0"
gem "fastlane", "2.219.0"

eval_gemfile("fastlane/Pluginfile")
54 changes: 29 additions & 25 deletions androidHyperskillApp/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ GEM
specs:
CFPropertyList (3.0.6)
rexml
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.853.0)
aws-sdk-core (3.187.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-eventstream (1.3.0)
aws-partitions (1.877.0)
aws-sdk-core (3.190.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.72.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sdk-kms (1.75.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.137.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.142.0)
aws-sdk-core (~> 3, >= 3.189.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
Expand All @@ -35,7 +35,7 @@ GEM
domain_name (0.6.20231109)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.104.0)
excon (0.109.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -64,8 +64,8 @@ GEM
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.7)
fastlane (2.217.0)
fastimage (2.3.0)
fastlane (2.219.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand All @@ -84,6 +84,7 @@ GEM
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-env (>= 1.6.0, < 2.0.0)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
Expand All @@ -92,7 +93,7 @@ GEM
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
optparse (>= 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
Expand All @@ -105,10 +106,11 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-firebase_app_distribution (0.7.4)
fastlane-plugin-firebase_app_distribution (0.8.0)
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.52.0)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.2)
addressable (~> 2.5, >= 2.5.1)
Expand All @@ -121,14 +123,16 @@ GEM
webrick
google-apis-firebaseappdistribution_v1 (0.3.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-firebaseappdistribution_v1alpha (0.2.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.29.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-core (1.6.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -152,17 +156,17 @@ GEM
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.6.3)
json (2.7.1)
jwt (2.7.1)
mini_magick (4.12.0)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.3.0)
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
optparse (0.4.0)
os (1.1.4)
plist (3.7.0)
plist (3.7.1)
public_suffix (5.0.4)
rake (13.1.0)
representable (3.2.0)
Expand All @@ -188,7 +192,7 @@ GEM
unicode-display_width (>= 1.1.1, < 3)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
Expand All @@ -213,7 +217,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
fastlane (= 2.217.0)
fastlane (= 2.219.0)
fastlane-plugin-firebase_app_distribution

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion androidHyperskillApp/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fastlane_version "2.215.1"
fastlane_version "2.219.0"

default_platform(:android)

Expand Down
Binary file modified androidHyperskillApp/src/main/ic_app_icon-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import android.widget.Toast
import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.runtime.getValue
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.flow.MutableStateFlow
import org.hyperskill.app.R
Expand All @@ -27,13 +29,17 @@ class ChallengeCardDelegate {

fun setup(
composeView: ComposeView,
viewLifecycleOwner: LifecycleOwner,
onNewMessage: (ChallengeWidgetFeature.Message) -> Unit
) {
composeView.setContent {
HyperskillTheme {
val viewState by stateFlow.collectAsStateWithLifecycle()
viewState?.let { actualViewState ->
ChallengeCard(viewState = actualViewState, onNewMessage = onNewMessage)
composeView.apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnLifecycleDestroyed(viewLifecycleOwner))
setContent {
HyperskillTheme {
val viewState by stateFlow.collectAsStateWithLifecycle()
viewState?.let { actualViewState ->
ChallengeCard(viewState = actualViewState, onNewMessage = onNewMessage)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ fun HyperskillCard(
modifier = modifier
.clip(RoundedCornerShape(cornerRadius))
.background(MaterialTheme.colors.surface)
.apply {
.let {
if (onClick != null) {
clickable(
it.clickable(
interactionSource = interactionSource,
indication = rememberRipple(),
onClick = onClick
)
} else {
it
}
}
.padding(contentPadding),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ 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.interview_preparation.delegate.InterviewPreparationCardDelegate
import org.hyperskill.app.android.interview_preparation_onboarding.screen.InterviewPreparationOnboardingScreen
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.step.view.screen.StepScreen
import org.hyperskill.app.android.topics_repetitions.view.delegate.TopicsRepetitionCardFormDelegate
import org.hyperskill.app.android.topics_repetitions.view.screen.TopicsRepetitionScreen
import org.hyperskill.app.android.view.base.ui.extension.snackbar
import org.hyperskill.app.challenges.widget.view.model.ChallengeWidgetViewState
import org.hyperskill.app.core.view.mapper.date.SharedDateFormatter
import org.hyperskill.app.home.presentation.HomeFeature
import org.hyperskill.app.home.presentation.HomeViewModel
import org.hyperskill.app.interview_preparation.presentation.InterviewPreparationWidgetFeature
import org.hyperskill.app.interview_preparation.view.model.InterviewPreparationWidgetViewState
import org.hyperskill.app.step.domain.model.StepRoute
import ru.nobird.android.view.base.ui.delegate.ViewStateDelegate
import ru.nobird.android.view.redux.ui.extension.reduxViewModel
Expand Down Expand Up @@ -62,6 +67,9 @@ class HomeFragment :
private val challengeCardDelegate: ChallengeCardDelegate by lazy(LazyThreadSafetyMode.NONE) {
ChallengeCardDelegate()
}
private val interviewPreparationCardDelegate: InterviewPreparationCardDelegate by lazy(LazyThreadSafetyMode.NONE) {
InterviewPreparationCardDelegate()
}

private var gamificationToolbarDelegate: GamificationToolbarDelegate? = null

Expand Down Expand Up @@ -89,10 +97,18 @@ class HomeFragment :
problemOfDayCardFormDelegate.setup(viewBinding.homeScreenProblemOfDayCard)
challengeCardDelegate.setup(
viewBinding.homeScreenChallengeCard,
viewLifecycleOwner = viewLifecycleOwner,
onNewMessage = {
homeViewModel.onNewMessage(HomeFeature.Message.ChallengeWidgetMessage(it))
}
)
interviewPreparationCardDelegate.setup(
viewBinding.homeScreenInterviewPreparationCard,
viewLifecycleOwner = viewLifecycleOwner,
onNewMessage = {
homeViewModel.onNewMessage(HomeFeature.Message.InterviewPreparationWidgetMessage(it))
}
)
with(viewBinding) {
homeScreenSwipeRefreshLayout.setHyperskillColors()
homeScreenSwipeRefreshLayout.setOnRefreshListener {
Expand Down Expand Up @@ -177,9 +193,7 @@ class HomeFragment :
router = requireRouter()
)
is HomeFeature.Action.ViewAction.NavigateTo.StepScreen -> {
requireRouter().navigateTo(
StepScreen(action.stepRoute)
)
navigateToStepScreen(action.stepRoute)
}
is HomeFeature.Action.ViewAction.ChallengeWidgetViewAction -> {
challengeCardDelegate.handleAction(
Expand All @@ -188,9 +202,23 @@ class HomeFragment :
action = action.viewAction
)
}
is HomeFeature.Action.ViewAction.InterviewPreparationWidgetViewAction -> {
when (val viewAction = action.viewAction) {
is InterviewPreparationWidgetFeature.Action.ViewAction.NavigateTo.Step ->
navigateToStepScreen(viewAction.stepRoute)
is InterviewPreparationWidgetFeature.Action.ViewAction.ShowOpenStepError ->
viewBinding.root.snackbar(viewAction.errorMessage)
is InterviewPreparationWidgetFeature.Action.ViewAction.NavigateTo.InterviewPreparationOnboarding ->
requireRouter().navigateTo(InterviewPreparationOnboardingScreen(viewAction.stepRoute))
}
}
}
}

private fun navigateToStepScreen(stepRoute: StepRoute) {
requireRouter().navigateTo(StepScreen(stepRoute))
}

override fun render(state: HomeFeature.ViewState) {
homeViewStateDelegate.switchState(state.homeState)

Expand All @@ -202,11 +230,17 @@ class HomeFragment :
renderTopicsRepetition(homeState.repetitionsState, homeState.isFreemiumEnabled)
}

val challengeState = state.challengeWidgetViewState
challengeCardDelegate.render(childFragmentManager, challengeState)
renderChallengeCard(state.challengeWidgetViewState)
renderInterviewPreparationCard(state.interviewPreparationWidgetViewState)

gamificationToolbarDelegate?.render(state.toolbarViewState)
}

private fun renderChallengeCard(challengeWidgetViewState: ChallengeWidgetViewState) {
challengeCardDelegate.render(childFragmentManager, challengeWidgetViewState)
viewBinding.homeScreenChallengeCard.updateLayoutParams<MarginLayoutParams> {
updateMargins(
top = when (challengeState) {
top = when (challengeWidgetViewState) {
ChallengeWidgetViewState.Idle, ChallengeWidgetViewState.Empty -> 0
else -> {
requireContext()
Expand All @@ -216,8 +250,25 @@ class HomeFragment :
}
)
}
}

gamificationToolbarDelegate?.render(state.toolbarViewState)
private fun renderInterviewPreparationCard(
interviewPreparationWidgetViewState: InterviewPreparationWidgetViewState
) {
interviewPreparationCardDelegate.render(interviewPreparationWidgetViewState)
viewBinding.homeScreenInterviewPreparationCard.updateLayoutParams<MarginLayoutParams> {
updateMargins(
top = when (interviewPreparationWidgetViewState) {
InterviewPreparationWidgetViewState.Idle,
InterviewPreparationWidgetViewState.Empty -> 0
else -> {
requireContext()
.resources
.getDimensionPixelOffset(R.dimen.home_screen_interview_card_top_margin)
}
}
)
}
}

private fun renderSwipeRefresh(state: HomeFeature.ViewState) {
Expand Down
Loading

0 comments on commit 880a94a

Please sign in to comment.