Skip to content

Instantly share code, notes, and snippets.

View DarkIrata's full-sized avatar
🤔
Loading...

DarkIrata DarkIrata

🤔
Loading...
View GitHub Profile
@DarkIrata
DarkIrata / gist:5cc4b4091233c7b6dffb7e4874e813dc
Created June 1, 2023 09:59
Maui Android PDF Renderer example
namespace TestApp.Platforms.Android.Services
{
internal class PDFRenderService : IPDFRenderService
{
private AppCompatActivity activity;
public PDFRenderService(AppCompatActivity activity)
{
this.activity = activity;
}
@DarkIrata
DarkIrata / App.xaml.cs
Created April 26, 2023 12:38
Android Rippleeffect and Clickable StackLayout
// Code
// Example for ImageButton Background Rippleeffect
Microsoft.Maui.Handlers.ImageButtonHandler.Mapper.AppendToMapping(nameof(IView.Background), (handler, _) =>
{ // Todo: Needs Update after Theme Change so it uses the different Color
#if ANDROID
var contextResourceColor = AndroidX.Core.Content.ContextCompat.GetColor(handler.MauiContext.Context, Resource.Color.ripple_material_light);
var rippleColor = new Android.Graphics.Color(contextResourceColor);
var rippleDrawable = RippleDrawableHelper.GetRippleDrawableByStates(rippleColor);
handler.PlatformView.SetBackground(rippleDrawable);