Skip to content
Permalink
Browse files

Change continuation indent to 4 chars

  • Loading branch information
chrisbanes committed Dec 17, 2019
1 parent 60d1bec commit 2bb521fae81ff95d3decfcabcebc68bff4112f7b
Showing with 1,079 additions and 1,057 deletions.
  1. +5 −0 .idea/codeStyles/Project.xml
  2. +5 −5 app/src/main/java/app/tivi/appinitializers/EmojiInitializer.kt
  3. +5 −5 app/src/main/java/app/tivi/home/HomeActivity.kt
  4. +17 −17 app/src/main/java/app/tivi/inject/AppModule.kt
  5. +4 −4 app/src/main/java/app/tivi/settings/SettingsPreferenceFragment.kt
  6. +5 −5 app/src/main/java/app/tivi/showdetails/ShowDetailsActivity.kt
  7. +8 −8 base-android/src/main/java/app/tivi/util/TiviDateFormatter.kt
  8. +9 −10 base/src/main/java/app/tivi/extensions/CoroutineExtensions.kt
  9. +2 −2 common-databinding/src/main/java/app/tivi/TiviFragmentWithBinding.kt
  10. +8 −8 common-databinding/src/main/java/app/tivi/databinding/TiviBindingMethods.kt
  11. +1 −1 common-entrygrid/src/main/java/app/tivi/util/EntryGridEpoxyController.kt
  12. +6 −6 common-entrygrid/src/main/java/app/tivi/util/EntryGridFragment.kt
  13. +5 −5 common-entrygrid/src/main/java/app/tivi/util/EntryViewModel.kt
  14. +2 −2 common-epoxy/src/main/java/app/tivi/common/epoxy/EpoxyExtensions.kt
  15. +24 −24 common-imageloading/src/main/java/app/tivi/common/imageloading/ImageLoadingBindingAdapters.kt
  16. +7 −7 common-ui-view/src/main/java/app/tivi/TiviMvRxViewModel.kt
  17. +1 −1 common-ui-view/src/main/java/app/tivi/extensions/MotionLayoutExtensions.kt
  18. +36 −36 common-ui-view/src/main/java/app/tivi/extensions/MultipleBackStackNavigationExtensions.kt
  19. +6 −6 common-ui-view/src/main/java/app/tivi/extensions/RecyclerViewExtensions.kt
  20. +4 −4 common-ui-view/src/main/java/app/tivi/extensions/SharedElementExtensions.kt
  21. +2 −2 common-ui-view/src/main/java/app/tivi/home/HomeTextCreator.kt
  22. +3 −3 common-ui-view/src/main/java/app/tivi/ui/AuthStateMenuItemBinder.kt
  23. +8 −8 common-ui-view/src/main/java/app/tivi/ui/ScrimUtil.kt
  24. +9 −3 common-ui-view/src/main/java/app/tivi/ui/graphics/ImageLoadingColorMatrix.kt
  25. +2 −1 common-ui-view/src/main/java/app/tivi/ui/motionlayout/TransitionListenerAdapter.kt
  26. +1 −1 common-ui-view/src/main/java/app/tivi/ui/recyclerview/TiviLinearSmoothScroller.kt
  27. +11 −11 common-ui-view/src/main/java/app/tivi/ui/transitions/BabySlide.kt
  28. +8 −7 common-ui-view/src/main/java/app/tivi/ui/transitions/ColumnedChangeBounds.kt
  29. +3 −1 common-ui-view/src/main/java/app/tivi/ui/transitions/DrawableAlphaProperty.kt
  30. +1 −1 common-ui-view/src/main/java/app/tivi/ui/transitions/GridToGridTransitioner.kt
  31. +25 −25 common-ui-view/src/main/java/app/tivi/ui/transitions/ViewChangeBounds.kt
  32. +1 −1 common-ui-view/src/main/java/app/tivi/ui/transitions/ViewGroupUtils.kt
  33. +4 −4 common-ui-view/src/main/java/app/tivi/ui/widget/BaselineGridTextView.kt
  34. +3 −3 common-ui-view/src/main/java/app/tivi/ui/widget/HeaderHolderFrameLayout.kt
  35. +2 −2 common-ui-view/src/main/java/app/tivi/ui/widget/MaterialShapeConstraintLayout.kt
  36. +11 −11 common-ui-view/src/main/java/app/tivi/ui/widget/NestedChildMotionLayout.kt
  37. +5 −3 common-ui-view/src/main/java/app/tivi/ui/widget/TopLeftCutoutBackgroundView.kt
  38. +2 −2 data-android/src/main/java/app/tivi/data/DatabaseInject.kt
  39. +6 −6 data-android/src/main/java/app/tivi/data/FlowPagedListBuilder.kt
  40. +22 −22 data-android/src/main/java/app/tivi/data/TiviRoomDatabase.kt
  41. +3 −1 data-android/src/main/java/app/tivi/data/TiviTypeConverters.kt
  42. +2 −2 data-android/src/test/java/app/tivi/data/TestDatabaseInject.kt
  43. +5 −5 data-android/src/test/java/app/tivi/data/dao/EpisodeWatchEntryTest.kt
  44. +7 −7 data-android/src/test/java/app/tivi/data/dao/EpisodesTest.kt
  45. +4 −4 data-android/src/test/java/app/tivi/data/dao/SeasonsTest.kt
  46. +12 −12 data-android/src/test/java/app/tivi/data/repositories/FollowedShowRepositoryTest.kt
  47. +12 −12 data-android/src/test/java/app/tivi/data/repositories/SeasonsEpisodesRepositoryTest.kt
  48. +19 −19 data-android/src/test/java/app/tivi/utils/SampleData.kt
  49. +23 −23 data-android/src/test/java/app/tivi/utils/TiviTestDatabase.kt
  50. +3 −3 data/src/main/java/app/tivi/data/daos/EpisodesDao.kt
  51. +12 −12 data/src/main/java/app/tivi/data/entities/Episode.kt
  52. +13 −13 data/src/main/java/app/tivi/data/entities/EpisodeWatchEntry.kt
  53. +12 −12 data/src/main/java/app/tivi/data/entities/FollowedShowEntry.kt
  54. +2 −2 data/src/main/java/app/tivi/data/entities/LastRequest.kt
  55. +11 −11 data/src/main/java/app/tivi/data/entities/PopularShowEntry.kt
  56. +11 −11 data/src/main/java/app/tivi/data/entities/RecommendedShowEntry.kt
  57. +20 −20 data/src/main/java/app/tivi/data/entities/RelatedShowEntry.kt
  58. +11 −11 data/src/main/java/app/tivi/data/entities/Season.kt
  59. +10 −10 data/src/main/java/app/tivi/data/entities/ShowTmdbImage.kt
  60. +3 −2 data/src/main/java/app/tivi/data/entities/TiviEntity.kt
  61. +6 −5 data/src/main/java/app/tivi/data/entities/TiviShow.kt
  62. +2 −2 data/src/main/java/app/tivi/data/entities/TraktUser.kt
  63. +11 −11 data/src/main/java/app/tivi/data/entities/TrendingShowEntry.kt
  64. +11 −11 data/src/main/java/app/tivi/data/entities/WatchedShowEntry.kt
  65. +2 −1 data/src/main/java/app/tivi/data/mappers/EpisodeIdToTraktIdMapper.kt
  66. +2 −1 data/src/main/java/app/tivi/data/mappers/SeasonIdToTraktIdMapper.kt
  67. +1 −1 data/src/main/java/app/tivi/data/mappers/ShowIdToTmdbIdMapper.kt
  68. +3 −3 data/src/main/java/app/tivi/data/mappers/TmdbBaseShowToTiviShow.kt
  69. +6 −6 data/src/main/java/app/tivi/data/mappers/TmdbEpisodeToEpisode.kt
  70. +10 −10 data/src/main/java/app/tivi/data/mappers/TmdbImagesToShowImages.kt
  71. +8 −8 data/src/main/java/app/tivi/data/mappers/TmdbShowResultsPageToTiviShows.kt
  72. +7 −7 data/src/main/java/app/tivi/data/mappers/TmdbShowToTiviShow.kt
  73. +1 −1 data/src/main/java/app/tivi/data/mappers/TraktBaseShowToTiviShow.kt
  74. +9 −9 data/src/main/java/app/tivi/data/mappers/TraktEpisodeToEpisode.kt
  75. +3 −3 data/src/main/java/app/tivi/data/mappers/TraktHistoryItemToEpisodeWatchEntry.kt
  76. +3 −3 data/src/main/java/app/tivi/data/mappers/TraktListEntryToFollowedShowEntry.kt
  77. +11 −11 data/src/main/java/app/tivi/data/mappers/TraktSeasonToSeason.kt
  78. +36 −36 data/src/main/java/app/tivi/data/mappers/TraktShowToTiviShow.kt
  79. +7 −7 data/src/main/java/app/tivi/data/mappers/UserToTraktUser.kt
  80. +4 −4 data/src/main/java/app/tivi/data/repositories/episodes/EpisodeWatchStore.kt
  81. +40 −40 data/src/main/java/app/tivi/data/repositories/episodes/SeasonsEpisodesRepository.kt
  82. +11 −11 data/src/main/java/app/tivi/data/repositories/episodes/SeasonsEpisodesStore.kt
  83. +3 −3 data/src/main/java/app/tivi/data/repositories/episodes/TmdbEpisodeDataSource.kt
  84. +3 −3 data/src/main/java/app/tivi/data/repositories/episodes/TraktEpisodeDataSource.kt
  85. +17 −17 data/src/main/java/app/tivi/data/repositories/episodes/TraktSeasonsEpisodesDataSource.kt
  86. +4 −4 data/src/main/java/app/tivi/data/repositories/followedshows/FollowedShowsRepository.kt
  87. +5 −5 data/src/main/java/app/tivi/data/repositories/followedshows/FollowedShowsStore.kt
  88. +14 −14 data/src/main/java/app/tivi/data/repositories/followedshows/TraktFollowedShowsDataSource.kt
  89. +2 −2 data/src/main/java/app/tivi/data/repositories/popularshows/TraktPopularShowsDataSource.kt
  90. +2 −2 data/src/main/java/app/tivi/data/repositories/recommendedshows/TraktRecommendedShowsDataSource.kt
  91. +2 −2 data/src/main/java/app/tivi/data/repositories/relatedshows/TmdbRelatedShowsDataSource.kt
  92. +3 −3 data/src/main/java/app/tivi/data/repositories/relatedshows/TraktRelatedShowsDataSource.kt
  93. +2 −2 data/src/main/java/app/tivi/data/repositories/search/TmdbSearchDataSource.kt
  94. +4 −4 data/src/main/java/app/tivi/data/repositories/shows/ShowRepository.kt
  95. +24 −24 data/src/main/java/app/tivi/data/repositories/shows/ShowStore.kt
  96. +2 −2 data/src/main/java/app/tivi/data/repositories/shows/TmdbShowDataSource.kt
  97. +2 −2 data/src/main/java/app/tivi/data/repositories/shows/TmdbShowImagesDataSource.kt
  98. +10 −10 data/src/main/java/app/tivi/data/repositories/shows/TraktShowDataSource.kt
  99. +2 −2 data/src/main/java/app/tivi/data/repositories/traktusers/TraktUsersDataSource.kt
  100. +2 −2 data/src/main/java/app/tivi/data/repositories/trendingshows/TraktTrendingShowsDataSource.kt
  101. +2 −2 data/src/main/java/app/tivi/data/repositories/watchedshows/TraktWatchedShowsDataSource.kt
  102. +14 −14 data/src/main/java/app/tivi/data/syncers/ItemSyncer.kt
  103. +2 −2 domain/src/main/java/app/tivi/domain/Interactor.kt
  104. +3 −3 domain/src/main/java/app/tivi/domain/interactors/ChangeSeasonWatchedStatus.kt
  105. +4 −4 domain/src/main/java/app/tivi/domain/interactors/UpdateFollowedShows.kt
  106. +3 −3 domain/src/main/java/app/tivi/domain/observers/ObservePagedFollowedShows.kt
  107. +3 −3 domain/src/main/java/app/tivi/domain/observers/ObservePagedPopularShows.kt
  108. +3 −3 domain/src/main/java/app/tivi/domain/observers/ObservePagedRecommendedShows.kt
  109. +3 −3 domain/src/main/java/app/tivi/domain/observers/ObservePagedTrendingShows.kt
  110. +3 −3 domain/src/main/java/app/tivi/domain/observers/ObservePagedWatchedShows.kt
  111. +23 −23 tasks/src/main/java/app/tivi/tasks/ShowTasksImpl.kt
  112. +2 −2 tasks/src/main/java/app/tivi/tasks/SyncShowWatchedProgress.kt
  113. +2 −2 tasks/src/main/java/app/tivi/tasks/inject/TasksModule.kt
  114. +1 −1 tasks/src/main/java/app/tivi/tasks/inject/TiviWorkerFactory.kt
  115. +18 −18 tmdb/src/main/java/app/tivi/tmdb/TmdbImageSizes.kt
  116. +4 −4 tmdb/src/main/java/app/tivi/tmdb/TmdbManager.kt
  117. +7 −7 trakt-auth/src/main/java/app/tivi/trakt/TraktAuthModule.kt
  118. +5 −5 trakt-auth/src/main/java/app/tivi/trakt/TraktManager.kt
  119. +20 −20 ui-discover/src/main/java/app/tivi/home/discover/DiscoverFragment.kt
  120. +1 −1 ui-episodedetails/src/main/java/app/tivi/episodedetails/EpisodeDetailsEpoxyController.kt
  121. +13 −13 ui-episodedetails/src/main/java/app/tivi/episodedetails/EpisodeDetailsFragment.kt
  122. +1 −1 ui-followed/src/main/java/app/tivi/home/followed/FollowedEpoxyController.kt
  123. +7 −7 ui-followed/src/main/java/app/tivi/home/followed/FollowedFragment.kt
  124. +24 −24 ui-followed/src/main/java/app/tivi/home/followed/FollowedViewModel.kt
  125. +17 −17 ui-popular/src/main/java/app/tivi/home/popular/PopularShowsFragment.kt
  126. +17 −17 ui-recommended/src/main/java/app/tivi/home/recommended/RecommendedShowsFragment.kt
  127. +3 −3 ui-search/src/main/java/app/tivi/home/search/SearchFragment.kt
  128. +8 −8 ui-search/src/main/java/app/tivi/home/search/SearchViewModel.kt
  129. +7 −7 ui-showdetails/src/main/java/app/tivi/showdetails/details/ShowDetailsEpoxyController.kt
  130. +12 −12 ui-showdetails/src/main/java/app/tivi/showdetails/details/ShowDetailsFragment.kt
  131. +9 −9 ui-showdetails/src/main/java/app/tivi/showdetails/details/ShowDetailsFragmentViewModel.kt
  132. +10 −10 ui-showdetails/src/main/java/app/tivi/showdetails/details/ShowDetailsTextCreator.kt
  133. +17 −17 ui-trending/src/main/java/app/tivi/home/trending/TrendingShowsFragment.kt
  134. +1 −1 ui-watched/src/main/java/app/tivi/home/watched/WatchedEpoxyController.kt
  135. +7 −7 ui-watched/src/main/java/app/tivi/home/watched/WatchedFragment.kt
  136. +22 −22 ui-watched/src/main/java/app/tivi/home/watched/WatchedViewModel.kt
