Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Altonss committed Nov 6, 2024
1 parent 17549a2 commit c9d30b2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ internal abstract class BaseViewHolder(v: View) : RecyclerView.ViewHolder(v) {
if (position == null) {
visibility = GONE
} else {
text = "${context.getString(R.string.platform, position.toString())}"
text = context.getString(R.string.platform, position.toString())
visibility = VISIBLE
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ internal class TripDrawer(context: Context) : MapDrawer(context) {
@ColorInt
private fun getBackgroundColor(leg: Leg): Int {
if (leg is Public) {
val line = leg.line
return TransportrUtils.getLineColor(context, line)
return TransportrUtils.getLineColor(context, leg.line)
}
return ContextCompat.getColor(context, R.color.walking)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ internal object TripUtils {
if (leg is Trip.Public) {
// show departure position if existing
if (leg.departurePosition != null) {
str += " (" + context.getString(R.string.platform, leg.departurePosition.toString()) +")"
str += " (${context.getString(R.string.platform, leg.departurePosition.toString())})"
}
str += "\n ${getEmojiForProduct(leg.line?.product)} "
leg.line?.label?.let {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/de/grobox/transportr/ui/LineView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class LineView(context: Context, attr: AttributeSet?) : AppCompatTextView(contex

// set colored label
text = line.label
if (foregroundColor != null) setTextColor(getTextColorBasedOnBackground(backgroundColor))
setTextColor(foregroundColor)
}

fun setWalk() {
Expand Down

0 comments on commit c9d30b2

Please sign in to comment.