mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
Fix for Android 5.x crash caused by new switch styling (#1575)
This commit is contained in:
parent
fc1000acc1
commit
4669275680
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
using Android.Content;
|
||||
using Android.Content.Res;
|
||||
using Android.Graphics.Drawables;
|
||||
using Android.OS;
|
||||
using AndroidX.Core.Content.Resources;
|
||||
using Bit.Droid.Renderers;
|
||||
using Bit.Droid.Utilities;
|
||||
|
@ -35,6 +36,12 @@ namespace Bit.Droid.Renderers
|
|||
|
||||
private void UpdateColors()
|
||||
{
|
||||
if (Build.VERSION.SdkInt <= BuildVersionCodes.LollipopMr1)
|
||||
{
|
||||
// Android 5.x doesn't support ThumbTintList, and using SwitchCompat on every version after 5.x
|
||||
// doesn't apply tinting the way we want. Let 5.x to do its own thing here.
|
||||
return;
|
||||
}
|
||||
if (Control != null)
|
||||
{
|
||||
var t = ResourcesCompat.GetDrawable(Resources, Resource.Drawable.switch_thumb, null);
|
||||
|
|
Loading…
Reference in a new issue