Skip to content

Instantly share code, notes, and snippets.

View devcrux's full-sized avatar
🏠
Working from home

Oludayo Alli devcrux

🏠
Working from home
View GitHub Profile
@devcrux
devcrux / open_email_app.kt
Created November 17, 2021 10:59 — forked from hetang/open_email_app.kt
Open Email inbox or compose view in Android
/**
* This function open email compose view and post HTML body
**/
// val body = Html.fromHtml(fragment.resources.getString(R.string.email_body))
fun navToEmailCompose(email: String, subject: String, body: String) {
val intent = Intent(Intent.ACTION_SENDTO,
Uri.parse("mailto:${email}"))
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject)
intent.putExtra(android.content.Intent.EXTRA_TEXT, body)
startActivity(Intent.createChooser(intent, "Email"))
@devcrux
devcrux / circulargrid.xaml
Created July 6, 2020 09:05
Show how to create a circular grid using the EllipseGeometry
<Grid HeightRequest="50" WidthRequest="50">
<Grid.Clip>
<EllipseGeometry RadiusX="25" RadiusY="25" Center="25,25"/>
</Grid.Clip>
</Grid>
@devcrux
devcrux / trapeziumgrid.xaml
Created July 6, 2020 08:56
Showing how to create a trapezium grid using the PathGeometry
<Grid>
<Grid.Clip>
<PathGeometry Figures="M20 96.5596C20 92.4719 22.0807 88.6655 25.5215 86.4586L146.521 8.85176C154.508 3.72922 165 9.46434 165 18.9527V185C165 191.627 159.627 197 153 197H32C25.3726 197 20 191.627 20 185V96.5596Z"/>
</Grid.Clip>
</Grid>
@devcrux
devcrux / geolocation.cs
Created April 7, 2020 17:32
Getting geolocation in xamarin forms
try
{
var location = await Geolocation.GetLastKnownLocationAsync();
if (location != null)
{
Console.WriteLine($"Latitude: {location.Latitude}, Longitude: {location.Longitude}, Altitude: {location.Altitude}");
}
}
catch (Exception ex)