@@ -130,6 +130,11 @@
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="FIELD_ANNOTATION_WRAP" value="1" />
<option name="VARIABLE_ANNOTATION_WRAP" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
@@ -26,13 +26,13 @@ import javax.inject.Inject
class EmojiInitializer @Inject constructor() : AppInitializer {
override fun init(application: Application) {
val fontRequest = FontRequest(
"com.google.android.gms.fonts",
"com.google.android.gms",
"Noto Color Emoji Compat",
R.array.com_google_android_gms_fonts_certs)
"com.google.android.gms.fonts",
"com.google.android.gms",
"Noto Color Emoji Compat",
R.array.com_google_android_gms_fonts_certs)

val config = FontRequestEmojiCompatConfig(application, fontRequest)
.setReplaceAll(true)
.setReplaceAll(true)

EmojiCompat.init(config)
}
@@ -86,11 +86,11 @@ class HomeActivity : TiviActivityMvRxView() {

private fun setupBottomNavigationBar() {
binding.homeBottomNavigation.setupWithNavController(
listOf(R.navigation.discover_nav_graph, R.navigation.watched_nav_graph,
R.navigation.following_nav_graph, R.navigation.search_nav_graph),
supportFragmentManager,
R.id.home_nav_container,
intent
listOf(R.navigation.discover_nav_graph, R.navigation.watched_nav_graph,
R.navigation.following_nav_graph, R.navigation.search_nav_graph),
supportFragmentManager,
R.id.home_nav_container,
intent
).observe(this) { navController ->
currentNavController = navController

@@ -55,16 +55,16 @@ class AppModule {
@Singleton
@Provides
fun provideCoroutineDispatchers() = AppCoroutineDispatchers(
io = Dispatchers.IO,
computation = Dispatchers.Default,
main = Dispatchers.Main
io = Dispatchers.IO,
computation = Dispatchers.Default,
main = Dispatchers.Main
)

@Singleton
@Provides
fun provideBackgroundExecutor(): Executor {
val parallelism = (Runtime.getRuntime().availableProcessors() * 2)
.coerceIn(4, 32)
.coerceIn(4, 32)
return if (Build.VERSION.SDK_INT < 24) {
Executors.newFixedThreadPool(parallelism)
} else {
@@ -105,9 +105,9 @@ class AppModule {
fun provideMediumDateFormatter(application: TiviApplication): DateTimeFormatter {
@Suppress("DEPRECATION")
return (AndroidDateFormat.getMediumDateFormat(application) as SimpleDateFormat)
.toThreeTenDateTimeFormatter()
.withLocale(application.resources.configuration.locale)
.withZone(ZoneId.systemDefault())
.toThreeTenDateTimeFormatter()
.withLocale(application.resources.configuration.locale)
.withZone(ZoneId.systemDefault())
}

@Singleton
@@ -119,8 +119,8 @@ class AppModule {

@Suppress("DEPRECATION")
return DateTimeFormatter.ofPattern("${dateF.toPattern()} ${timeF.toPattern()}")
.withLocale(application.resources.configuration.locale)
.withZone(ZoneId.systemDefault())
.withLocale(application.resources.configuration.locale)
.withZone(ZoneId.systemDefault())
}

@Singleton
@@ -129,9 +129,9 @@ class AppModule {
fun provideShortDateFormatter(application: TiviApplication): DateTimeFormatter {
@Suppress("DEPRECATION")
return (AndroidDateFormat.getDateFormat(application) as SimpleDateFormat)
.toThreeTenDateTimeFormatter()
.withLocale(application.resources.configuration.locale)
.withZone(ZoneId.systemDefault())
.toThreeTenDateTimeFormatter()
.withLocale(application.resources.configuration.locale)
.withZone(ZoneId.systemDefault())
}

@Singleton
@@ -140,7 +140,7 @@ class AppModule {
fun provideShortTimeFormatter(application: TiviApplication): DateTimeFormatter {
@Suppress("DEPRECATION")
return (AndroidDateFormat.getTimeFormat(application) as SimpleDateFormat)
.toThreeTenDateTimeFormatter()
.toThreeTenDateTimeFormatter()
}

@Provides
@@ -152,9 +152,9 @@ class AppModule {
@Provides
@Singleton
fun provideAppBarConfiguration() = AppBarConfiguration.Builder(
R.id.navigation_followed,
R.id.navigation_watched,
R.id.navigation_discover,
R.id.navigation_search
R.id.navigation_followed,
R.id.navigation_watched,
R.id.navigation_discover,
R.id.navigation_search
).build()
}
@@ -33,9 +33,9 @@ internal class SettingsPreferenceFragment : PreferenceFragmentCompat() {

findPreference<Preference>("privacy_policy")?.setOnPreferenceClickListener {
CustomTabsIntent.Builder()
.setToolbarColor(requireContext().resolveThemeColor(R.attr.colorPrimaryVariant))
.build()
.launchUrl(requireContext(), getString(R.string.privacy_policy_url).toUri())
.setToolbarColor(requireContext().resolveThemeColor(R.attr.colorPrimaryVariant))
.build()
.launchUrl(requireContext(), getString(R.string.privacy_policy_url).toUri())
true
}

@@ -46,7 +46,7 @@ internal class SettingsPreferenceFragment : PreferenceFragmentCompat() {

findPreference<Preference>("version")?.apply {
summary = getString(R.string.settings_app_version_summary,
BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
}
}
}
@@ -33,13 +33,13 @@ class ShowDetailsActivity : TiviActivity() {

findViewById<View>(R.id.details_root).apply {
systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION

doOnApplyWindowInsets { view, insets, initialState ->
view.updatePadding(
left = insets.systemWindowInsetLeft + initialState.paddings.left,
right = insets.systemWindowInsetRight + initialState.paddings.right
left = insets.systemWindowInsetLeft + initialState.paddings.left,
right = insets.systemWindowInsetRight + initialState.paddings.right
)
}
}
@@ -50,7 +50,7 @@ class ShowDetailsActivity : TiviActivity() {
override fun handleIntent(intent: Intent) {
supportFragmentManager.commit {
replace(R.id.details_content,
NavHostFragment.create(R.navigation.show_details_nav_graph, intent.extras))
NavHostFragment.create(R.navigation.show_details_nav_graph, intent.extras))
}
}
}
@@ -54,10 +54,10 @@ class TiviDateFormatter @Inject constructor(
if (dateTime.year == now.year || dateTime.isAfter(now.minusDays(7))) {
// Within the past week
DateUtils.getRelativeTimeSpanString(
dateTime.toInstant().toEpochMilli(),
System.currentTimeMillis(),
DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_SHOW_DATE)
dateTime.toInstant().toEpochMilli(),
System.currentTimeMillis(),
DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_SHOW_DATE)
} else {
// More than 7 days ago
formatShortDate(dateTime)
@@ -66,10 +66,10 @@ class TiviDateFormatter @Inject constructor(
if (dateTime.year == now.year || dateTime.isBefore(now.plusDays(14))) {
// In the near future (next 2 weeks)
DateUtils.getRelativeTimeSpanString(
dateTime.toInstant().toEpochMilli(),
System.currentTimeMillis(),
DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_SHOW_DATE)
dateTime.toInstant().toEpochMilli(),
System.currentTimeMillis(),
DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_SHOW_DATE)
} else {
// In the far future
formatShortDate(dateTime)
@@ -77,8 +77,7 @@ suspend inline fun <T> asyncOrAwait(
crossinline action: suspend CoroutineScope.() -> T
): T = coroutineScope {
val deferred = deferreds[key]?.takeIf { it.isActive }
?: async { action() }
.also { deferreds[key] = it }
?: async { action() }.also { deferreds[key] = it }

if (deferreds.size > 100 && !deferredsCleanLaunched.getAndSet(true)) {
launch {
@@ -100,8 +99,8 @@ suspend inline fun launchOrJoin(
crossinline action: suspend CoroutineScope.() -> Unit
) = coroutineScope {
val job = jobs[key]?.takeIf { it.isActive }
?: launch { action() }
.also { jobs[key] = it }
?: launch { action() }
.also { jobs[key] = it }

if (jobs.size > 100 && !jobsCleanLaunched.getAndSet(true)) {
launch {
@@ -131,11 +130,11 @@ inline fun <T1, T2, T3, T4, T5, T6, R> combine(
crossinline transform: suspend (T1, T2, T3, T4, T5, T6) -> R
): Flow<R> = kotlinx.coroutines.flow.combine(flow, flow2, flow3, flow4, flow5, flow6) { args: Array<*> ->
transform(
args[0] as T1,
args[1] as T2,
args[2] as T3,
args[3] as T4,
args[4] as T5,
args[5] as T6
args[0] as T1,
args[1] as T2,
args[2] as T3,
args[3] as T4,
args[4] as T5,
args[5] as T6
)
}
@@ -33,8 +33,8 @@ abstract class TiviFragmentWithBinding<V : ViewDataBinding> : TiviFragment() {

final override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return createBinding(inflater, container, savedInstanceState)
.also { binding = it }
.root
.also { binding = it }
.root
}

final override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -23,13 +23,13 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import app.tivi.ui.widget.PopupMenuButton

@BindingMethods(
BindingMethod(type = View::class, attribute = "outlineProviderInstance", method = "setOutlineProvider"),
BindingMethod(type = SwipeRefreshLayout::class, attribute = "isRefreshing", method = "setRefreshing"),
BindingMethod(type = View::class, attribute = "clipToOutline", method = "setClipToOutline"),
BindingMethod(type = View::class, attribute = "activated", method = "setActivated"),
BindingMethod(type = View::class, attribute = "selected", method = "setSelected"),
BindingMethod(type = View::class, attribute = "onLongClick", method = "setOnLongClickListener"),
BindingMethod(type = PopupMenuButton::class, attribute = "popupMenuClickListener", method = "setMenuItemClickListener"),
BindingMethod(type = PopupMenuButton::class, attribute = "popupMenuListener", method = "setPopupMenuListener")
BindingMethod(type = View::class, attribute = "outlineProviderInstance", method = "setOutlineProvider"),
BindingMethod(type = SwipeRefreshLayout::class, attribute = "isRefreshing", method = "setRefreshing"),
BindingMethod(type = View::class, attribute = "clipToOutline", method = "setClipToOutline"),
BindingMethod(type = View::class, attribute = "activated", method = "setActivated"),
BindingMethod(type = View::class, attribute = "selected", method = "setSelected"),
BindingMethod(type = View::class, attribute = "onLongClick", method = "setOnLongClickListener"),
BindingMethod(type = PopupMenuButton::class, attribute = "popupMenuClickListener", method = "setMenuItemClickListener"),
BindingMethod(type = PopupMenuButton::class, attribute = "popupMenuListener", method = "setPopupMenuListener")
)
class TiviBindingMethods
@@ -70,6 +70,6 @@ abstract class EntryGridEpoxyController<LI : EntryWithShow<out Entry>> :

protected open fun buildItemPlaceholder(index: Int): PosterGridItemBindingModel_ {
return PosterGridItemBindingModel_()
.id("placeholder_$index")
.id("placeholder_$index")
}
}
@@ -46,7 +46,7 @@ import kotlinx.coroutines.flow.collect

@SuppressLint("ValidFragment")
abstract class EntryGridFragment<LI, VM> : TiviFragmentWithBinding<FragmentEntryGridBinding>()
where LI : EntryWithShow<out Entry>, VM : EntryViewModel<LI, *> {
where LI : EntryWithShow<out Entry>, VM : EntryViewModel<LI, *> {
protected abstract val viewModel: VM

private lateinit var swipeRefreshLatch: ProgressTimeLatch
@@ -88,7 +88,7 @@ abstract class EntryGridFragment<LI, VM> : TiviFragmentWithBinding<FragmentEntry
binding.gridAppbar.doOnSizeChange {
binding.gridRecyclerview.updatePadding(top = it.height)
binding.gridSwipeRefresh.setProgressViewOffset(true, 0,
it.height + binding.gridSwipeRefresh.progressCircleDiameter / 2)
it.height + binding.gridSwipeRefresh.progressCircleDiameter / 2)
true
}

@@ -115,9 +115,9 @@ abstract class EntryGridFragment<LI, VM> : TiviFragmentWithBinding<FragmentEntry
is UiError -> {
swipeRefreshLatch.refreshing = false
Snackbar.make(requireView(),
status.exception?.localizedMessage
?: getString(R.string.error_generic),
Snackbar.LENGTH_SHORT
status.exception?.localizedMessage
?: getString(R.string.error_generic),
Snackbar.LENGTH_SHORT
).show()
}
is UiLoading -> swipeRefreshLatch.refreshing = status.fullRefresh
@@ -133,7 +133,7 @@ abstract class EntryGridFragment<LI, VM> : TiviFragmentWithBinding<FragmentEntry

if (currentActionMode != null) {
currentActionMode?.title = getString(R.string.selection_title,
state.selectedShowIds.size)
state.selectedShowIds.size)
}

if (state.isLoaded) {
@@ -140,11 +140,11 @@ abstract class EntryViewModel<LI : EntryWithShow<out Entry>, PI : PagingInteract

fun followSelectedShows() {
changeShowFollowStatus(
ChangeShowFollowStatus.Params(
showSelection.getSelectedShowIds(),
ChangeShowFollowStatus.Action.FOLLOW,
deferDataFetch = true
)
ChangeShowFollowStatus.Params(
showSelection.getSelectedShowIds(),
ChangeShowFollowStatus.Action.FOLLOW,
deferDataFetch = true
)
)
showSelection.clearSelection()
}
@@ -38,7 +38,7 @@ fun RecyclerView.syncSpanSizes(controller: EpoxyController) {
val layout = layoutManager
if (layout is GridLayoutManager) {
if (controller.spanCount != layout.spanCount ||
layout.spanSizeLookup !== controller.spanSizeLookup) {
layout.spanSizeLookup !== controller.spanSizeLookup) {
controller.spanCount = layout.spanCount
layout.spanSizeLookup = controller.spanSizeLookup
}
@@ -47,5 +47,5 @@ fun RecyclerView.syncSpanSizes(controller: EpoxyController) {

fun EpoxyControllerAdapter.findPositionOfItemId(itemId: Long): Int {
return (0 until itemCount).firstOrNull { getItemId(it) == itemId }
?: RecyclerView.NO_POSITION
?: RecyclerView.NO_POSITION
}

0 comments on commit 2bb521f

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