fix top padding of TextFieldBoxes
This commit is contained in:
parent
b8787e4121
commit
e748bbd03e
3 changed files with 19 additions and 3 deletions
|
@ -123,8 +123,8 @@ public class OnlineRoutingCard extends BaseCard {
|
|||
}
|
||||
|
||||
public void setSelectionMenu(@NonNull List<HorizontalSelectionItem> items,
|
||||
@NonNull String selectedItemTitle,
|
||||
@NonNull final CallbackWithObject<HorizontalSelectionItem> callback) {
|
||||
@NonNull String selectedItemTitle,
|
||||
@NonNull final CallbackWithObject<HorizontalSelectionItem> callback) {
|
||||
showElements(rvSelectionMenu);
|
||||
rvSelectionMenu.setLayoutManager(
|
||||
new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false));
|
||||
|
@ -166,6 +166,10 @@ public class OnlineRoutingCard extends BaseCard {
|
|||
textFieldBoxes.setLabelText(labelText);
|
||||
}
|
||||
|
||||
public void hideFieldBoxLabel() {
|
||||
textFieldBoxes.makeCompactPadding();
|
||||
}
|
||||
|
||||
public void setFieldBoxHelperText(@NonNull String helperText) {
|
||||
showElements(fieldBoxContainer, tvHelperText);
|
||||
fieldBoxHelperTextShowed = true;
|
||||
|
@ -202,7 +206,7 @@ public class OnlineRoutingCard extends BaseCard {
|
|||
}
|
||||
|
||||
public void setButton(@NonNull String title,
|
||||
@NonNull OnClickListener listener) {
|
||||
@NonNull OnClickListener listener) {
|
||||
showElements(button);
|
||||
button.setOnClickListener(listener);
|
||||
UiUtilities.setupDialogButton(nightMode, button, DialogButtonType.PRIMARY, title);
|
||||
|
|
|
@ -359,6 +359,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment {
|
|||
exampleCard = new OnlineRoutingCard(mapActivity, isNightMode(), appMode);
|
||||
exampleCard.build(mapActivity);
|
||||
exampleCard.setHeaderTitle(getString(R.string.shared_string_example));
|
||||
exampleCard.hideFieldBoxLabel();
|
||||
List<HorizontalSelectionItem> locationItems = new ArrayList<>();
|
||||
for (ExampleLocation location : ExampleLocation.values()) {
|
||||
locationItems.add(new HorizontalSelectionItem(location.getName(), location));
|
||||
|
|
|
@ -2,6 +2,9 @@ package net.osmand.plus.widgets;
|
|||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
|
||||
import studio.carbonylgroup.textfieldboxes.TextFieldBoxes;
|
||||
|
||||
|
@ -19,4 +22,12 @@ public class OsmandTextFieldBoxes extends TextFieldBoxes {
|
|||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public void makeCompactPadding() {
|
||||
floatingLabel.setVisibility(View.GONE);
|
||||
labelSpace.setVisibility(View.GONE);
|
||||
labelSpaceBelow.setVisibility(View.GONE);
|
||||
int paddingH = getResources().getDimensionPixelSize(R.dimen.route_info_card_details_margin);
|
||||
inputLayout.setPadding(0, paddingH, 0, paddingH);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue