forked from organicmaps/organicmaps
[android] tiny optimization
This commit is contained in:
parent
7ec911802a
commit
ecd55d1ce8
1 changed files with 4 additions and 2 deletions
|
@ -108,13 +108,15 @@ public class FloatingMarkerView extends MarkerView
|
|||
{
|
||||
LayoutParams layoutParams = (LayoutParams) mTextContentContainer.getLayoutParams();
|
||||
float posY = entry.getY();
|
||||
if (posY + convertContainerHeight() / 2f >= getChartView().getYChartMax())
|
||||
float halfContent = convertContainerHeight() / 2f;
|
||||
|
||||
if (posY + halfContent >= getChartView().getYChartMax())
|
||||
{
|
||||
layoutParams.addRule(ALIGN_PARENT_BOTTOM);
|
||||
layoutParams.removeRule(ALIGN_PARENT_TOP);
|
||||
layoutParams.removeRule(CENTER_VERTICAL);
|
||||
}
|
||||
else if (posY - convertContainerHeight() / 2f <= getChartView().getYChartMin())
|
||||
else if (posY - halfContent <= getChartView().getYChartMin())
|
||||
{
|
||||
layoutParams.addRule(ALIGN_PARENT_TOP);
|
||||
layoutParams.removeRule(ALIGN_PARENT_BOTTOM);
|
||||
|
|
Loading…
Add table
Reference in a new issue