diff --git a/src/de/grobox/liberario/TripsActivity.java b/src/de/grobox/liberario/TripsActivity.java index 8d72bb140..3639b0722 100644 --- a/src/de/grobox/liberario/TripsActivity.java +++ b/src/de/grobox/liberario/TripsActivity.java @@ -271,17 +271,19 @@ static public void addLineBox(Context context, ViewGroup lineLayout, Line line, } TextView transportsView = (TextView) LayoutInflater.from(context).inflate(R.layout.line_box, null); + transportsView.setText(line.label.substring(1)); - GradientDrawable line_box = (GradientDrawable) context.getResources().getDrawable(R.drawable.line_box); - line_box.setColor(line.style.backgroundColor); + if(line.style != null) { + GradientDrawable line_box = (GradientDrawable) context.getResources().getDrawable(R.drawable.line_box); + line_box.setColor(line.style.backgroundColor); - // change shape and mutate before to not share state with other instances - line_box.mutate(); - if(line.style.shape == Shape.CIRCLE) line_box.setShape(GradientDrawable.OVAL); + // change shape and mutate before to not share state with other instances + line_box.mutate(); + if(line.style.shape == Shape.CIRCLE) line_box.setShape(GradientDrawable.OVAL); - transportsView.setText(line.label.substring(1)); - transportsView.setBackgroundDrawable(line_box); - transportsView.setTextColor(line.style.foregroundColor); + transportsView.setBackgroundDrawable(line_box); + transportsView.setTextColor(line.style.foregroundColor); + } // set margin, because setting in in xml didn't work LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);