Skip to content

Commit f6f1e2c

Browse files
committed
Add LinearLayout.Orientation
1 parent c14fd0e commit f6f1e2c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// LinearLayoutOrientation.swift
3+
// SwiftAndroid
4+
//
5+
// Created by Alsey Coleman Miller on 6/9/25.
6+
//
7+
8+
import JavaKit
9+
10+
public extension LinearLayout {
11+
12+
struct Orientation: RawRepresentable, Equatable, Hashable, Codable, Sendable {
13+
14+
public let rawValue: Int32
15+
16+
public init(rawValue: Int32) {
17+
self.rawValue = rawValue
18+
}
19+
}
20+
}
21+
22+
public extension LinearLayout {
23+
24+
var orientation: LinearLayout.Orientation {
25+
get {
26+
.init(rawValue: getOrientation())
27+
}
28+
set {
29+
setOrientation(newValue.rawValue)
30+
}
31+
}
32+
}
33+
34+
public extension LinearLayout.Orientation {
35+
36+
static let vertical = LinearLayout.Orientation(rawValue: try! JavaClass<LinearLayout>().VERTICAL)
37+
38+
static var horizontal = LinearLayout.Orientation(rawValue: try! JavaClass<LinearLayout>().HORIZONTAL)
39+
}

0 commit comments

Comments
 (0)