diff options
author | Rui Marinho <me@ruimarinho.net> | 2017-08-23 22:40:19 +0100 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-08-29 12:52:03 +0100 |
commit | 8510bfb3a32fd82146747aa301b2f1ca7a249675 (patch) | |
tree | 3e240f27a01afd3125f1f220ac92b783059c39e1 | |
parent | b6c1b60fa65889c87f7d42a6fbe8a6c9411f0c37 (diff) | |
download | xamarin-forms-8510bfb3a32fd82146747aa301b2f1ca7a249675.tar.gz xamarin-forms-8510bfb3a32fd82146747aa301b2f1ca7a249675.tar.bz2 xamarin-forms-8510bfb3a32fd82146747aa301b2f1ca7a249675.zip |
[Android] Fix bugzilla58868 (#1106)
* [Android] Only set elevation in Lolipop or newer
* Update submodule
m--------- | Xamarin.Forms.Build | 0 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Android/Platform.cs | 22 |
2 files changed, 14 insertions, 8 deletions
diff --git a/Xamarin.Forms.Build b/Xamarin.Forms.Build -Subproject 321833ab005b47c6df958a84815b5a8d351f596 +Subproject 56f7f727597b1fea74a6fe1598cef529d02defb diff --git a/Xamarin.Forms.Platform.Android/Platform.cs b/Xamarin.Forms.Platform.Android/Platform.cs index 322de265..c0fc2099 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); } |