add padding to title on inActive poi

This commit is contained in:
veliymolfar 2020-06-26 15:19:51 +03:00
parent 04b9a02ccf
commit 4a9c73a5e2

View file

@ -617,11 +617,15 @@ public class RearrangePoiFiltersFragment extends DialogFragment implements Selec
PoiViewHolder h = (PoiViewHolder) holder; PoiViewHolder h = (PoiViewHolder) holder;
PoiUIFilterDataObject poiInfo = (PoiUIFilterDataObject) item.value; PoiUIFilterDataObject poiInfo = (PoiUIFilterDataObject) item.value;
int osmandOrangeColorResId = nightMode ? R.color.osmand_orange_dark : R.color.osmand_orange; int osmandOrangeColorResId = nightMode ? R.color.osmand_orange_dark : R.color.osmand_orange;
boolean isActive = poiInfo.isActive;
h.title.setText(poiInfo.name); h.title.setText(poiInfo.name);
int padding = (int) getResources().getDimension(R.dimen.content_padding);
int paddingSmall = (int) getResources().getDimension(R.dimen.content_padding_small);
h.title.setPadding(isActive ? 0 : padding, paddingSmall, paddingSmall, padding);
boolean userFilter = poiInfo.filterId.startsWith(USER_PREFIX); boolean userFilter = poiInfo.filterId.startsWith(USER_PREFIX);
int iconRes = QuickSearchListItem.getCustomFilterIconRes(poiHelper.getFilterById(poiInfo.filterId)); int iconRes = QuickSearchListItem.getCustomFilterIconRes(poiHelper.getFilterById(poiInfo.filterId));
h.icon.setImageDrawable(uiUtilities.getIcon(userFilter ? iconRes : poiInfo.iconRes, osmandOrangeColorResId)); h.icon.setImageDrawable(uiUtilities.getIcon(userFilter ? iconRes : poiInfo.iconRes, osmandOrangeColorResId));
h.moveIcon.setVisibility(poiInfo.isActive ? View.VISIBLE : View.GONE); h.moveIcon.setVisibility(isActive ? View.VISIBLE : View.GONE);
h.actionIcon.setOnClickListener(new View.OnClickListener() { h.actionIcon.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -631,7 +635,7 @@ public class RearrangePoiFiltersFragment extends DialogFragment implements Selec
} }
} }
}); });
if (poiInfo.isActive) { if (isActive) {
h.actionIcon.setImageDrawable(uiUtilities.getIcon(R.drawable.ic_action_remove, R.color.color_osm_edit_delete)); h.actionIcon.setImageDrawable(uiUtilities.getIcon(R.drawable.ic_action_remove, R.color.color_osm_edit_delete));
h.moveIcon.setOnTouchListener(new View.OnTouchListener() { h.moveIcon.setOnTouchListener(new View.OnTouchListener() {
@Override @Override