Skip to content

Commit

Permalink
Adapt to changes in schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
thellmund committed Jun 22, 2019
1 parent eafcb21 commit bfd17b8
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 89 deletions.
163 changes: 81 additions & 82 deletions app/src/main/assets/schedule.json

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions app/src/main/assets/speakers.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@
"https://twitter.com/objcode"
],
"imageUrl": "https://static.wixstatic.com/media/6e1ab2_5ed9454b62df421cb68974c45ac31adb~mv2.png",
"role": "Android ",
"company": "@ Google",
"role": "Android",
"company": "Google",
"name": "Sean McQuillan"
},
{
Expand Down Expand Up @@ -1085,5 +1085,19 @@
"company": "Freelancer",
"name": "Kai Koenig",
"role": "Software Solutions Architect"
},
{
"imageUrl": "",
"description": "TBC",
"company": "Google",
"name": "Niko Schröer",
"role": "Google Play Store"
},
{
"imageUrl": "https://sessionize.com/image?f=f88b4d7c6284077f6ed96519897f4a4e,200,200,True,False,5e-8195-42e3-9393-df8dd36a6cc6.d7305e71-badf-4956-9516-25f8fb9745ab.jpg",
"description": "Hawra Milani is an active community organiser, where she spends a lot of her time in organising, attending, and speaking at technical conferences around the world. A former high-school teacher, she is now the founder and CEO of ‘Code 2 Serve’ where she spends a lot of her time creating coding programmes and convincing youth that no matter what their educational or cultural background, they have a place in tech. She is the Lead Organiser for the Google Developer Group (GDG) Oxford, a Women Techmakers Ambassador in Iraq, and a STEM UK ambassador. She also teaches in Code Clubs and CoderDojos in various parts of London, and is an Apple, Google and Raspberry Pi Certified Educator. She holds a BSc in Computer Science, a PGCE in Computer Science, and an MA in Computer Science Education from King’s College London.",
"company": "",
"name": "Hawra Milani",
"role": "GDG and WTM Oxford Lead, GDG and WTM Najaf Lead, Computer Science Educator"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DayViewModel(
init {
compositeDisposable += repository
.getEventsByDay(day)
.subscribe(_events::postValue) // Error handling: ¯\_(ツ)_/¯
.subscribe(_events::postValue) {} // Error handling: ¯\_(ツ)_/¯
}

override fun onCleared() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,15 @@ class EventDetailsFragment : BaseFragment() {

if (event.speakers.isNotEmpty()) {
val speakers = event.speakers.mapNotNull { speakersRepository.getSpeaker(it) }

// Some speakers are not included individually, but in a speaker pair. If only one of
// them participates in another session, they won't be displayed in its speaker list.
// This code addresses that.
val zipped = event.speakers.zip(speakers)
val modifiedSpeakers = zipped.map { it.second.copy(name = it.first) }

val speakersAdapter = SpeakersAdapter(this::onSpeakerClick)
speakersAdapter.update(speakers)
speakersAdapter.update(modifiedSpeakers)
speakersRecyclerView.adapter = speakersAdapter
} else {
speakersHeader.isVisible = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class SpeakersRepository(
loadSpeakers()
}

return speakers.firstOrNull {it.name == name }
// TODO works?
return speakers.firstOrNull { it.name.contains(name) }
}

fun getSpeakers(): Observable<List<Speaker>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SpeakersViewModel(application: Application) : AndroidViewModel(application
init {
compositeDisposable += repository
.getSpeakers()
.subscribe(_speakers::postValue) // Error handling: ¯\_(ツ)_/¯
.subscribe(_speakers::postValue) {} // Error handling: ¯\_(ツ)_/¯
}

override fun onCleared() {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0-beta03'
classpath 'com.android.tools.build:gradle:3.5.0-beta04'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit bfd17b8

Please sign in to comment.