Skip to content

Commit

Permalink
chore: added scroll to chip
Browse files Browse the repository at this point in the history
  • Loading branch information
vkaltyrin committed Nov 1, 2024
1 parent 8aa2152 commit f5188fa
Show file tree
Hide file tree
Showing 26 changed files with 198 additions and 11 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -4,13 +4,24 @@
"filename" : "CheckBoxOff.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"filename" : "CheckBoxOff 1.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "CheckBoxDark.svg",
"idiom" : "universal"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
{
"filename" : "RadioBoxOff.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"filename" : "RadioBoxDark 1.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "RadioBoxDark.svg",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -6,7 +6,7 @@ public struct RadioboxImages {
public let selectedImage: Image
public let deselectedImage: Image

init(selectedImage: Image, deselectedImage: Image) {
public init(selectedImage: Image, deselectedImage: Image) {
self.selectedImage = selectedImage
self.deselectedImage = deselectedImage
}
Expand Down
10 changes: 5 additions & 5 deletions SDDSDemoApp/SDDSDemoApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
24C1540D2BB3020B00963FAA /* Preview Assets.xcassets in Resources */,
24C1540A2BB3020B00963FAA /* Assets.xcassets in Resources */,
24C1540D2BB3020B00963FAA /* Preview Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -703,7 +703,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -760,7 +760,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -789,7 +789,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -827,7 +827,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
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
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "CheckBoxOn(Multiple).svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
@@ -0,0 +1,35 @@
{
"images" : [
{
"filename" : "CheckBoxOff.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"filename" : "CheckBoxOff 1.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "CheckBoxDark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
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
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "CheckBoxOn(Single).svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"images" : [
{
"filename" : "RadioBoxOff.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"filename" : "RadioBoxOff 1.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "RadioBoxDark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "RadioBoxOn-2.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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 @@ -20,7 +20,7 @@ struct CheckboxView: View {
title: viewModel.title,
subtitle: viewModel.subtitle,
isEnabled: viewModel.isEnabled,
images: .checkbox,
images: CheckboxView.checkbox,
size: viewModel.size,
appearance: viewModel.appearance
)
Expand Down
5 changes: 2 additions & 3 deletions SDDSDemoApp/SDDSDemoApp/Views/ChipView/ChipView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ struct ChipView: View {
var body: some View {
List {
Section {
HStack {
Spacer()
ScrollView(.horizontal) {
SDDSChip(
title: viewModel.title,
isEnabled: viewModel.isEnabled,
Expand All @@ -25,8 +24,8 @@ struct ChipView: View {
size: viewModel.size,
removeAction: viewModel.removeAction
)
Spacer()
}
.scrollIndicators(.hidden)
}

Section(header: Text("Configuration")) {
Expand Down
11 changes: 10 additions & 1 deletion SDDSDemoApp/SDDSDemoApp/Views/RadioboxView/RadioboxView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct RadioboxView: View {
title: viewModel.title,
subtitle: viewModel.subtitle,
isEnabled: viewModel.isEnabled,
images: .defaultImages,
images: RadioboxView.radiobox,
size: viewModel.size,
appearance: viewModel.appearance
)
Expand Down Expand Up @@ -107,6 +107,15 @@ struct RadioboxView: View {
}
}

extension RadioboxView {
static var radiobox: RadioboxImages {
.init(
selectedImage: Image.image("radioboxOn", bundle: Bundle(for: CheckboxViewModel.self)),
deselectedImage: Image.image("radioboxOff", bundle: Bundle(for: CheckboxViewModel.self))
)
}
}

#Preview {
RadioboxView(viewModel: RadioboxViewModel())
}

0 comments on commit f5188fa

Please sign in to comment.