Skip to content

Commit

Permalink
Extended sample and changed EventConfig visibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasschuerg committed Mar 4, 2018
1 parent 2c8c5e2 commit c2fbfe4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c2fbfe4

Please sign in to comment.