fix padding between title and input text if title has more than one line
This commit is contained in:
parent
af82888424
commit
6fa05b0748
1 changed files with 13 additions and 5 deletions
|
@ -3,7 +3,6 @@ package net.osmand.plus.widgets;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
|
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
|
||||||
|
@ -38,9 +37,18 @@ public class OsmandTextFieldBoxes extends TextFieldBoxes {
|
||||||
@Override
|
@Override
|
||||||
public void setLabelText(String labelText) {
|
public void setLabelText(String labelText) {
|
||||||
super.setLabelText(labelText);
|
super.setLabelText(labelText);
|
||||||
if (!floatingLabel.isSingleLine()) {
|
floatingLabel.post(new Runnable() {
|
||||||
RelativeLayout.LayoutParams rl = (RelativeLayout.LayoutParams) floatingLabel.getLayoutParams();
|
@Override
|
||||||
rl.bottomMargin = rl.topMargin;
|
public void run() {
|
||||||
}
|
if (floatingLabel.getLineCount() > 1) {
|
||||||
|
inputLayout.setPadding(
|
||||||
|
inputLayout.getPaddingLeft(),
|
||||||
|
inputLayout.getPaddingTop() + getResources().getDimensionPixelSize(R.dimen.pages_item_padding),
|
||||||
|
inputLayout.getPaddingRight(),
|
||||||
|
inputLayout.getPaddingBottom()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue