.kt: resolved backing-property-naming error in ktLint, made matching properties public, matched names and refactored

This commit is contained in:
tristan81 2024-09-19 00:04:53 +10:00
parent 131dd93e4b
commit 9dce6831b6
7 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ class FolderFragment : CommonsDaggerSupportFragment() {
* ViewBinding
*/
private var _binding: FragmentCustomSelectorBinding? = null
private val binding get() = _binding
val binding get() = _binding
/**
* View Model for images.

View file

@ -49,7 +49,7 @@ class ImageFragment :
RefreshUIListener,
PassDataListener {
private var _binding: FragmentCustomSelectorBinding? = null
private val binding get() = _binding
val binding get() = _binding
/**
* Current bucketId.

View file

@ -23,7 +23,7 @@ abstract class BasePagingPresenter<T>(
pageableBaseDataSource.loadingStates
.observeOn(mainThreadScheduler)
.subscribe(::onLoadingState, Timber::e),
pageableBaseDataSource.noItemsLoadedQueries.subscribe(view::showEmptyText),
pageableBaseDataSource.noItemsLoadedEvent.subscribe(view::showEmptyText),
)
}

View file

@ -29,7 +29,7 @@ abstract class PageableBaseDataSource<T>(
private val _pagingResults = PublishProcessor.create<LiveData<PagedList<T>>>()
val pagingResults: Flowable<LiveData<PagedList<T>>> = _pagingResults
private val _noItemsLoadedEvent = PublishProcessor.create<String>()
val noItemsLoadedQueries: Flowable<String> = _noItemsLoadedEvent
val noItemsLoadedEvent: Flowable<String> = _noItemsLoadedEvent
private var currentFactory: PagingDataSourceFactory<T>? = null
abstract val loadFunction: LoadFunction<T>

View file

@ -13,7 +13,7 @@ import fr.free.nrw.commons.databinding.FragmentAdvanceQueryBinding
class AdvanceQueryFragment : Fragment() {
private var _binding: FragmentAdvanceQueryBinding? = null
private val binding get() = _binding
val binding get() = _binding
lateinit var callback: Callback

View file

@ -48,7 +48,7 @@ class BasePagingPresenterTest {
MockitoAnnotations.openMocks(this)
whenever(pageableBaseDataSource.pagingResults).thenReturn(searchResults)
whenever(pageableBaseDataSource.loadingStates).thenReturn(loadingStates)
whenever(pageableBaseDataSource.noItemsLoadedQueries)
whenever(pageableBaseDataSource.noItemsLoadedEvent)
.thenReturn(noItemLoadedQueries)
testScheduler = TestScheduler()
basePagingPresenter =

View file

@ -47,7 +47,7 @@ class PageableBaseDataSourceTest {
fun `onQueryUpdated invokes livedatconverter with no items emitter`() {
val (zeroItemsFuncCaptor, _) = expectNewLiveData()
pageableBaseDataSource.onQueryUpdated("test")
pageableBaseDataSource.noItemsLoadedQueries
pageableBaseDataSource.noItemsLoadedEvent
.test()
.also { zeroItemsFuncCaptor.firstValue.invoke() }
.assertValue("test")