Skip to content
Permalink
Browse files

Display schedule as single list

Bug: 124011358
Change-Id: I4524ce89e548750782eca46012daf1a604617089
  • Loading branch information...
jdkoren authored and thagikura committed Dec 28, 2018
1 parent 5bb439b commit 4ee7a1772f2b76b17533c5b14890811015d46160
Showing with 390 additions and 758 deletions.
  1. +1 −1 mobile/src/androidTest/java/com/google/samples/apps/iosched/tests/ui/ScheduleTest.kt
  2. +14 −18 ...java/com/google/samples/apps/iosched/ui/schedule/{day/ScheduleDayAdapter.kt → ScheduleAdapter.kt}
  3. +0 −37 mobile/src/main/java/com/google/samples/apps/iosched/ui/schedule/ScheduleChildFragmentsModule.kt
  4. +115 −91 mobile/src/main/java/com/google/samples/apps/iosched/ui/schedule/ScheduleFragment.kt
  5. +3 −2 .../src/main/java/com/google/samples/apps/iosched/ui/schedule/{day → }/ScheduleItemBindingAdapter.kt
  6. +0 −1 mobile/src/main/java/com/google/samples/apps/iosched/ui/schedule/ScheduleModule.kt
  7. +1 −1 ...c/main/java/com/google/samples/apps/iosched/ui/schedule/{day → }/ScheduleTimeHeadersDecoration.kt
  8. +25 −91 mobile/src/main/java/com/google/samples/apps/iosched/ui/schedule/ScheduleViewModel.kt
  9. +1 −1 mobile/src/main/java/com/google/samples/apps/iosched/ui/schedule/{day → }/SessionHeaderIndexer.kt
  10. +0 −176 mobile/src/main/java/com/google/samples/apps/iosched/ui/schedule/day/ScheduleDayFragment.kt
  11. +2 −8 mobile/src/main/res/layout-land/include_schedule_appbar.xml
  12. +35 −5 mobile/src/main/res/layout/fragment_schedule.xml
  13. +0 −67 mobile/src/main/res/layout/fragment_schedule_day.xml
  14. +1 −5 mobile/src/main/res/layout/include_schedule_appbar.xml
  15. +1 −1 mobile/src/test/java/com/google/samples/apps/iosched/test/util/fakes/FakeStarEventUseCase.kt
  16. +20 −25 mobile/src/test/java/com/google/samples/apps/iosched/ui/schedule/ScheduleViewModelTest.kt
  17. +1 −1 ...le/src/test/java/com/google/samples/apps/iosched/ui/schedule/{day → }/SessionHeaderIndexerTest.kt
  18. +1 −1 mobile/src/test/java/com/google/samples/apps/iosched/ui/schedule/{day → }/TestUserEventDataSource.kt
  19. +1 −1 mobile/src/test/java/com/google/samples/apps/iosched/ui/sessiondetail/SessionDetailViewModelTest.kt
  20. +1 −1 ...le/src/test/java/com/google/samples/apps/iosched/ui/sessiondetail/SessionFeedbackViewModelTest.kt
  21. +1 −1 mobile/src/test/java/com/google/samples/apps/iosched/ui/speaker/SpeakerViewModelTest.kt
  22. +27 −49 ...ava/com/google/samples/apps/iosched/shared/data/userevent/DefaultSessionAndUserEventRepository.kt
  23. +4 −5 ...c/main/java/com/google/samples/apps/iosched/shared/data/userevent/FirestoreUserEventDataSource.kt
  24. +31 −51 ...hed/shared/domain/sessions/{LoadUserSessionsByDayUseCase.kt → LoadFilteredUserSessionsUseCase.kt}
  25. +7 −7 ...d/src/main/java/com/google/samples/apps/iosched/shared/domain/sessions/LoadUserSessionsUseCase.kt
  26. +6 −10 ...com/google/samples/apps/iosched/shared/data/userevent/DefaultSessionAndUserEventRepositoryTest.kt
  27. +42 −58 ...ed/domain/sessions/{LoadUserSessionsByDayUseCaseTest.kt → LoadFilteredUserSessionsUseCaseTest.kt}
  28. +3 −3 ...src/test/java/com/google/samples/apps/iosched/shared/domain/users/ReservationActionUseCaseTest.kt
  29. +2 −2 shared/src/test/java/com/google/samples/apps/iosched/shared/domain/users/StarEventUseCaseTest.kt
  30. +13 −10 test-shared/src/main/java/com/google/samples/apps/iosched/test/data/TestData.kt
  31. +22 −19 tv/src/main/java/com/google/samples/apps/iosched/tv/ui/schedule/ScheduleViewModel.kt
  32. +2 −2 tv/src/main/java/com/google/samples/apps/iosched/tv/ui/schedule/ScheduleViewModelFactory.kt
  33. +7 −7 tv/src/test/java/com/google/samples/apps/iosched/tv/ui/schedule/ScheduleViewModelTest.kt
