diff --git a/Sources/LinearLayout.swift b/Sources/LinearLayout.swift new file mode 100644 index 0000000..1286f1a --- /dev/null +++ b/Sources/LinearLayout.swift @@ -0,0 +1,638 @@ +// +// LinearLayout.swift +// Android +// +// Created by Killian Greene on 8/10/18. +// + +import Foundation +import java_swift +import java_lang +import JNI + +public extension Android.Widget { + public typealias LinearLayout = AndroidLinearLayout +} + +open class AndroidLinearLayout: Android.View.ViewGroup { + + // MARK: - Initialization + public convenience init?( casting object: java_swift.JavaObject, + _ file: StaticString = #file, + _ line: Int = #line ) { + self.init(javaObject: nil) + + object.withJavaObject { + self.javaObject = $0 + } + } + + public required init( javaObject: jobject? ) { + super.init(javaObject: javaObject) + } + + public convenience init(context: Android.Content.Context) { + self.init(javaObject: nil) + bindNewObject(context: context) + } + + public override func bindNewObject(context: Android.Content.Context) { + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + __args[0] = JNIType.toJava(value: context, locals: &__locals) + + let __object = JNIMethod.NewObject( + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass, + methodSig: "(Landroid/content/Context;)V", + methodCache: &LinearLayoutJNICache.MethodID.init_method_1, + args: &__args, + locals: &__locals ) + + super.javaObject = __object + + JNI.DeleteLocalRef( __object ) + } + + /** + * Return the offset of the widget's text baseline from the widget's top boundary. + */ + open override func getBaseline() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getBaseline", + methodSig: "()I", + methodCache: &LinearLayoutJNICache.MethodID.getBaseline, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + /** + * Called when any RTL property (layout direction or text direction or text alignment) has been changed. + */ + open override func onRtlPropertiesChanged(layoutDirection: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(layoutDirection)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "onRtlPropertiesChanged", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.onRtlPropertiesChanged, + args: &__args, + locals: &__locals ) + } + + /** + * Return true if the pressed state should be delayed for children or descendants of this ViewGroup. + */ + open override func shouldDelayChildPressedState() -> Bool { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallBooleanMethod( + object: javaObject, + methodName: "shouldDelayChildPressedState", + methodSig: "()Z", + methodCache: &LinearLayoutJNICache.MethodID.shouldDelayChildPressedState, + args: &__args, + locals: &__locals ) + + return __return != jboolean(JNI_FALSE) + } +} + +// MARK: - Constants +public extension AndroidLinearLayout { + + public static var HORIZONTAL: Int { + + get { + + let __value = JNIField.GetStaticIntField( + fieldName: "HORIZONTAL", + fieldType: "I", + fieldCache: &LinearLayoutJNICache.FieldID.HORIZONTAL, + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass ) + + return Int(__value) + } + } + + public static var VERTICAL: Int { + + get { + + let __value = JNIField.GetStaticIntField( + fieldName: "VERTICAL", + fieldType: "I", + fieldCache: &LinearLayoutJNICache.FieldID.VERTICAL, + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass ) + + return Int(__value) + } + } + + public static var SHOW_DIVIDER_BEGINNING: Int { + + get { + + let __value = JNIField.GetStaticIntField( + fieldName: "SHOW_DIVIDER_BEGINNING", + fieldType: "I", + fieldCache: &LinearLayoutJNICache.FieldID.SHOW_DIVIDER_BEGINNING, + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass ) + + return Int(__value) + } + } + + public static var SHOW_DIVIDER_END: Int { + + get { + + let __value = JNIField.GetStaticIntField( + fieldName: "SHOW_DIVIDER_END", + fieldType: "I", + fieldCache: &LinearLayoutJNICache.FieldID.SHOW_DIVIDER_END, + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass ) + + return Int(__value) + } + } + + public static var SHOW_DIVIDER_NONE: Int { + + get { + + let __value = JNIField.GetStaticIntField( + fieldName: "SHOW_DIVIDER_NONE", + fieldType: "I", + fieldCache: &LinearLayoutJNICache.FieldID.SHOW_DIVIDER_NONE, + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass ) + + return Int(__value) + } + } + + public static var SHOW_DIVIDER_MIDDLE: Int { + + get { + + let __value = JNIField.GetStaticIntField( + fieldName: "SHOW_DIVIDER_MIDDLE", + fieldType: "I", + fieldCache: &LinearLayoutJNICache.FieldID.SHOW_DIVIDER_MIDDLE, + className: LinearLayoutJNICache.className, + classCache: &LinearLayoutJNICache.jniClass ) + + return Int(__value) + } + } +} + +// MARK: - Methods +public extension AndroidLinearLayout { + + public func getBaselineAlignedChildIndex() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getBaselineAlignedChildIndex", + methodSig: "()I", + methodCache: &LinearLayoutJNICache.MethodID.getBaselineAlignedChildIndex, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + /** + * Get the padding size used to inset dividers in pixels + */ + public func getDividerPadding() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getDividerPadding", + methodSig: "()I", + methodCache: &LinearLayoutJNICache.MethodID.getDividerPadding, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + /** + * Returns the current gravity. + */ + public func getGravity() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getGravity", + methodSig: "()I", + methodCache: &LinearLayoutJNICache.MethodID.getGravity, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + /** + * Returns the current orientation. + */ + public func getOrientation() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getOrientation", + methodSig: "()I", + methodCache: &LinearLayoutJNICache.MethodID.getOrientation, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + + public func getShowDividers() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getShowDividers", + methodSig: "()I", + methodCache: &LinearLayoutJNICache.MethodID.getShowDividers, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + /** + * Returns the desired weights sum. + */ + public func getWeightSum() -> Float { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallFloatMethod( + object: javaObject, + methodName: "getWeightSum", + methodSig: "()F", + methodCache: &LinearLayoutJNICache.MethodID.getWeightSum, + args: &__args, + locals: &__locals ) + + return Float(__return) + } + + /** + * Indicates whether widgets contained within this layout are aligned on their baseline or not. + */ + public func isBaselineAligned() -> Bool { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallBooleanMethod( + object: javaObject, + methodName: "isBaselineAligned", + methodSig: "()Z", + methodCache: &LinearLayoutJNICache.MethodID.isBaselineAligned, + args: &__args, + locals: &__locals ) + + return __return != jboolean(JNI_FALSE) + } + + /** + * When true, all children with a weight will be considered having the minimum size of the largest child. + */ + public func isMeasureWithLargestChildEnabled() -> Bool { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallBooleanMethod( + object: javaObject, + methodName: "isMeasureWithLargestChildEnabled", + methodSig: "()Z", + methodCache: &LinearLayoutJNICache.MethodID.isMeasureWithLargestChildEnabled, + args: &__args, + locals: &__locals ) + + return __return != jboolean(JNI_FALSE) + } + + /** + * Defines whether widgets contained in this layout are baseline-aligned or not. + */ + public func setBaselineAligned(baselineAligned: Bool) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(z: jboolean(baselineAligned ? JNI_TRUE : JNI_FALSE)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setBaselineAligned", + methodSig: "(Z)V", + methodCache: &LinearLayoutJNICache.MethodID.setBaselineAligned, + args: &__args, + locals: &__locals ) + } + + + public func setBaselineAlignedChildIndex(i: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(i)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setBaselineAlignedChildIndex", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setBaselineAlignedChildIndex, + args: &__args, + locals: &__locals ) + } + + /** + * Set a drawable to be used as a divider between items. + */ + public func setDividerDrawable(divider: JavaObject) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = JNIType.toJava(value: divider, locals: &__locals) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setDividerDrawable", + methodSig: "(Landroid/graphics/drawable/Drawable;)V", + methodCache: &LinearLayoutJNICache.MethodID.setDividerDrawable, + args: &__args, + locals: &__locals ) + } + + /** + * Set padding displayed on both ends of dividers. + */ + public func setDividerPadding(padding: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(padding)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setDividerPadding", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setDividerPadding, + args: &__args, + locals: &__locals ) + } + + /** + * Describes how the child views are positioned. + */ + public func setGravity(gravity: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(gravity)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setGravity", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setGravity, + args: &__args, + locals: &__locals ) + } + + + public func setHorizontalGravity(horizontalGravity: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(horizontalGravity)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setHorizontalGravity", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setHorizontalGravity, + args: &__args, + locals: &__locals ) + } + + /** + * When set to true, all children with a weight will be considered having the minimum size of the largest child. + */ + public func setMeasureWithLargestChildEnabled(enabled: Bool) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(z: jboolean(enabled ? JNI_TRUE : JNI_FALSE)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setMeasureWithLargestChildEnabled", + methodSig: "(Z)V", + methodCache: &LinearLayoutJNICache.MethodID.setMeasureWithLargestChildEnabled, + args: &__args, + locals: &__locals ) + } + + /** + * Should the layout be a column or a row. + */ + public func setOrientation(orientation: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(orientation)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setOrientation", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setOrientation, + args: &__args, + locals: &__locals ) + } + + /** + * Set how dividers should be shown between items in this layout + */ + public func setShowDividers(showDividers: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(showDividers)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setShowDividers", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setShowDividers, + args: &__args, + locals: &__locals ) + } + + + public func setVerticalGravity(verticalGravity: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(verticalGravity)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setVerticalGravity", + methodSig: "(I)V", + methodCache: &LinearLayoutJNICache.MethodID.setVerticalGravity, + args: &__args, + locals: &__locals ) + } + + /** + * Defines the desired weights sum. + */ + public func setWeightSum(weightSum: Float) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(f: jfloat(weightSum)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "setWeightSum", + methodSig: "(F)V", + methodCache: &LinearLayoutJNICache.MethodID.setWeightSum, + args: &__args, + locals: &__locals ) + } + +} + +// MARK: - Private +internal extension AndroidLinearLayout { + + /// JNI Cache + struct LinearLayoutJNICache { + + /// JNI Java class signature + static let classSignature = Android.Widget.className(["LinearLayout"]) + + /// JNI Java class name + static let className = classSignature.rawValue + + /// JNI Java class + static var jniClass: jclass? + + struct FieldID { + static var HORIZONTAL: jfieldID? + static var VERTICAL: jfieldID? + static var SHOW_DIVIDER_BEGINNING: jfieldID? + static var SHOW_DIVIDER_END: jfieldID? + static var SHOW_DIVIDER_MIDDLE: jfieldID? + static var SHOW_DIVIDER_NONE: jfieldID? + } + + /// JNI Method ID cache + struct MethodID { + static var init_method_1: jmethodID? + static var getBaseline: jmethodID? + static var getBaselineAlignedChildIndex: jmethodID? + static var getDividerPadding: jmethodID? + static var getGravity: jmethodID? + static var getOrientation: jmethodID? + static var getShowDividers: jmethodID? + static var getWeightSum: jmethodID? + static var isBaselineAligned: jmethodID? + static var isMeasureWithLargestChildEnabled: jmethodID? + static var onRtlPropertiesChanged: jmethodID? + static var setBaselineAligned: jmethodID? + static var setBaselineAlignedChildIndex: jmethodID? + static var setDividerDrawable: jmethodID? + static var setDividerPadding: jmethodID? + static var setGravity: jmethodID? + static var setHorizontalGravity: jmethodID? + static var setMeasureWithLargestChildEnabled: jmethodID? + static var setOrientation: jmethodID? + static var setShowDividers: jmethodID? + static var setVerticalGravity: jmethodID? + static var setWeightSum: jmethodID? + static var shouldDelayChildPressedState: jmethodID? + } + } +} diff --git a/Sources/LinearLayoutLayoutParams.swift b/Sources/LinearLayoutLayoutParams.swift new file mode 100644 index 0000000..8e515e3 --- /dev/null +++ b/Sources/LinearLayoutLayoutParams.swift @@ -0,0 +1,183 @@ +// +// LinearLayoutLayoutParams.swift +// Android +// +// Created by Killian Greene on 8/10/18. +// + +import Foundation +import java_util +import java_swift +import JNI + +public extension AndroidLinearLayout { + public typealias LLayoutParams = AndroidLinearLayoutLayoutParams +} + +open class AndroidLinearLayoutLayoutParams: Android.View.ViewGroup.MarginLayoutParams { + + /** + * Creates a new set of layout parameters with the specified width, height and weight. + */ + public convenience init(width: Int, height: Int, weight: Float){ + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 3 ) + __args[0] = jvalue(i: jint(width)) + __args[1] = jvalue(i: jint(height)) + __args[2] = jvalue(f: jfloat(weight)) + + let __object = JNIMethod.NewObject( + className: LLayoutParamsJNICache.className, + classCache: &LLayoutParamsJNICache.jniClass, + methodSig: "(IIF)V", + methodCache: &LLayoutParamsJNICache.MethodID.init_method_1, + args: &__args, + locals: &__locals ) + + self.init( javaObject: __object ) + + JNI.DeleteLocalRef( __object ) + } + + public convenience init(source: Android.Widget.LinearLayout.LLayoutParams){ + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + __args[0] = JNIType.toJava(value: source, locals: &__locals) + + let __object = JNIMethod.NewObject( + className: LLayoutParamsJNICache.className, + classCache: &LLayoutParamsJNICache.jniClass, + methodSig: "(Landroid/widget/LinearLayout$LayoutParams;)V", + methodCache: &LLayoutParamsJNICache.MethodID.init_method_2, + args: &__args, + locals: &__locals ) + + self.init( javaObject: __object ) + + JNI.DeleteLocalRef( __object ) + } + + public convenience init(source: Android.View.ViewGroup.MarginLayoutParams){ + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + __args[0] = JNIType.toJava(value: source, locals: &__locals) + + let __object = JNIMethod.NewObject( + className: LLayoutParamsJNICache.className, + classCache: &LLayoutParamsJNICache.jniClass, + methodSig: "(Landroid/view/ViewGroup$MarginLayoutParams;)V", + methodCache: &LLayoutParamsJNICache.MethodID.init_method_3, + args: &__args, + locals: &__locals ) + + self.init( javaObject: __object ) + + JNI.DeleteLocalRef( __object ) + } + + /** + * Creates a new set of layout parameters with the specified width and height. + */ + public convenience init(width: Int, height: Int){ + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 2 ) + __args[0] = jvalue(i: jint(width)) + __args[1] = jvalue(i: jint(height)) + + let __object = JNIMethod.NewObject( + className: LLayoutParamsJNICache.className, + classCache: &LLayoutParamsJNICache.jniClass, + methodSig: "(II)V", + methodCache: &LLayoutParamsJNICache.MethodID.init_method_4, + args: &__args, + locals: &__locals ) + + self.init( javaObject: __object ) + + JNI.DeleteLocalRef( __object ) + } + + /** + * Copy constructor. + */ + public convenience init(source: Android.View.ViewGroup.LayoutParams){ + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + __args[0] = JNIType.toJava(value: source, locals: &__locals) + + let __object = JNIMethod.NewObject( + className: LLayoutParamsJNICache.className, + classCache: &LLayoutParamsJNICache.jniClass, + methodSig: "(Landroid/view/ViewGroup$LayoutParams;)V", + methodCache: &LLayoutParamsJNICache.MethodID.init_method_5, + args: &__args, + locals: &__locals ) + + self.init( javaObject: __object ) + + JNI.DeleteLocalRef( __object ) + } + + public convenience init(context: Android.Content.Context, attrs: JavaObject){ + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 2 ) + __args[0] = JNIType.toJava(value: context, locals: &__locals) + __args[1] = JNIType.toJava(value: attrs, locals: &__locals) + + let __object = JNIMethod.NewObject( + className: LLayoutParamsJNICache.className, + classCache: &LLayoutParamsJNICache.jniClass, + methodSig: "(Landroid/content/Context;Landroid/util/AttributeSet;)V", + methodCache: &LLayoutParamsJNICache.MethodID.init_method_6, + args: &__args, + locals: &__locals ) + + self.init( javaObject: __object ) + + JNI.DeleteLocalRef( __object ) + } +} + +// MARK: - JNICache + +internal extension AndroidLinearLayoutLayoutParams { + + /// JNI Cache + struct LLayoutParamsJNICache { + + /// JNI Java class signature + static let classSignature = Android.Widget.className(["LinearLayout$LayoutParams"]) + + /// JNI Java class name + static let className = classSignature.rawValue + + /// JNI Java class + static var jniClass: jclass? + + /// JNI Field ID cache + struct FieldID { + } + + /// JNI Method ID cache + struct MethodID { + static var init_method_1: jmethodID? + static var init_method_2: jmethodID? + static var init_method_3: jmethodID? + static var init_method_4: jmethodID? + static var init_method_5: jmethodID? + static var init_method_6: jmethodID? + } + } +} diff --git a/Sources/View.swift b/Sources/View.swift index 2e8b697..058ba18 100644 --- a/Sources/View.swift +++ b/Sources/View.swift @@ -729,6 +729,43 @@ open class AndroidView: JavaObject { args: &__args, locals: &__locals ) } + + /** + * Return the offset of the widget's text baseline from the widget's top boundary. + */ + open func getBaseline() -> Int { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallIntMethod( + object: javaObject, + methodName: "getBaseline", + methodSig: "()I", + methodCache: &JNICache.MethodID.getBaseline, + args: &__args, + locals: &__locals ) + + return Int(__return) + } + + open func onRtlPropertiesChanged(layoutDirection: Int) { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + __args[0] = jvalue(i: jint(layoutDirection)) + + JNIMethod.CallVoidMethod( + object: javaObject, + methodName: "onRtlPropertiesChanged", + methodSig: "(I)V", + methodCache: &JNICache.MethodID.onRtlPropertiesChanged, + args: &__args, + locals: &__locals ) + } } // MARK: - Constants @@ -3689,26 +3726,6 @@ public extension Android.View.View { return Int(__return) } - /** - * Return the offset of the widget's text baseline from the widget's top boundary. - */ - public func getBaseline() -> Int { - - var __locals = [jobject]() - - var __args = [jvalue]( repeating: jvalue(), count: 1 ) - - let __return = JNIMethod.CallIntMethod( - object: javaObject, - methodName: "getBaseline", - methodSig: "()I", - methodCache: &JNICache.MethodID.getBaseline, - args: &__args, - locals: &__locals ) - - return Int(__return) - } - /** * Bottom position of this view relative to its parent. */ @@ -6247,27 +6264,6 @@ public extension Android.View.View { } - - public func onRtlPropertiesChanged(layoutDirection: Int) { - - var __locals = [jobject]() - - var __args = [jvalue]( repeating: jvalue(), count: 1 ) - - __args[0] = jvalue(i: jint(layoutDirection)) - - JNIMethod.CallVoidMethod( - object: javaObject, - methodName: "onRtlPropertiesChanged", - methodSig: "(I)V", - methodCache: &JNICache.MethodID.onRtlPropertiesChanged, - args: &__args, - locals: &__locals ) - - - } - - public func onScreenStateChanged(screenState: Int) { var __locals = [jobject]() diff --git a/Sources/ViewGroup.swift b/Sources/ViewGroup.swift index 3f90e66..3d2c516 100644 --- a/Sources/ViewGroup.swift +++ b/Sources/ViewGroup.swift @@ -591,6 +591,25 @@ open class AndroidViewGroup: AndroidView { args: &__args, locals: &__locals ) } + + open func shouldDelayChildPressedState() -> Bool { + + var __locals = [jobject]() + + var __args = [jvalue]( repeating: jvalue(), count: 1 ) + + let __return = JNIMethod.CallBooleanMethod( + object: javaObject, + methodName: "shouldDelayChildPressedState", + methodSig: "()Z", + methodCache: &ViewGroupJNICache.MethodID.shouldDelayChildPressedState, + args: &__args, + locals: &__locals ) + + + + return __return != jboolean(JNI_FALSE) + } } public extension Android.View.ViewGroup { @@ -2069,27 +2088,6 @@ public extension Android.View.ViewGroup { } - - public func shouldDelayChildPressedState() -> Bool { - - var __locals = [jobject]() - - var __args = [jvalue]( repeating: jvalue(), count: 1 ) - - let __return = JNIMethod.CallBooleanMethod( - object: javaObject, - methodName: "shouldDelayChildPressedState", - methodSig: "()Z", - methodCache: &ViewGroupJNICache.MethodID.shouldDelayChildPressedState, - args: &__args, - locals: &__locals ) - - - - return __return != jboolean(JNI_FALSE) - } - - public func showContextMenuForChild(originalView: Android.View.View, x: Float, y: Float) -> Bool { var __locals = [jobject]()