|
1 |
| -#if ANDROID_11 |
2 |
| - |
3 | 1 | using System;
|
| 2 | +using Java.Interop; |
4 | 3 | using Android.Runtime;
|
5 | 4 |
|
6 | 5 | namespace Android.Animation
|
7 | 6 | {
|
8 | 7 | public partial class ValueAnimator
|
9 | 8 | {
|
10 |
| - private static IntPtr id_setDuration_J; |
| 9 | + static Delegate cb_setDuration_SetDuration_J_Landroid_animation_Animator_; |
11 | 10 |
|
12 | 11 | [Register ("setDuration", "(J)Landroid/animation/Animator;", "GetSetDuration_JHandler")]
|
13 |
| - public override Animator SetDuration (long duration) |
| 12 | + public override unsafe Android.Animation.Animator SetDuration (long duration) |
14 | 13 | {
|
15 |
| - if (id_setDuration_J == IntPtr.Zero) |
16 |
| - id_setDuration_J = JNIEnv.GetMethodID (class_ref, "setDuration", "(J)Landroid/animation/Animator;"); |
17 |
| - |
18 |
| - if (base.GetType () == this.ThresholdType) { |
19 |
| - return Java.Lang.Object.GetObject<ValueAnimator> ( |
20 |
| - JNIEnv.CallObjectMethod (base.Handle, id_setDuration_J, new JValue (duration)), |
21 |
| - JniHandleOwnership.TransferLocalRef)!; |
22 |
| - } else { |
23 |
| - return Java.Lang.Object.GetObject<ValueAnimator> ( |
24 |
| - JNIEnv.CallNonvirtualObjectMethod ( |
25 |
| - base.Handle, |
26 |
| - this.ThresholdClass, |
27 |
| - JNIEnv.GetMethodID (ThresholdClass, "setDuration", "(J)Landroid/animation/Animator;"), |
28 |
| - new JValue (duration)), |
29 |
| - JniHandleOwnership.TransferLocalRef)!; |
| 14 | + const string __id = "setDuration.(J)Landroid/animation/Animator;"; |
| 15 | + try { |
| 16 | + JniArgumentValue* __args = stackalloc JniArgumentValue [1]; |
| 17 | + __args [0] = new JniArgumentValue (duration); |
| 18 | + var __rm = _members.InstanceMethods.InvokeVirtualObjectMethod (__id, this, __args); |
| 19 | + return global::Java.Lang.Object.GetObject<Android.Animation.Animator> (__rm.Handle, JniHandleOwnership.TransferLocalRef); |
| 20 | + } finally { |
30 | 21 | }
|
31 | 22 | }
|
32 | 23 |
|
33 |
| - private static Delegate? cb_setDuration_J; |
34 |
| - |
35 |
| - private static Delegate GetSetDuration_JHandler () |
| 24 | +#pragma warning disable 0169 |
| 25 | + static Delegate GetSetDuration_JHandler () |
36 | 26 | {
|
37 |
| - if (cb_setDuration_J == null) |
38 |
| - cb_setDuration_J = JNINativeWrapper.CreateDelegate (new Func<IntPtr, IntPtr, long, IntPtr> (n_SetDuration_J)); |
39 |
| - return cb_setDuration_J; |
| 27 | + return cb_setDuration_SetDuration_J_Landroid_animation_Animator_ ??= new _JniMarshal_PPJ_L (n_SetDuration_J); |
40 | 28 | }
|
41 |
| - |
42 |
| - private static IntPtr n_SetDuration_J (IntPtr jnienv, IntPtr native__this, long duration) |
| 29 | + |
| 30 | + [global::System.Diagnostics.DebuggerDisableUserUnhandledExceptions] |
| 31 | + static IntPtr n_SetDuration_J (IntPtr jnienv, IntPtr native__this, long duration) |
43 | 32 | {
|
44 |
| - ValueAnimator @object = Java.Lang.Object.GetObject<ValueAnimator> (native__this, JniHandleOwnership.DoNotTransfer)!; |
45 |
| - return JNIEnv.ToJniHandle (@object.SetDuration (duration)); |
| 33 | + if (!global::Java.Interop.JniEnvironment.BeginMarshalMethod (jnienv, out var __envp, out var __r)) |
| 34 | + return default; |
| 35 | + |
| 36 | + try { |
| 37 | + var __this = global::Java.Lang.Object.GetObject<Android.Animation.ValueAnimator> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); |
| 38 | + return JNIEnv.ToLocalJniHandle (__this.SetDuration (duration)); |
| 39 | + } catch (global::System.Exception __e) { |
| 40 | + __r.OnUserUnhandledException (ref __envp, __e); |
| 41 | + return default; |
| 42 | + } finally { |
| 43 | + global::Java.Interop.JniEnvironment.EndMarshalMethod (ref __envp); |
| 44 | + } |
46 | 45 | }
|
| 46 | +#pragma warning restore 0169 |
47 | 47 | }
|
48 | 48 | }
|
49 |
| - |
50 |
| -#endif |
0 commit comments