-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX][Fixed BottomTabBar], [DEV][Added dark-light theme support]
- Loading branch information
1 parent
d0cef3a
commit 0e2d4c9
Showing
14 changed files
with
204 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
SwiftRorty.iOS/Assets.xcassets/BackgroundDark.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0x2E", | ||
"green" : "0x29", | ||
"red" : "0x24" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
SwiftRorty.iOS/Assets.xcassets/BackgroundLight.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0xEE", | ||
"green" : "0xEE", | ||
"red" : "0xEE" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// CheckboxToggleStyle.swift | ||
// SwiftRorty.iOS | ||
// | ||
// Created by developersancho on 5.03.2022. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct CheckboxToggleStyle: ToggleStyle { | ||
func makeBody(configuration: Configuration) -> some View { | ||
return HStack { | ||
configuration.label | ||
Spacer() | ||
Image(systemName: configuration.isOn ? "checkmark.square" : "square") | ||
.resizable() | ||
.frame(width: 22, height: 22) | ||
.onTapGesture { configuration.isOn.toggle() } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// ColoredToggleStyle.swift | ||
// SwiftRorty.iOS | ||
// | ||
// Created by developersancho on 5.03.2022. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ColoredToggleStyle: ToggleStyle { | ||
var onColor = Color(UIColor.systemGray5) | ||
var offColor = Color(UIColor.systemGray5) | ||
var thumbColor = Color.ToggleRed | ||
|
||
func makeBody(configuration: Self.Configuration) -> some View { | ||
HStack { | ||
configuration.label // The text (or view) portion of the Toggle | ||
Spacer() | ||
RoundedRectangle(cornerRadius: 16, style: .circular) | ||
.fill(configuration.isOn ? onColor : offColor) | ||
.frame(width: 50, height: 29) | ||
.overlay( | ||
Circle() | ||
.fill(thumbColor) | ||
.shadow(radius: 1, x: 0, y: 1) | ||
.padding(1.5) | ||
.offset(x: configuration.isOn ? 10 : -10)) | ||
.animation(Animation.easeInOut(duration: 0.2)) | ||
.onTapGesture { configuration.isOn.toggle() } | ||
} | ||
.font(.title) | ||
//.padding(.horizontal) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// VerticalToggleStyle.swift | ||
// SwiftRorty.iOS | ||
// | ||
// Created by developersancho on 5.03.2022. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct VerticalToggleStyle: ToggleStyle { | ||
func makeBody(configuration: Configuration) -> some View { | ||
return VStack(alignment: .leading) { | ||
Toggle(configuration).labelsHidden() | ||
} | ||
.frame(width: .infinity) | ||
.padding() | ||
.overlay( | ||
RoundedRectangle(cornerRadius: 10) | ||
.stroke(configuration.isOn ? Color.green: Color.gray, lineWidth: 2) // <4> | ||
) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
SwiftRorty.iOS/extensions/UITabBarControllerExtension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// UITabBarControllerExtension.swift | ||
// SwiftRorty.iOS | ||
// | ||
// Created by developersancho on 5.03.2022. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
//extension UITabBarController { | ||
// override open func viewDidAppear(_ animated: Bool) { | ||
// super.viewDidAppear(animated) | ||
// let appeareance = UITabBarAppearance() | ||
// appeareance.backgroundColor = UIColor(Color.Primary) | ||
// | ||
// // Use this appearance when scrolling behind the TabView: | ||
// UITabBar.appearance().standardAppearance = appeareance | ||
// // Use this appearance when scrolled all the way up: | ||
// UITabBar.appearance().scrollEdgeAppearance = appeareance | ||
// | ||
// //UITabBar.appearance().backgroundColor = UIColor(Color.Primary) | ||
// UITabBar.appearance().barTintColor = UIColor(Color.Primary) | ||
// UITabBar.appearance().unselectedItemTintColor = UIColor(Color.UnSelectedBottomItem) | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters