diff --git a/src/Android/Renderers/CipherViewCellRenderer.cs b/src/Android/Renderers/CipherViewCellRenderer.cs index 3e7775a99..7ed6f9f91 100644 --- a/src/Android/Renderers/CipherViewCellRenderer.cs +++ b/src/Android/Renderers/CipherViewCellRenderer.cs @@ -23,6 +23,9 @@ namespace Bit.Droid.Renderers { private static Typeface _faTypeface; private static Typeface _miTypeface; + private static Android.Graphics.Color _textColor; + private static Android.Graphics.Color _mutedColor; + private static Android.Graphics.Color _disabledIconColor; private AndroidCipherCell _cell; @@ -37,6 +40,22 @@ namespace Bit.Droid.Renderers { _miTypeface = Typeface.CreateFromAsset(context.Assets, "MaterialIcons_Regular.ttf"); } + if(_textColor == default(Android.Graphics.Color)) + { + _textColor = ((Xamarin.Forms.Color)Xamarin.Forms.Application.Current.Resources["TextColor"]) + .ToAndroid(); + } + if(_mutedColor == default(Android.Graphics.Color)) + { + _mutedColor = ((Xamarin.Forms.Color)Xamarin.Forms.Application.Current.Resources["MutedColor"]) + .ToAndroid(); + } + if(_disabledIconColor == default(Android.Graphics.Color)) + { + _disabledIconColor = + ((Xamarin.Forms.Color)Xamarin.Forms.Application.Current.Resources["DisabledIconColor"]) + .ToAndroid(); + } var cipherCell = item as CipherViewCell; _cell = convertView as AndroidCipherCell; @@ -50,6 +69,7 @@ namespace Bit.Droid.Renderers } cipherCell.PropertyChanged += CellPropertyChanged; _cell.UpdateCell(cipherCell); + _cell.UpdateColors(_textColor, _mutedColor, _disabledIconColor); return _cell; } @@ -156,6 +176,17 @@ namespace Bit.Droid.Renderers } } + public void UpdateColors(Android.Graphics.Color textColor, Android.Graphics.Color mutedColor, + Android.Graphics.Color iconDisabledColor) + { + Name.SetTextColor(textColor); + SubTitle.SetTextColor(mutedColor); + Icon.SetTextColor(mutedColor); + SharedIcon.SetTextColor(mutedColor); + AttachmentsIcon.SetTextColor(mutedColor); + MoreButton.SetTextColor(iconDisabledColor); + } + private void MoreButton_Click(object sender, EventArgs e) { if(CipherViewCell.ButtonCommand?.CanExecute(CipherViewCell.Cipher) ?? false) diff --git a/src/App/Styles/Base.xaml b/src/App/Styles/Base.xaml index 6d463ed63..3598c8f94 100644 --- a/src/App/Styles/Base.xaml +++ b/src/App/Styles/Base.xaml @@ -2,7 +2,6 @@