Skip to content

Commit c9d30b2

Browse files
committed
Clean up code
1 parent 17549a2 commit c9d30b2

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

app/src/main/java/de/grobox/transportr/trips/BaseViewHolder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ internal abstract class BaseViewHolder(v: View) : RecyclerView.ViewHolder(v) {
8989
if (position == null) {
9090
visibility = GONE
9191
} else {
92-
text = "${context.getString(R.string.platform, position.toString())}"
92+
text = context.getString(R.string.platform, position.toString())
9393
visibility = VISIBLE
9494
}
9595
}

app/src/main/java/de/grobox/transportr/trips/detail/TripDrawer.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ internal class TripDrawer(context: Context) : MapDrawer(context) {
135135
@ColorInt
136136
private fun getBackgroundColor(leg: Leg): Int {
137137
if (leg is Public) {
138-
val line = leg.line
139-
return TransportrUtils.getLineColor(context, line)
138+
return TransportrUtils.getLineColor(context, leg.line)
140139
}
141140
return ContextCompat.getColor(context, R.color.walking)
142141
}

app/src/main/java/de/grobox/transportr/trips/detail/TripUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ internal object TripUtils {
108108
if (leg is Trip.Public) {
109109
// show departure position if existing
110110
if (leg.departurePosition != null) {
111-
str += " (" + context.getString(R.string.platform, leg.departurePosition.toString()) +")"
111+
str += " (${context.getString(R.string.platform, leg.departurePosition.toString())})"
112112
}
113113
str += "\n ${getEmojiForProduct(leg.line?.product)} "
114114
leg.line?.label?.let {

app/src/main/java/de/grobox/transportr/ui/LineView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class LineView(context: Context, attr: AttributeSet?) : AppCompatTextView(contex
5757

5858
// set colored label
5959
text = line.label
60-
if (foregroundColor != null) setTextColor(getTextColorBasedOnBackground(backgroundColor))
60+
setTextColor(foregroundColor)
6161
}
6262

6363
fun setWalk() {

0 commit comments

Comments
 (0)