generated from GDGVIT/template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui tweaks from new v3 designs and deps updates (#13)
* feat: added new bottom bar * feat: updated project settings and new bottom bar * Update README.md
- Loading branch information
1 parent
a0b1d35
commit b428a66
Showing
18 changed files
with
145 additions
and
299 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
VITTY/VITTY.xcodeproj/xcshareddata/xcschemes/vitty-widgetExtension.xcscheme
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// | ||
// BottomBarView.swift | ||
// VITTY | ||
// | ||
// Created by Chandram Dutta on 07/07/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct BottomBarView: View { | ||
|
||
@Binding var presentTab: Int | ||
@Namespace var bottomBarAnimation | ||
|
||
var body: some View { | ||
HStack { | ||
// TabButtonView(value: $presentTab, name: "Courses", image: "book.closed.fill", tabNo: 0, namespace: bottomBarAnimation) | ||
TabButtonView(value: $presentTab, name: "Schedule", image: "calendar.badge.clock", tabNo: 1, namespace: bottomBarAnimation) | ||
TabButtonView(value: $presentTab, name: "Connect", image: "person.2.fill", tabNo: 2, namespace: bottomBarAnimation) | ||
} | ||
.padding() | ||
.frame(height: 84) | ||
.background( | ||
RoundedRectangle(cornerRadius: 120) | ||
.stroke(Color("Secondary"), lineWidth: 2) | ||
.fill(Color("Background")) | ||
) | ||
.gesture(DragGesture(minimumDistance: 0, coordinateSpace: .local) | ||
.onEnded({ value in | ||
if value.translation.width < 0 { | ||
if presentTab == 1 { | ||
return | ||
} | ||
withAnimation (.bouncy(extraBounce: 0.1)) { | ||
presentTab -= 1 | ||
} | ||
} | ||
if value.translation.width > 0 { | ||
if presentTab == 2 { | ||
return | ||
} | ||
withAnimation (.interactiveSpring(duration: 0.50, extraBounce: 0.3)) { | ||
presentTab += 1 | ||
} | ||
} | ||
})) | ||
} | ||
} | ||
|
||
struct TabButtonView: View { | ||
|
||
@Binding var value: Int | ||
|
||
let name: String | ||
let image: String | ||
let tabNo: Int | ||
let namespace: Namespace.ID | ||
|
||
var body: some View { | ||
HStack { | ||
Image(systemName: image) | ||
.symbolEffect(.bounce, value: value == tabNo) | ||
if value == tabNo { | ||
Text(name) | ||
} | ||
} | ||
.padding() | ||
.background { | ||
if value == tabNo { | ||
RoundedRectangle(cornerRadius: 120) | ||
.fill(Color("Secondary")) | ||
.matchedGeometryEffect(id: "selectedTab", in: namespace) | ||
} | ||
} | ||
.onTapGesture { | ||
withAnimation (.interactiveSpring(duration: 0.50, extraBounce: 0.3)) { | ||
value = tabNo | ||
} | ||
} | ||
} | ||
} |
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
11 changes: 0 additions & 11 deletions
11
VITTY/vittyios-widgets/Assets.xcassets/AccentColor.colorset/Contents.json
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
VITTY/vittyios-widgets/Assets.xcassets/AppIcon.appiconset/Contents.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
VITTY/vittyios-widgets/Assets.xcassets/WidgetBackground.colorset/Contents.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.