Skip to content

Commit

Permalink
Merge branch 'release/1.2.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mouredev committed Sep 30, 2021
2 parents b45defd + c3b05f6 commit efd2c77
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 61 deletions.
14 changes: 7 additions & 7 deletions Twitimer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@
"@executable_path/Frameworks",
);
MACH_O_TYPE = mh_execute;
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1142,7 +1142,7 @@
"@executable_path/Frameworks",
);
MACH_O_TYPE = mh_execute;
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1158,7 +1158,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = SJGR47U9J5;
INFOPLIST_FILE = TwitimerTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1180,7 +1180,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = SJGR47U9J5;
INFOPLIST_FILE = TwitimerTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1281,7 +1281,7 @@
repositoryURL = "https://github.com/Alamofire/Alamofire.git";
requirement = {
kind = exactVersion;
version = 5.4.3;
version = 5.4.4;
};
};
ACCD6F5926CD37280069E5E8 /* XCRemoteSwiftPackageReference "IQKeyboardManager" */ = {
Expand All @@ -1297,15 +1297,15 @@
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
requirement = {
kind = exactVersion;
version = 8.6.0;
version = 8.7.0;
};
};
ACCD6F6926CD38B50069E5E8 /* XCRemoteSwiftPackageReference "Kingfisher" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/onevcat/Kingfisher";
requirement = {
kind = exactVersion;
version = 6.3.1;
version = 7.0.0;
};
};
ACCD6F6C26CD38D30069E5E8 /* XCRemoteSwiftPackageReference "SwiftUIRefresh" */ = {
Expand Down
35 changes: 25 additions & 10 deletions Twitimer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,39 @@ class AppDelegate: NSObject, UIApplicationDelegate {
application.applicationIconBadgeNumber = 0

// UINavigationBar
UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().barTintColor = Color.primaryColor.uiColor
UINavigationBar.appearance().tintColor = Color.lightColor.uiColor
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().titleTextAttributes = [
let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithOpaqueBackground()
navigationBarAppearance.backgroundImage = UIImage()
navigationBarAppearance.backgroundColor = Color.primaryColor.uiColor
navigationBarAppearance.shadowImage = UIImage()
navigationBarAppearance.shadowColor = .clear
navigationBarAppearance.titleTextAttributes = [
.foregroundColor: Color.lightColor.uiColor,
.font: UIFont(descriptor: UIFontDescriptor(name: FontType.bold.rawValue, size: FontSize.head.rawValue), size: FontSize.head.rawValue)
]

let backIndicatorImage = UIImage(named: "keyboard-arrow-left")
UINavigationBar.appearance().backIndicatorImage = backIndicatorImage
UINavigationBar.appearance().backIndicatorTransitionMaskImage = backIndicatorImage
navigationBarAppearance.setBackIndicatorImage(backIndicatorImage, transitionMaskImage: backIndicatorImage)

UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().standardAppearance = navigationBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance

// UITabBar (TabView)
let tabBarAppearance = UITabBarAppearance()
tabBarAppearance.configureWithOpaqueBackground()
tabBarAppearance.backgroundImage = UIImage()
tabBarAppearance.backgroundColor = Color.backgroundColor.uiColor
tabBarAppearance.shadowImage = UIImage()
tabBarAppearance.shadowColor = .clear
tabBarAppearance.selectionIndicatorTintColor = Color.primaryColor.uiColor

UITabBar.appearance().isTranslucent = false
UITabBar.appearance().barTintColor = Color.backgroundColor.uiColor
UITabBar.appearance().tintColor = Color.primaryColor.uiColor
UITabBar.appearance().clipsToBounds = true // Remove top line
UITabBar.appearance().standardAppearance = tabBarAppearance
if #available(iOS 15.0, *) {
UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
}

// UITableView (List)
UITableView.appearance().backgroundColor = Color.secondaryBackgroundColor.uiColor
Expand Down
4 changes: 2 additions & 2 deletions Twitimer/UseCases/Common/Controls/NavigationButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct NavigationButton: View {
}
Spacer()
Image(systemName: "chevron.right")
.foregroundColor(.secondaryColor)
.foregroundColor(.primaryColor)
}.padding(.bottom, Size.medium.rawValue)
Divider()
}
Expand All @@ -33,6 +33,6 @@ struct NavigationButton_Previews: PreviewProvider {
static var previews: some View {
NavigationButton(text: "Text".localizedKey, action: {
print("NavigationButton action")
}).background(Color.primaryColor)
}).background(Color.backgroundColor)
}
}
15 changes: 10 additions & 5 deletions Twitimer/UseCases/Common/Rows/ScheduleRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ struct ScheduleRowView: View {
HStack(spacing: Size.verySmall.rawValue) {

if type == .custom {
DatePicker("", selection: $date, displayedComponents: [.date, .hourAndMinute]).labelsHidden().datePickerStyle(CompactDatePickerStyle())
DatePicker("", selection: $date, displayedComponents: [.date, .hourAndMinute]).labelsHidden()
.datePickerStyle(.compact)
.accentColor(readOnly ? .lightColor : .primaryColor)
.colorScheme(.dark) // FIXME: Hack para que se vea el texto en blanco. No funciona accentColor en iOS 15
.padding(Size.verySmall.rawValue).disabled(!enable || readOnly)
} else {

Image("time-clock-circle").templateIcon().foregroundColor(Color.lightColor)

DatePicker("", selection: $date, displayedComponents: .hourAndMinute).labelsHidden().datePickerStyle(CompactDatePickerStyle()).accentColor(.lightColor).disabled(!enable || readOnly)
DatePicker("", selection: $date, displayedComponents: .hourAndMinute).labelsHidden().datePickerStyle(.compact).accentColor(.lightColor)
.colorScheme(.dark) // FIXME: Hack para que se vea el texto en blanco. No funciona accentColor en iOS 15
.disabled(!enable || readOnly)
}

Image("hourglass").templateIcon().foregroundColor(Color.lightColor)
Expand All @@ -79,8 +83,9 @@ struct ScheduleRowView: View {
Text("+\($0)h").foregroundColor(.textColor)
}
}.font(size: .body)
.foregroundColor(.lightColor).pickerStyle(MenuPickerStyle()).disabled(!enable || readOnly)
.opacity(readOnly ? UIConstants.kViewOpacity : 1)
.accentColor(.lightColor)
.pickerStyle(MenuPickerStyle())
.allowsHitTesting(!(!enable || readOnly))

}.frame(height: Size.big.rawValue)

Expand Down Expand Up @@ -119,6 +124,6 @@ struct ScheduleRowView: View {
struct ScheduleRowView_Previews: PreviewProvider {

static var previews: some View {
ScheduleRowView(type: .custom, enable: .constant(true), date: .constant(Date()), duration: .constant(1), title: .constant(""), readOnly: false)
ScheduleRowView(type: .custom, enable: .constant(true), date: .constant(Date()), duration: .constant(1), title: .constant(""), readOnly: true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct UserAvatarView: View, SettingsDelegate {
.navigationBarItems(leading: Button(action: {
settingsView = false
}) {
Image("cross").template
Image("cross").template.foregroundColor(.lightColor)
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ struct UserHeaderNetworkView: View {
case .instagram:
url = "\(Constants.instagramUri)\(networkId)"
case .tiktok:
url = "\(Constants.tiktokUri)\(networkId)"
// Pasamos el user a minus ya que la App de TikTok es case sensitive
url = "\(Constants.tiktokUri)\(networkId.lowercased())"
case .github, .twitch:
// No soportadas
break
Expand Down
33 changes: 18 additions & 15 deletions Twitimer/UseCases/Countdown/CountdownView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct CountdownView: View {

// Header

VStack(alignment: .leading, spacing: Size.none.rawValue) {
VStack(alignment: .leading, spacing: Size.none.rawValue) {

if viewModel.streamings.isEmpty {

Expand All @@ -36,24 +36,27 @@ struct CountdownView: View {
// List

Text(viewModel.upcomingText).font(size: .head).foregroundColor(.textColor).padding(Size.medium.rawValue)

List {
ForEach(viewModel.streamings, id: \.streamer.id) { streaming in
ZStack {
NavigationLink(destination: UserRouter.readOnlyView(user: streaming.streamer)) {}.opacity(0)
TimerRowView(streaming: streaming, endDate:
streaming.schedule.date)
}.listRowInsets(EdgeInsets()).background(Color.backgroundColor)
}
.hideTableSeparator()
.background(Color.backgroundColor)
}
}.listStyle(.plain)
.pullToRefresh(isShowing: $isShowingRefresh) {
isShowingRefresh = false
viewModel.reload()
}
}.pullToRefresh(isShowing: $isShowingRefresh) {
isShowingRefresh = false
viewModel.reload()
}
}
}.background(Color.secondaryBackgroundColor)
.cornerRadius(Size.big.rawValue, corners: [.topRight, .topLeft])
.shadow(radius: Size.verySmall.rawValue)
.padding(.top, Size.medium.rawValue)
.cornerRadius(Size.big.rawValue, corners: [.topRight, .topLeft])
.shadow(radius: Size.verySmall.rawValue)
.padding(.top, Size.medium.rawValue)

// Buttons

Expand All @@ -64,13 +67,13 @@ struct CountdownView: View {
}, type: .secondary)

}.padding(Size.medium.rawValue)
.background(Color.backgroundColor)
.shadow(radius: Size.verySmall.rawValue)
.background(Color.backgroundColor)
.shadow(radius: Size.verySmall.rawValue)

}.background(Color.primaryColor)
.onAppear() {
viewModel.data()
}
.onAppear() {
viewModel.data()
}

if viewModel.loading {
CustomProgressView()
Expand Down
5 changes: 3 additions & 2 deletions Twitimer/UseCases/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct HomeView: View {
Button(action: {
menuView = true
}) {
Image("navigation-menu-horizontal").template.colorMultiply(.lightColor)
Image("navigation-menu-horizontal").template.foregroundColor(.lightColor)
}
}
.onAppear() {
Expand All @@ -67,14 +67,15 @@ struct HomeView: View {
}
.navigationViewStyle(StackNavigationViewStyle())
.opacity(viewModel.loading ? 0 : 1)
.accentColor(.lightColor)
.sheet(isPresented: $menuView) {
NavigationView {
viewModel.menuView()
.navigationBarTitle(Text(viewModel.titleText), displayMode: .inline)
.navigationBarItems(leading: Button(action: {
menuView = false
}) {
Image("cross").template
Image("cross").template.foregroundColor(.lightColor)
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion Twitimer/UseCases/Launch/Account/User/UserView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ struct UserView: View {
duration: $viewModel.schedule[index].duration,
title: $viewModel.schedule[index].title,
readOnly: viewModel.readOnly)
.hideTableSeparator()
}
}
}.listStyle(.plain)
}
} else {
viewModel.infoView()
Expand Down
35 changes: 18 additions & 17 deletions Twitimer/UseCases/Search/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct SearchView: View {
// Header

HStack(spacing: Size.none.rawValue) {

Image("search").template
.resizable().frame(width: Size.mediumBig.rawValue, height: Size.mediumBig.rawValue)
.foregroundColor(Color.textColor)
Expand Down Expand Up @@ -81,35 +81,36 @@ struct SearchView: View {

// List

if let search = viewModel.search, !search.isEmpty {
List {
List {
if let search = viewModel.search, !search.isEmpty {
ForEach(search, id: \.id) { user in
SearchRowView(user: nil, userSearch: user, addAction: nil)
.listRowInsets(EdgeInsets()).background(Color.backgroundColor)
.hideTableSeparator()
.background(Color.backgroundColor)
.onTapGesture {
if let user = user.broadcasterLogin {
viewModel.search(user: user)
}
}
}
}
} else {
List {
} else {
ForEach(viewModel.users, id: \.id) { user in
ZStack {
NavigationLink(destination: UserRouter.readOnlyView(user: user)) {}.opacity(0)
SearchRowView(user: user, userSearch: nil, addAction: {
text = ""
viewModel.updateCount()
})
}.listRowInsets(EdgeInsets()).background(Color.backgroundColor)
}
.hideTableSeparator()
.background(Color.backgroundColor)
}
}
}
}.listStyle(.plain)
}
}.background(Color.secondaryBackgroundColor)
.cornerRadius(Size.big.rawValue, corners: [.topRight, .topLeft])
.shadow(radius: Size.verySmall.rawValue)
.cornerRadius(Size.big.rawValue, corners: [.topRight, .topLeft])
.shadow(radius: Size.verySmall.rawValue)

// Buttons

Expand All @@ -127,8 +128,8 @@ struct SearchView: View {
}, type: .primary).enable(enableSearch())

}.padding(Size.medium.rawValue)
.background(Color.backgroundColor)
.shadow(radius: Size.verySmall.rawValue)
.background(Color.backgroundColor)
.shadow(radius: Size.verySmall.rawValue)

}
.background(Color.primaryColor)
Expand All @@ -149,11 +150,11 @@ struct SearchView: View {

private func enableCancel() -> Bool {
return isEditing
|| (!isEditing && !viewModel.search.isEmpty)
|| (!isEditing && !viewModel.users.isEmpty && viewModel.found)
|| (!isEditing && viewModel.users.isEmpty && viewModel.search.isEmpty)
|| (!isEditing && !viewModel.search.isEmpty)
|| (!isEditing && !viewModel.users.isEmpty && viewModel.found)
|| (!isEditing && viewModel.users.isEmpty && viewModel.search.isEmpty)
}

private func enableSearch() -> Bool {
return !text.isEmpty
}
Expand Down
9 changes: 9 additions & 0 deletions Twitimer/Util/Extension/ViewExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ extension View {
else { self }
}

// MARK: iOS 15

func hideTableSeparator() -> AnyView {
if #available(iOS 15.0, *) {
return AnyView(self.listRowSeparator(.hidden).listRowInsets(EdgeInsets()))
}
return AnyView(self.listRowInsets(EdgeInsets()))
}

}

private struct RoundedCorner: Shape {
Expand Down

0 comments on commit efd2c77

Please sign in to comment.