This commit is contained in:
Alexey Kulish 2017-09-21 11:58:41 +03:00
parent 61e0e6801e
commit 4dfbdb5622
2 changed files with 5 additions and 7 deletions

View file

@ -110,11 +110,11 @@
android:layout_height="wrap_content"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
android:maxLines="1"
tools:text="City" />
</LinearLayout>
<LinearLayout
android:id="@+id/time_layout"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"

View file

@ -358,6 +358,7 @@ public class QuickSearchListAdapter extends ArrayAdapter<QuickSearchListItem> {
group.setVisibility(View.GONE);
}
LinearLayout timeLayout = (LinearLayout) view.findViewById(R.id.time_layout);
TextView timeText = (TextView) view.findViewById(R.id.time);
ImageView timeIcon = (ImageView) view.findViewById(R.id.time_icon);
if (listItem.getSearchResult().object instanceof Amenity
@ -372,19 +373,16 @@ public class QuickSearchListAdapter extends ArrayAdapter<QuickSearchListItem> {
boolean worksLater = rs.isOpenedForTime(inst);
int colorId = worksNow ? worksLater ? R.color.color_ok : R.color.color_intermediate : R.color.color_warning;
timeIcon.setVisibility(View.VISIBLE);
timeText.setVisibility(View.VISIBLE);
timeLayout.setVisibility(View.VISIBLE);
timeIcon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_small_time, colorId));
timeText.setTextColor(app.getResources().getColor(colorId));
String rt = rs.getCurrentRuleTime(inst);
timeText.setText(rt == null ? "" : rt);
} else {
timeIcon.setVisibility(View.GONE);
timeText.setVisibility(View.GONE);
timeLayout.setVisibility(View.GONE);
}
} else {
timeIcon.setVisibility(View.GONE);
timeText.setVisibility(View.GONE);
timeLayout.setVisibility(View.GONE);
}
updateCompassVisibility(view, listItem);