This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Widget; | |
using Java.Lang; | |
namespace App.Droid.Extensions | |
{ | |
/// <summary> | |
/// Extension method GetItem for <see cref="AdapterView.ItemClickEventArgs"/> | |
/// </summary> | |
/// <seealso cref="https://stackoverflow.com/questions/4819813/how-to-get-text-from-autocomplete-textview-android"/> | |
public static class AdapterView_ItemClickEventArgs_GetItem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Globalization; | |
using System.Linq; | |
using System.Text; | |
namespace Core.Extensions | |
{ | |
public static class String_RemoveDiacritics | |
{ | |
public static string RemoveDiacritics(this string @this) | |
=> string.Concat( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Core.Extensions; | |
namespace Core.ValueTypes | |
{ | |
public class StringCaseInsensitiveUnaccented | |
{ | |
public static bool Compare(string a, string b) | |
=> a.RemoveDiacritics().ToUpper().Equals(b.RemoveDiacritics().ToUpper()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading; | |
namespace Core.Extensions | |
{ | |
public static class CancellationTokenSourceRenew | |
{ | |
public static CancellationTokenSource Renew(this CancellationTokenSource @this) | |
{ | |
Cancel(@this); | |
return new CancellationTokenSource(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UIKit; | |
namespace App.iOS.Extensions | |
{ | |
public static class UIViewController_AddSearchController | |
{ | |
public static UISearchController AddSearchController(this UIViewController @this) | |
{ | |
var searchController = new UISearchController(null as UIViewController); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task pendingTask = null; // pending session | |
CancellationTokenSource cts = null; // CTS for pending session | |
// SpellcheckAsync is called by the client app on the UI thread | |
public async Task<bool> SpellcheckAsync(CancellationToken token) | |
{ | |
// SpellcheckAsync can be re-entered | |
var previousCts = this.cts; | |
var newCts = CancellationTokenSource.CreateLinkedTokenSource(token); | |
this.cts = newCts; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.Graphics.Drawables; | |
using Android.Views; | |
using Android.Widget; | |
namespace App.Droid.Utils | |
{ | |
public static class TextViewDrawableTouchEventHandler | |
{ | |
const int DrawableLeft = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using App.iOS.Utils; | |
using UIKit; | |
namespace App.iOS.Extensions | |
{ | |
//https://stackoverflow.com/questions/48007690/issue-with-uisearchcontroller-in-uitableview-on-ios-11 | |
//https://stackoverflow.com/questions/28326269/uisearchbar-presented-by-uisearchcontroller-in-table-header-view-animates-too-fa?rq=1 | |
public static class UIViewController_AdicionarBarraDeBusca | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UIKit; | |
namespace App.iOS.Extensions | |
{ | |
//https://stackoverflow.com/questions/5484493/changing-the-height-of-a-tableheaderview-hides-the-cells/5764819#5764819 | |
public static class UITableViewAtribuirTableHeaderView | |
{ | |
private static bool VersaoIosBugadaQueNaoAtualizaOTamanhoCorretamenteDoTableHeaderView => | |
!UIDevice.CurrentDevice.CheckSystemVersion(9, 0); |