summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2017-08-23 21:40:19 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-08-29 11:52:03 (GMT)
commit8510bfb3a32fd82146747aa301b2f1ca7a249675 (patch)
tree3e240f27a01afd3125f1f220ac92b783059c39e1 /Xamarin.Forms.Platform.Android
parentb6c1b60fa65889c87f7d42a6fbe8a6c9411f0c37 (diff)
downloadxamarin-forms-8510bfb3a32fd82146747aa301b2f1ca7a249675.zip
xamarin-forms-8510bfb3a32fd82146747aa301b2f1ca7a249675.tar.gz
xamarin-forms-8510bfb3a32fd82146747aa301b2f1ca7a249675.tar.bz2
[Android] Fix bugzilla58868 (#1106)
* [Android] Only set elevation in Lolipop or newer * Update submodule
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Platform.cs22
1 files changed, 14 insertions, 8 deletions
diff --git a/Xamarin.Forms.Platform.Android/Platform.cs b/Xamarin.Forms.Platform.Android/Platform.cs
index 322de26..c0fc209 100644
--- a/Xamarin.Forms.Platform.Android/Platform.cs
+++ b/Xamarin.Forms.Platform.Android/Platform.cs
@@ -1134,17 +1134,23 @@ namespace Xamarin.Forms.Platform.Android
{
//On Material design the button states use Elevation property, we need to make sure
//we update the elevation of other controls to be over the previous one
- if (!_minimumElevation.ContainsKey(i))
- _minimumElevation[i] = GetChildAt(i).Elevation;
- for (int j = 0; j < _minimumElevation.Count() - 1; j++)
+ if (Forms.IsLollipopOrNewer)
{
- while (_minimumElevation[j] > _minimumElevation[j + 1])
+ if (!_minimumElevation.ContainsKey(i))
{
- _minimumElevation[j + 1] = _minimumElevation[j] + 1;
- GetChildAt(j + 1).Elevation = _minimumElevation[j + 1];
+ _minimumElevation[i] = GetChildAt(i).Elevation;
+ }
+
+ for (int j = 0; j < _minimumElevation.Count() - 1; j++)
+ {
+ while (_minimumElevation[j] > _minimumElevation[j + 1])
+ {
+ _minimumElevation[j + 1] = _minimumElevation[j] + 1;
+ GetChildAt(j + 1).Elevation = _minimumElevation[j + 1];
+ }
+ if (j == i)
+ break;
}
- if (j == i)
- break;
}
return base.GetChildDrawingOrder(childCount, i);
}