mirror of
https://github.com/bitwarden/android.git
synced 2026-05-22 22:24:37 -05:00
TimePickerHandlerMappings: Remove old code for forcing the Wheel. After testing without it wheel picker is still used so this code shouldn't be needed anymore. AppDelegate.ContinueUserActivity: Uncommented and changed the iOS ContinueUserActivity. It needs to call Platform.ContinueUserActivity according with Xamarin Essentials migration docs.
41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using Bit.App.Controls;
|
|
using Microsoft.Maui.Handlers;
|
|
using UIKit;
|
|
|
|
namespace Bit.iOS.Core.Handlers
|
|
{
|
|
public class TimePickerHandlerMappings
|
|
{
|
|
public static void Setup()
|
|
{
|
|
TimePickerHandler.Mapper.AppendToMapping("CustomDatePickerHandler", (handler, datePicker) =>
|
|
{
|
|
if (datePicker is ExtendedTimePicker extTimePicker)
|
|
{
|
|
// center text
|
|
handler.PlatformView.TextAlignment = UITextAlignment.Center;
|
|
|
|
// use placeholder until NullableDate set
|
|
if (!extTimePicker.NullableTime.HasValue)
|
|
{
|
|
handler.PlatformView.Text = extTimePicker.PlaceHolder;
|
|
}
|
|
}
|
|
});
|
|
|
|
TimePickerHandler.Mapper.AppendToMapping(nameof(ITimePicker.Time), UpdateTextPlaceholderOnFormatLikePlacholder);
|
|
|
|
TimePickerHandler.Mapper.AppendToMapping(nameof(ITimePicker.Format), UpdateTextPlaceholderOnFormatLikePlacholder);
|
|
}
|
|
|
|
private static void UpdateTextPlaceholderOnFormatLikePlacholder(ITimePickerHandler handler, ITimePicker timePicker)
|
|
{
|
|
if (timePicker is ExtendedTimePicker extDatePicker && extDatePicker.Format == extDatePicker.PlaceHolder)
|
|
{
|
|
handler.PlatformView.Text = extDatePicker.PlaceHolder;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|