@@ -40,7 +40,7 @@ import com.google.samples.apps.iosched.shared.util.TimeUtils.ConferenceDays
import com.google.samples.apps.iosched.tests.FixedTimeRule
import com.google.samples.apps.iosched.tests.SetPreferencesRule
import com.google.samples.apps.iosched.tests.SyncTaskExecutorRule
import com.google.samples.apps.iosched.ui.schedule.day.SessionViewHolder
import com.google.samples.apps.iosched.ui.schedule.SessionViewHolder
import com.google.samples.apps.iosched.ui.schedule.filters.ScheduleFilterAdapter
import com.google.samples.apps.iosched.widget.BottomSheetBehavior
import org.hamcrest.CoreMatchers.not
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.samples.apps.iosched.ui.schedule.day
package com.google.samples.apps.iosched.ui.schedule

import android.view.LayoutInflater
import android.view.ViewGroup
@@ -26,11 +26,10 @@ import androidx.recyclerview.widget.RecyclerView.RecycledViewPool
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.google.samples.apps.iosched.databinding.ItemSessionBinding
import com.google.samples.apps.iosched.model.userdata.UserSession
import com.google.samples.apps.iosched.ui.schedule.ScheduleEventListener
import com.google.samples.apps.iosched.widget.UnscrollableFlexboxLayoutManager
import org.threeten.bp.ZoneId

class ScheduleDayAdapter(
class ScheduleAdapter(
private val eventListener: ScheduleEventListener,
private val tagViewPool: RecycledViewPool,
private val showReservations: LiveData<Boolean>,
@@ -39,17 +38,18 @@ class ScheduleDayAdapter(
) : ListAdapter<UserSession, SessionViewHolder>(SessionDiff) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SessionViewHolder {
val binding =
ItemSessionBinding.inflate(LayoutInflater.from(parent.context), parent, false).apply {
tags.apply {
setRecycledViewPool(tagViewPool)
// Use a customized FlexboxLayoutManager so that swiping the tags are doesn't
// trigger pull to refresh behavior.
layoutManager = UnscrollableFlexboxLayoutManager(parent.context).apply {
recycleChildrenOnDetach = true
}
val binding = ItemSessionBinding.inflate(
LayoutInflater.from(parent.context), parent, false
).apply {
tags.apply {
setRecycledViewPool(tagViewPool)
// Use a customized FlexboxLayoutManager so that swiping the tags are doesn't
// trigger pull to refresh behavior.
layoutManager = UnscrollableFlexboxLayoutManager(parent.context).apply {
recycleChildrenOnDetach = true
}
}
}
return SessionViewHolder(
binding, eventListener, showReservations, timeZoneId, lifecycleOwner
)
@@ -79,12 +79,8 @@ class SessionViewHolder(
}

object SessionDiff : DiffUtil.ItemCallback<UserSession>() {
override fun areItemsTheSame(
oldItem: UserSession,
newItem: UserSession
): Boolean {
// We don't have to compare the #userEvent because the id of #session and #userEvent
// should match
override fun areItemsTheSame(oldItem: UserSession, newItem: UserSession): Boolean {
// We don't have to compare the userEvent id because it matches the session id.
return oldItem.session.id == newItem.session.id
}

This file was deleted.

0 comments on commit 4ee7a17

Please sign in to comment.
You can’t perform that action at this time.