TripsGalleryAdapter: Move warning icon to the top.

This commit is contained in:
Andreas Schildbach 2018-11-13 13:52:34 +01:00
parent 8ddb6f7aae
commit 2d3e76f534
2 changed files with 4 additions and 3 deletions

View file

@ -167,7 +167,7 @@ public class TripsGallery extends Gallery {
// padding
final long timeDiff = LongMath.checkedSubtract(maxTime, minTime);
long timePadding = timeDiff / 15;
long timePadding = timeDiff / 12;
if (timeDiff < DateUtils.MINUTE_IN_MILLIS * 30) // zoom limit
timePadding = (DateUtils.MINUTE_IN_MILLIS * 30 - timeDiff) / 2;
if (timePadding < DateUtils.MINUTE_IN_MILLIS) // minimum padding

View file

@ -322,8 +322,9 @@ public final class TripsGalleryAdapter extends BaseAdapter {
if (!trip.isTravelable()) {
final int warningWidth = warningIcon.getIntrinsicWidth();
final int warningLeft = centerX - warningWidth / 2;
warningIcon.setBounds(warningLeft, height - warningIcon.getIntrinsicHeight(),
warningLeft + warningWidth, height);
final int warningPaddingTop = (int) (4 * density);
warningIcon.setBounds(warningLeft, warningPaddingTop, warningLeft + warningWidth,
warningPaddingTop + warningIcon.getIntrinsicHeight());
warningIcon.draw(canvas);
}