forked from organicmaps/organicmaps
[android] Review fixes.
This commit is contained in:
parent
fb42e62573
commit
78fb143a79
4 changed files with 12 additions and 16 deletions
|
@ -300,7 +300,7 @@ Java_com_mapswithme_maps_editor_OpeningHours_nativeTimetablesFromString(JNIEnv *
|
|||
{
|
||||
TimeTableSet tts;
|
||||
string const source = jni::ToNativeString(env, jSource);
|
||||
if (source.length() != 0 && MakeTimeTableSet(OpeningHours(source), tts))
|
||||
if (!source.empty() && MakeTimeTableSet(OpeningHours(source), tts))
|
||||
return JavaTimetables(env, tts);
|
||||
|
||||
return nullptr;
|
||||
|
|
|
@ -58,9 +58,7 @@
|
|||
android:background="?clickableBackground"
|
||||
android:lineSpacingExtra="@dimen/margin_base"
|
||||
android:textAppearance="@style/MwmTextAppearance.PlacePage"
|
||||
android:visibility="visible"
|
||||
tools:text="Mo-Fr 16:00-18.00\nSu 16:00-18.00"
|
||||
tools:visibility="visible"/>
|
||||
tools:text="Mo-Fr 16:00-18.00\nSu 16:00-18.00"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/edit_opening_hours"
|
||||
|
@ -73,7 +71,6 @@
|
|||
android:text="@string/edit_opening_hours"
|
||||
android:textAllCaps="true"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textColor="?colorAccent"
|
||||
android:visibility="gone"/>
|
||||
android:textColor="?colorAccent"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -26,7 +26,7 @@ public class HoursMinutes implements Parcelable
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format(Locale.getDefault(), "%02d:%02d", hours, minutes);
|
||||
return String.format(Locale.US, "%02d:%02d", hours, minutes);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -465,9 +465,9 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
|
|||
final Resources resources = getResources();
|
||||
if (timetables[0].isFullWeek())
|
||||
{
|
||||
refreshTodayOh((timetables[0].isFullday ? resources.getString(R.string.twentyfour_seven)
|
||||
: resources.getString(R.string.daily) + " " + timetables[0].workingTimespan),
|
||||
ThemeUtils.getColor(getContext(), android.R.attr.textColorPrimary));
|
||||
refreshTodayOpeningHours((timetables[0].isFullday ? resources.getString(R.string.twentyfour_seven)
|
||||
: resources.getString(R.string.daily) + " " + timetables[0].workingTimespan),
|
||||
ThemeUtils.getColor(getContext(), android.R.attr.textColorPrimary));
|
||||
UiUtils.hide(mFullOpeningHours);
|
||||
return;
|
||||
}
|
||||
|
@ -479,21 +479,20 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
|
|||
if (tt.containsWeekday(currentDay))
|
||||
{
|
||||
containsCurrentWeekday = true;
|
||||
refreshTodayOh(resources.getString(R.string.today) + " " + tt.workingTimespan,
|
||||
ThemeUtils.getColor(getContext(), android.R.attr.textColorPrimary));
|
||||
refreshTodayOpeningHours(resources.getString(R.string.today) + " " + tt.workingTimespan,
|
||||
ThemeUtils.getColor(getContext(), android.R.attr.textColorPrimary));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UiUtils.setTextAndShow(mFullOpeningHours, TimeFormatUtils.formatTimetables(timetables));
|
||||
if (!containsCurrentWeekday)
|
||||
refreshTodayOh(resources.getString(R.string.day_off_today), resources.getColor(R.color.base_red));
|
||||
refreshTodayOpeningHours(resources.getString(R.string.day_off_today), resources.getColor(R.color.base_red));
|
||||
}
|
||||
|
||||
private void refreshTodayOh(String text, @ColorInt int color)
|
||||
private void refreshTodayOpeningHours(String text, @ColorInt int color)
|
||||
{
|
||||
UiUtils.show(mTodayOpeningHours);
|
||||
mTodayOpeningHours.setText(text);
|
||||
UiUtils.setTextAndShow(mTodayOpeningHours, text);
|
||||
mTodayOpeningHours.setTextColor(color);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue