Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
4bdd8f05
Commit
4bdd8f05
authored
Apr 19, 2019
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added custom switch size
parent
81909af0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Sources/iOS/Switch/Switch.swift
+7
-3
No files found.
Sources/iOS/Switch/Switch.swift
View file @
4bdd8f05
...
...
@@ -36,11 +36,11 @@ public enum SwitchState: Int {
case
off
}
@objc(SwitchSize)
public
enum
SwitchSize
:
Int
{
public
enum
SwitchSize
{
case
small
case
medium
case
large
case
custom
(
width
:
CGFloat
,
height
:
CGFloat
)
}
@objc(SwitchDelegate)
...
...
@@ -248,9 +248,11 @@ open class Switch: UIControl, Themeable {
case
.
large
:
trackThickness
=
24
buttonDiameter
=
28
case
.
custom
:
break
}
frame
.
size
=
intrinsicContentSize
invalidateIntrinsicContentSize
()
}
}
...
...
@@ -262,6 +264,8 @@ open class Switch: UIControl, Themeable {
return
CGSize
(
width
:
38
,
height
:
38
)
case
.
large
:
return
CGSize
(
width
:
42
,
height
:
42
)
case
.
custom
(
let
width
,
let
height
):
return
CGSize
(
width
:
width
,
height
:
height
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment