Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oolxg committed Dec 26, 2022
1 parent d14dfbc commit be468b3
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 55 deletions.
6 changes: 2 additions & 4 deletions Hanami.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,6 @@
CODE_SIGN_ENTITLEMENTS = Hanami/Hanami.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "\"Hanami/Preview Content\"";
DEVELOPMENT_TEAM = HJ9678T652;
ENABLE_PREVIEWS = YES;
Expand All @@ -1207,7 +1206,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.22;
MARKETING_VERSION = 0.22.1;
PRODUCT_BUNDLE_IDENTIFIER = moe.mkpwnz.Hanami;
PRODUCT_NAME = "Hanami - Manga Reader";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1227,7 +1226,6 @@
CODE_SIGN_ENTITLEMENTS = Hanami/Hanami.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "\"Hanami/Preview Content\"";
DEVELOPMENT_TEAM = HJ9678T652;
ENABLE_PREVIEWS = YES;
Expand All @@ -1248,7 +1246,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.22;
MARKETING_VERSION = 0.22.1;
PRODUCT_BUNDLE_IDENTIFIER = moe.mkpwnz.Hanami;
PRODUCT_NAME = "Hanami - Manga Reader";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
67 changes: 28 additions & 39 deletions Hanami/App/Core/Component/VerticalReaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct VerticalReaderView: View {
// MARK: - END scroll view declaration props

@State private var timeOut: CGFloat = 0.3

@State private var pages: IdentifiedArrayOf<Page>

private struct Page: Identifiable {
Expand All @@ -35,7 +34,7 @@ struct VerticalReaderView: View {

var body: some View {
GeometryReader { geo in
ScrollView(showsIndicators: false) {
ScrollView(showsIndicators: true) {
LazyVStack {
ForEach(pages.indices, id: \.self) { i in
listCell(i)
Expand Down Expand Up @@ -66,9 +65,7 @@ struct VerticalReaderView: View {
}
.background(Color.theme.background)
.offset { rect in
if startOffset != rect.minY {
startOffset = rect.minY
}
startOffset = rect.minY
}
.onReceive(Timer.publish(every: 0.01, on: .main, in: .default).autoconnect()) { _ in
// 0.6 - delay after which indicator will be hidden
Expand Down Expand Up @@ -114,42 +111,34 @@ struct VerticalReaderView: View {
.fill(.clear)
.frame(width: 2, height: scrollerHeight)
.overlay(alignment: .trailing) {
HStack(spacing: 2) {
Image(systemName: "bubble.middle.bottom.fill")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundStyle(.ultraThinMaterial)
.frame(width: 45, height: 45)
.rotationEffect(.init(degrees: -90))
.overlay {
if let last = pages.last(where: { $0.rect.minY < $0.rect.minY / 2 }) {
Text("\(last.index + 1)")
.fontWeight(.black)
.foregroundColor(.white)
.offset(x: -4)
} else {
Text("1")
.fontWeight(.black)
.foregroundColor(.white)
.offset(x: -4)
}
Image(systemName: "bubble.middle.bottom.fill")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundStyle(.ultraThinMaterial)
.frame(width: 45, height: 45)
.rotationEffect(.init(degrees: -90))
.overlay {
if let last = pages.last(where: { $0.rect.minY < $0.rect.minY / 2 }) {
Text("\(last.index + 1)")
.fontWeight(.black)
.foregroundColor(.white)
.offset(x: -4)
} else {
Text("1")
.fontWeight(.black)
.foregroundColor(.white)
.offset(x: -4)
}
.environment(\.colorScheme, .dark)
.offset(x: hideIndicatorLabel ? 65 : 0)
.animation(
.interactiveSpring(response: 0.5, dampingFraction: 0.6, blendDuration: 0.6),
value: hideIndicatorLabel
)

RoundedRectangle(cornerRadius: 6)
.foregroundStyle(.ultraThinMaterial)
.opacity(hideIndicatorLabel ? 0 : 1)
.animation(.linear(duration: 0.2), value: hideIndicatorLabel)
.frame(width: 4, height: 40)
}
}
.environment(\.colorScheme, .dark)
.offset(x: hideIndicatorLabel ? 65 : 0)
.animation(
.interactiveSpring(response: 0.5, dampingFraction: 0.6, blendDuration: 0.6),
value: hideIndicatorLabel
)
}
.padding(.trailing, 1)
.padding(.trailing, 6)
.offset(y: indicatorOffset)
.animation(.linear, value: indicatorOffset)
}
Expand Down
2 changes: 1 addition & 1 deletion Hanami/App/Core/Manga/Offline/OfflineMangaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct OfflineMangaView: View {
currentPageIndex = state.pagesState?.currentPageIndex
coverArtPath = state.coverArtPath
selectedTab = state.selectedTab
lastReadChapterAvailable = state.lastReadChapter != nil
lastReadChapterAvailable = state.lastReadChapter != nil && state.pagesState != nil
}
}

Expand Down
2 changes: 1 addition & 1 deletion Hanami/App/Core/Manga/Online/OnlineMangaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct OnlineMangaView: View {
allCoverArtURLs = state.croppedCoverArtURLs
allCoverArtsInfo = state.allCoverArtsInfo
statistics = state.statistics
lastReadChapterAvailable = state.lastReadChapterID != nil
lastReadChapterAvailable = state.lastReadChapterID != nil && state.pagesState != nil
}
}

Expand Down
14 changes: 4 additions & 10 deletions Hanami/App/Core/Search/SearchFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,13 @@ struct SearchFeature: ReducerProtocol {
return .task { .cancelSearchButtonTapped }
}

let selectedTags = state.filtersState.allTags.filter { $0.state != .notSelected }
let selectedPublicationDemographic = state.filtersState.publicationDemographics
.filter { $0.state != .notSelected }
let selectedContentRatings = state.filtersState.contentRatings.filter { $0.state != .notSelected }
let selectedMangaStatuses = state.filtersState.mangaStatuses.filter { $0.state != .notSelected }

let searchParams = SearchParams(
searchQuery: state.searchText,
resultsCount: state.resultsCount,
tags: selectedTags,
publicationDemographic: selectedPublicationDemographic,
contentRatings: selectedContentRatings,
mangaStatuses: selectedMangaStatuses,
tags: state.filtersState.allTags,
publicationDemographic: state.filtersState.publicationDemographics,
contentRatings: state.filtersState.contentRatings,
mangaStatuses: state.filtersState.mangaStatuses,
sortOption: state.searchSortOption,
sortOptionOrder: state.searchSortOptionOrder
)
Expand Down

0 comments on commit be468b3

Please sign in to comment.