Skip to content

Commit 0574fbc

Browse files
committed
Add native Divider backing
1 parent 745739a commit 0574fbc

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// AndroidDivider.swift
3+
// AndroidSwiftUI
4+
//
5+
// Created by Alsey Coleman Miller on 7/16/26.
6+
//
7+
8+
import AndroidKit
9+
10+
extension Divider: AnyAndroidView {
11+
12+
public func createAndroidView(_ context: AndroidContent.Context) -> AndroidView.View {
13+
let view = AndroidView.View(context)
14+
// hairline separator
15+
let matchParent = try! JavaClass<ViewGroup.LayoutParams>().MATCH_PARENT
16+
view.setLayoutParams(ViewGroup.LayoutParams(matchParent, 2))
17+
view.setBackgroundColor(0x33_00_00_00) // ARGB translucent black
18+
return view
19+
}
20+
21+
public func updateAndroidView(_ view: AndroidView.View) {
22+
23+
}
24+
25+
public func removeAndroidView() {
26+
27+
}
28+
}

0 commit comments

Comments
 (0)