2020.09.01.

Xamarin.Forms – Android – change the Theme at runtime

This project you can find at: https://github.com/officialdoniald/Xamarin.Forms—Change-Android-Theme-at-runtime In the .NET Standard/PCL Project we can’t say that, please change the Theme right now, because wehave to implement some platform specific implementation in the Android project. How can the two project communicate? Now, we will see another way, unlike the previous ones, we will use events, not dependency service. So, let’s create our event class in the […]

2020.09.01.

Xamarin.Android.SerialPort

This project you can find at: https://github.com/officialdoniald/Xamarin.Android.SerialPort. Serial Port wrapper for Xamarin.Android. If you want to change some feature of the Serial Port, just clone this repo and change it. In the SerialPort project you have to go to the SerialPortWrapper folder and the SerialPort.cs. After the update you have to Rebuild, and if you want to use the recently updatet SerialPort class, you have […]

2020.09.01.

Xamarin.Android.CanBus

This project you can find at: https://github.com/officialdoniald/Xamarin.Android.Canbus. Usage: Don’t forget to copy the lib folder to your project! First step: copy the lib folder to you project. You have to change the Properties of theese files: libcanbus.so: AndroidNativeLibrary canbus_helper.jar: AndroidJavaLibrary canbus_micro_fixed.jar: AndroidJavaLibrary Create Canbus: Canbus _canbus = _canbus = new Canbus(250000); _canbus.PackageReceive += Canbus_PackageReceive; _canbus.CanbusStatusChanged += Canbus_CanbusStatusChanged; _canbus.CanbusExceptionOccour += Canbus_CanbusExceptionOccour; Read from the Canbus: Sending […]

2020.09.01.

Xamarin.Forms – CustomMasterDetailPage – change navigation icon(back button and “hamburger” menu button) – Android

This project, you can find at: https://github.com/officialdoniald/Xamarin.Forms.CustomControls We have to create some platforms specific code (custom NavigationPage Renderer), because in the base Xamarin.Forms code, we can’t find this implementation. So first step, we have to create a class in the .NET Standard/PCL project: CustomMasterDetailPage( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/MasterDetailPage/CustomMasterDetailPage.cs ). using Xamarin.Forms; using XamarinForms.CustomControls.Enums; namespace XamarinForms.CustomControls.MasterDetailPage { public class CustomMasterDetailPage : Xamarin.Forms.MasterDetailPage { public CustomMasterDetailPage() : base() { } […]

2020.09.01.

Xamarin.Forms – change cursor’s color – Android

This code (https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls.Android/CustomRenderer/CustomEntryRenderer.cs ) : IntPtr IntPtrtextViewClass = JNIEnv.FindClass(typeof(TextView)); IntPtr mCursorDrawableResProperty = JNIEnv.GetFieldID(IntPtrtextViewClass, “mCursorDrawableRes”, “I”); will change the cursor’s color. If you want to really change the color of the cursor, you have to create in the Resources/Drawable folder a my_cursor.xml file: https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls.Android/Resources/drawable/my_cursor.xml <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”@color/colorCursors”></solid> <size android:width=”2dp” /> </shape> @color/colorCursors is a color from the Resources/values/color.xml. If you don’t have this file, […]

2020.09.01.

Xamarin.Forms – CustomSearchBar

This project, you can find at: https://github.com/officialdoniald/Xamarin.Forms.CustomControls We have to create some platforms specific code (custom NavigationPage Renderer), because in the base Xamarin.Forms code, we can’t find this implementation. So first step, we have to create a class in the .NET Standard/PCL project: CustomSearchBar ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/SearchBar/CustomSearchBar.cs ). using Xamarin.Forms; namespace XamarinForms.CustomControls.SearchBar { public class CustomSearchBar : Xamarin.Forms.SearchBar { public static readonly BindableProperty BorderColorProperty = BindableProperty.Create(nameof(BorderColor), […]

2020.09.01.

Xamarin.Forms – CustomEntry (BorderWidth, BorderColor and TextPadding)

This project, you can find at: https://github.com/officialdoniald/Xamarin.Forms.CustomControls We have to create some platforms specific code (custom NavigationPage Renderer), because in the base Xamarin.Forms code, we can’t find this implementation. So first step, we have to create a class in the .NET Standard/PCL project: CustomEntry ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/Entry/CustomEntry.cs ). using Xamarin.Forms; namespace XamarinForms.CustomControls.Entry { public class CustomEntry : Xamarin.Forms.Entry { public static readonly BindableProperty BorderColorProperty = BindableProperty.Create(nameof(BorderColor), […]

2020.09.01.

Xamarin.Forms – ListView – CustomTextCell

This project, you can find at: https://github.com/officialdoniald/Xamarin.Forms.CustomControls We have to create some platforms specific code (custom NavigationPage Renderer), because in the base Xamarin.Forms code, we can’t find this implementation. So first step, we have to create a class in the .NET Standard/PCL project: CustomTextCell ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/ListView/CustomTextCell.cs ). using Xamarin.Forms; namespace XamarinForms.CustomControls.ListView { public class CustomTextCell : TextCell { public static readonly BindableProperty TextFontSizeProperty = BindableProperty.Create(“TextFontSize”, […]

2020.09.01.

Xamarin.Forms – NavigationPage Horizontal Alignment Center Title on Android

This project, you can find at: https://github.com/officialdoniald/Xamarin.Forms.CustomControls We have to create some platforms specific code (custom NavigationPage Renderer), because in the base Xamarin.Forms code, we can’t find this implementation. So first step, we have to create a class in the .NET Standard/PCL project: CustomNavigationPage ( https://github.com/officialdoniald/Xamarin.Forms.CustomControls/blob/master/XamarinForms.CustomControls/XamarinForms.CustomControls/NavigationPage/CustomNavigationPage.cs ). using Xamarin.Forms; using XamarinForms.CustomControls.Enums; namespace XamarinForms.CustomControls.NavigationPage { public class CustomNavigationPage : Xamarin.Forms.NavigationPage { public CustomNavigationPage() : base() { […]

2020.09.01.

XamarinClearCookies

With this Package you can clear all applicaion’s cookies. So if you are already logged in with your social media account you can simply log out with this. NOTE: This NuGetPackage will create 2 other folders: iOS and Droid. These two folders you have to move to the each Platform’s project like this: Droid/ClearCookies folder -> <your_project_name>.Droid iOS/ClearCookies folder -> <your_project_name>.iOS Usage: bool success = […]