<commit_before>﻿using Xamarin.Forms;
using Android.Graphics;
using Android.Widget;
using Xamarin.Forms.Platform.Android;
using Xamarin.CommunityToolkit.UI.Views.Options;
using Android.Util;
#if MONOANDROID10_0
using AndroidSnackBar = Google.Android.Material.Snackbar.Snackbar;
#else
using AndroidSnackBar = Android.Support.Design.Widget.Snackbar;
#endif

namespace Xamarin.CommunityToolkit.UI.Views
{
	class SnackBar
	{
		internal void Show(Page sender, SnackBarOptions arguments)
		{
			var view = Platform.GetRenderer(sender).View;
			var snackBar = AndroidSnackBar.Make(view, arguments.MessageOptions.Message, (int)arguments.Duration.TotalMilliseconds);
			var snackBarView = snackBar.View;
			snackBarView.SetBackgroundColor(arguments.BackgroundColor.ToAndroid());

			var snackTextView = snackBarView.FindViewById<TextView>(Resource.Id.snackbar_text);
			snackTextView.SetMaxLines(10);
			snackTextView.SetTextColor(arguments.MessageOptions.Foreground.ToAndroid());
			snackTextView.SetTextSize(ComplexUnitType.Pt, (float)arguments.MessageOptions.FontSize);
			snackTextView.LayoutDirection = arguments.IsRtl
				? global::Android.Views.LayoutDirection.Rtl
				: global::Android.Views.LayoutDirection.Inherit;

			foreach (var action in arguments.Actions)
			{
				snackBar.SetAction(action.Text, async v => await action.Action());
				snackBar.SetActionTextColor(action.ForegroundColor.ToAndroid());
				var snackActionButtonView = snackBarView.FindViewById<TextView>(Resource.Id.snackbar_action);
				snackActionButtonView.SetBackgroundColor(action.BackgroundColor.ToAndroid());
				snackActionButtonView.SetTextSize(ComplexUnitType.Pt, (float)action.FontSize);
				snackActionButtonView.LayoutDirection = arguments.IsRtl
					? global::Android.Views.LayoutDirection.Rtl
					: global::Android.Views.LayoutDirection.Inherit;
			}

			snackBar.AddCallback(new SnackBarCallback(arguments));<commit_msg>Fix Android font size (#626)<commit_after>﻿using Xamarin.Forms;
using Android.Graphics;
using Android.Widget;
using Xamarin.Forms.Platform.Android;
using Xamarin.CommunityToolkit.UI.Views.Options;
using Android.Util;
#if MONOANDROID10_0
using AndroidSnackBar = Google.Android.Material.Snackbar.Snackbar;
#else
using AndroidSnackBar = Android.Support.Design.Widget.Snackbar;
#endif

namespace Xamarin.CommunityToolkit.UI.Views
{
	class SnackBar
	{
		internal void Show(Page sender, SnackBarOptions arguments)
		{
			var view = Platform.GetRenderer(sender).View;
			var snackBar = AndroidSnackBar.Make(view, arguments.MessageOptions.Message, (int)arguments.Duration.TotalMilliseconds);
			var snackBarView = snackBar.View;
			snackBarView.SetBackgroundColor(arguments.BackgroundColor.ToAndroid());

			var snackTextView = snackBarView.FindViewById<TextView>(Resource.Id.snackbar_text);
			snackTextView.SetMaxLines(10);
			snackTextView.SetTextColor(arguments.MessageOptions.Foreground.ToAndroid());
			snackTextView.SetTextSize(ComplexUnitType.Px, (float)arguments.MessageOptions.FontSize);
			snackTextView.LayoutDirection = arguments.IsRtl
				? global::Android.Views.LayoutDirection.Rtl
				: global::Android.Views.LayoutDirection.Inherit;

			foreach (var action in arguments.Actions)
			{
				snackBar.SetAction(action.Text, async v => await action.Action());
				snackBar.SetActionTextColor(action.ForegroundColor.ToAndroid());
				var snackActionButtonView = snackBarView.FindViewById<TextView>(Resource.Id.snackbar_action);
				snackActionButtonView.SetBackgroundColor(action.BackgroundColor.ToAndroid());
				snackActionButtonView.SetTextSize(ComplexUnitType.Px, (float)action.FontSize);
				snackActionButtonView.LayoutDirection = arguments.IsRtl
					? global::Android.Views.LayoutDirection.Rtl
					: global::Android.Views.LayoutDirection.Inherit;
			}

			snackBar.AddCallback(new SnackBarCallback(arguments));
{'fraction_non_alphanumeric': 0.10263776442935492, 'fraction_numerical': 0.0033951423348132673, 'mean_word_length': 6.158878504672897, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2408156', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1133, 'n_words': 159}