Skip to content

Instantly share code, notes, and snippets.

View rafaelsteil's full-sized avatar

Rafael Steil rafaelsteil

View GitHub Profile
@rmenezes
rmenezes / FacebookCallback.cs
Last active January 14, 2016 23:44
FacebookCallBack Sample for Xamarin.Android
using System;
using Xamarin.Facebook;
using CupcakeStore.Android.Activities;
using Xamarin.Facebook.Login;
using Android.Runtime;
namespace CupcakeStore.Android
{
public class FacebookCallback<TResult> : Java.Lang.Object, IFacebookCallback
where TResult : Java.Lang.Object
@shekibobo
shekibobo / README.md
Last active March 2, 2020 11:04
Android: Base Styles for Button (not provided by AppCompat)

How to create custom button styles using Android's AppCompat-v7:21

Introduction

AppCompat is an Android support library to provide backwards-compatible functionality for Material design patterns. It currently comes bundled with a set of styles in the Theme.AppCompat and Widget.AppCompat namespaces. However, there is a critical component missing which I would have thought essential to provide the a default from which we could inherit our styles: Widget.AppCompat.Button. Sure, there's Widget.AppCompat.Light.ActionButton, but that doesn't actually inherit from Widget.ActionButton, which does not inherit from Widget.Button, so we might get some unexpected behavior using that as our base button style, mainly because Widget.ActionButton strictly belongs in the ActionBar.

So, if we want to have a decently normal default button style related to AppCompat, we need to make it ourselves. Let's start by digging into the Android SDK to see how it's doing default styles.

Digging In

@rudyryk
rudyryk / TextMeter.cs
Last active August 8, 2021 10:53
C# — Measure string size in Xamarin.Forms for iOS and Android platforms
//
// TextMeter.cs
// Created by Alexey Kinev on 11 Feb 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
// Usage example: