public unsafe TrackRectDrawable(global::Android.Content.Res.ColorStateList p0) : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer) { if (Handle != IntPtr.Zero) { return; } try { JValue *__args = stackalloc JValue [1]; __args [0] = new JValue(p0); if (GetType() != typeof(TrackRectDrawable)) { SetHandle( global::Android.Runtime.JNIEnv.StartCreateInstance(GetType(), "(Landroid/content/res/ColorStateList;)V", __args), JniHandleOwnership.TransferLocalRef); global::Android.Runtime.JNIEnv.FinishCreateInstance(Handle, "(Landroid/content/res/ColorStateList;)V", __args); return; } if (id_ctor_Landroid_content_res_ColorStateList_ == IntPtr.Zero) { id_ctor_Landroid_content_res_ColorStateList_ = JNIEnv.GetMethodID(class_ref, "<init>", "(Landroid/content/res/ColorStateList;)V"); } SetHandle( global::Android.Runtime.JNIEnv.StartCreateInstance(class_ref, id_ctor_Landroid_content_res_ColorStateList_, __args), JniHandleOwnership.TransferLocalRef); JNIEnv.FinishCreateInstance(Handle, class_ref, id_ctor_Landroid_content_res_ColorStateList_, __args); } finally { } }
public void MarshalInt32ArrayArray() { var states = new [] { new[] { 1, 2, 3 }, new[] { 4, 5, 6 }, }; var colors = new[] { 7, 8 }; var list = new global::Android.Content.Res.ColorStateList(states, colors); Assert.AreEqual(7, list.GetColorForState(states [0], Color.Transparent)); Assert.AreEqual(8, list.GetColorForState(states [1], Color.Transparent)); }
public static unsafe global::Android.Graphics.Drawables.Drawable GetRipple(global::Android.Content.Res.ColorStateList p0) { if (id_getRipple_Landroid_content_res_ColorStateList_ == IntPtr.Zero) { id_getRipple_Landroid_content_res_ColorStateList_ = JNIEnv.GetStaticMethodID(class_ref, "getRipple", "(Landroid/content/res/ColorStateList;)Landroid/graphics/drawable/Drawable;"); } try { JValue *__args = stackalloc JValue [1]; __args [0] = new JValue(p0); global::Android.Graphics.Drawables.Drawable __ret = global::Java.Lang.Object.GetObject <global::Android.Graphics.Drawables.Drawable> (JNIEnv.CallStaticObjectMethod(class_ref, id_getRipple_Landroid_content_res_ColorStateList_, __args), JniHandleOwnership.TransferLocalRef); return(__ret); } finally { } }
public static void SetupTabItems(this ExtendedTabbedPageRenderer renderer, BottomNavigationViewEx bottomNav) { var element = renderer.Element; var menu = (BottomNavigationMenu)bottomNav.Menu; menu.ClearAll(); var tabsCount = Math.Min(element.Children.Count, bottomNav.MaxItemCount); for (int i = 0; i < tabsCount; i++) { var page = element.Children[i]; var menuItem = menu.Add(0, i, 0, page.Title); var setter = ExtendedTabbedPageRenderer.MenuItemIconSetter ?? ExtendedTabbedPageRenderer.DefaultMenuItemIconSetter; setter.Invoke(menuItem, page.Icon, renderer.LastSelectedIndex == i); } if (element.Children.Count > 0) { bottomNav.EnableShiftingMode(false); bottomNav.EnableItemShiftingMode(false); bottomNav.EnableAnimation(false); bottomNav.SetTextVisibility(false); bottomNav.SetBackgroundResource(Resource.Drawable.bottom_nav_bg); bottomNav.SetIconSize(24, 24); bottomNav.SetIconsMarginTop(32); if (element.Children.Count > 3) { bottomNav.SetIconSizeAt(3, 29, 29); bottomNav.SetIconMarginTop(3, 28); } var stateList = new global::Android.Content.Res.ColorStateList( new int[][] { new int[] { global::Android.Resource.Attribute.StateChecked }, new int[] { global::Android.Resource.Attribute.StateEnabled } }, new int[] { element.TintColor.ToAndroid(), // Selected Color.FromHex("A1A1A1").ToAndroid() // Normal }); bottomNav.ItemIconTintList = stateList; } }
void UpdateBackgroundColor() { if (_disposed) { return; } Color bgColor = Element.BackgroundColor; int[][] States = { new int[0] }; CardBackgroundColor = new global::Android.Content.Res.ColorStateList ( States, new int[] { bgColor.IsDefault?AColor.White: bgColor.ToAndroid() } ); }
public virtual unsafe void SetColorStateList(global::Android.Content.Res.ColorStateList p0) { if (id_setColorStateList_Landroid_content_res_ColorStateList_ == IntPtr.Zero) { id_setColorStateList_Landroid_content_res_ColorStateList_ = JNIEnv.GetMethodID(class_ref, "setColorStateList", "(Landroid/content/res/ColorStateList;)V"); } try { JValue *__args = stackalloc JValue [1]; __args [0] = new JValue(p0); if (GetType() == ThresholdType) { JNIEnv.CallVoidMethod(Handle, id_setColorStateList_Landroid_content_res_ColorStateList_, __args); } else { JNIEnv.CallNonvirtualVoidMethod(Handle, ThresholdClass, JNIEnv.GetMethodID(ThresholdClass, "setColorStateList", "(Landroid/content/res/ColorStateList;)V"), __args); } } finally { } }
public static Color ToEto(this global::Android.Content.Res.ColorStateList colors) { return(Color.FromArgb(colors.DefaultColor)); }
static void n_SetColorStateList_Landroid_content_res_ColorStateList_(IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { global::Org.Adw.Library.Widgets.Discreteseekbar.Internal.Drawable.StateDrawable __this = global::Java.Lang.Object.GetObject <global::Org.Adw.Library.Widgets.Discreteseekbar.Internal.Drawable.StateDrawable> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); global::Android.Content.Res.ColorStateList p0 = global::Java.Lang.Object.GetObject <global::Android.Content.Res.ColorStateList> (native_p0, JniHandleOwnership.DoNotTransfer); __this.SetColorStateList(p0); }