refactored some code
This commit is contained in:
parent
c4eec1267c
commit
c56c9b3165
1 changed files with 3 additions and 3 deletions
|
@ -42,12 +42,12 @@ public class TransportStopRouteAdapter extends ArrayAdapter<TransportStopRoute>
|
|||
if (transportStopRoute != null) {
|
||||
TextView transportStopRouteTextView = (TextView) convertView.findViewById(R.id.transport_stop_route_text);
|
||||
String routeNumber = transportStopRoute.route.getRef();
|
||||
if (routeNumber.length() > 4) {
|
||||
routeNumber = routeNumber.substring(0, 4);
|
||||
}
|
||||
if (routeNumber.contains(":")) {
|
||||
routeNumber = routeNumber.substring(0, routeNumber.lastIndexOf(':'));
|
||||
}
|
||||
if (routeNumber.length() > 4) {
|
||||
routeNumber = routeNumber.substring(0, 4);
|
||||
}
|
||||
transportStopRouteTextView.setText(routeNumber);
|
||||
GradientDrawable gradientDrawableBg = (GradientDrawable) transportStopRouteTextView.getBackground();
|
||||
gradientDrawableBg.setColor(transportStopRoute.getColor(app, nightMode));
|
||||
|
|
Loading…
Reference in a new issue