diff --git a/app/src/main/java/de/tobiasschuerg/weekview/sample/SampleActivity.kt b/app/src/main/java/de/tobiasschuerg/weekview/sample/SampleActivity.kt index c263ade..a960624 100644 --- a/app/src/main/java/de/tobiasschuerg/weekview/sample/SampleActivity.kt +++ b/app/src/main/java/de/tobiasschuerg/weekview/sample/SampleActivity.kt @@ -11,6 +11,7 @@ import android.view.View import android.widget.Toast import com.jakewharton.threetenabp.AndroidThreeTen import de.tobiasschuerg.weekview.data.Event +import de.tobiasschuerg.weekview.data.EventConfig import de.tobiasschuerg.weekview.data.WeekData import de.tobiasschuerg.weekview.view.EventView import kotlinx.android.synthetic.main.activity_sample.* @@ -48,6 +49,10 @@ class SampleActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_sample) + + val config = EventConfig(showSubtitle = false, showTimeEnd = false) + week_view_foo.eventConfig = config + // set up the WeekView with the data week_view_foo.addLessonsToTimetable(data) // optional: add an onClickListener for each event diff --git a/library/src/main/java/de/tobiasschuerg/weekview/view/WeekView.kt b/library/src/main/java/de/tobiasschuerg/weekview/view/WeekView.kt index dfd0f06..e4402cc 100644 --- a/library/src/main/java/de/tobiasschuerg/weekview/view/WeekView.kt +++ b/library/src/main/java/de/tobiasschuerg/weekview/view/WeekView.kt @@ -42,10 +42,7 @@ class WeekView(context: Context, attributeSet: AttributeSet) : RelativeLayout(co private val scaleGestureDetector: ScaleGestureDetector private val weekViewConfig: WeekViewConfig - private var eventConfig = EventConfig() - set(value) { - field = value - } + var eventConfig = EventConfig() init { val arr = context.obtainStyledAttributes(attributeSet, R.styleable.WeekView)