@@ -10,27 +10,47 @@ import java_swift
1010import java_lang
1111import JNI
1212
13- public extension AndroidViewGroup {
13+ public extension Android . Widget {
1414 public typealias LinearLayout = AndroidLinearLayout
1515}
1616
1717open class AndroidLinearLayout : Android . View . ViewGroup {
18+
1819 // MARK: - Initialization
19- public convenience init ( context: Android . Content . Context ) {
20+ public convenience init ? ( casting object: java_swift . JavaObject ,
21+ _ file: StaticString = #file,
22+ _ line: Int = #line ) {
23+ self . init ( javaObject: nil )
2024
25+ object. withJavaObject {
26+ self . javaObject = $0
27+ }
28+ }
29+
30+ public required init ( javaObject: jobject ? ) {
31+ super. init ( javaObject: javaObject)
32+ }
33+
34+ public convenience init ( context: Android . Content . Context ) {
35+ self . init ( javaObject: nil )
36+ bindNewObject ( context: context)
37+ }
38+
39+ public override func bindNewObject( context: Android . Content . Context ) {
2140 var __locals = [ jobject] ( )
2241
2342 var __args = [ jvalue] ( repeating: jvalue ( ) , count: 1 )
43+ __args [ 0 ] = JNIType . toJava ( value: context, locals: & __locals)
2444
2545 let __object = JNIMethod . NewObject (
2646 className: LinearLayoutJNICache . className,
2747 classCache: & LinearLayoutJNICache. jniClass,
28- methodSig: " (Landroid/content/Context;)V) " ,
48+ methodSig: " (Landroid/content/Context;)V " ,
2949 methodCache: & LinearLayoutJNICache. MethodID. init_method_1,
3050 args: & __args,
31- locals: & __locals)
51+ locals: & __locals )
3252
33- self . init ( javaObject: __object )
53+ super . javaObject = __object
3454
3555 JNI . DeleteLocalRef ( __object )
3656 }
@@ -477,7 +497,7 @@ internal extension AndroidLinearLayout {
477497 struct LinearLayoutJNICache {
478498
479499 /// JNI Java class signature
480- static let classSignature = SwiftSupport . View . className ( [ " LinearLayout " ] )
500+ static let classSignature = Android . Widget . className ( [ " LinearLayout " ] )
481501
482502 /// JNI Java class name
483503 static let className = classSignature. rawValue
0 commit comments