Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e51a705 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix Kotlin warnings

MediaArtworkProcessor change to use new WindowContext.

Still suppressing deprecation in DetailDialog.

Test: build
Test: atest MediaArtworkProcessorTest
Bug: 149787017
Change-Id: I9288076ac29077e90a978e8e5ee38080992a15ca
parent 19aae756
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ class ControlsFavoritePersistenceWrapper(
    }

    private fun parseXml(parser: XmlPullParser): List<ControlInfo> {
        var type = 0
        var type: Int
        val infos = mutableListOf<ControlInfo>()
        while (parser.next().also { type = it } != XmlPullParser.END_DOCUMENT) {
            if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+3 −3
Original line number Diff line number Diff line
@@ -58,13 +58,13 @@ class AppAdapter(
    private var listOfServices = emptyList<CandidateInfo>()

    private val callback = object : ControlsListingController.ControlsListingCallback {
        override fun onServicesUpdated(list: List<CandidateInfo>) {
        override fun onServicesUpdated(candidates: List<CandidateInfo>) {
            backgroundExecutor.execute {
                val collator = Collator.getInstance(resources.getConfiguration().locale)
                val collator = Collator.getInstance(resources.configuration.locales[0])
                val localeComparator = compareBy<CandidateInfo, CharSequence>(collator) {
                    it.loadLabel()
                }
                listOfServices = list.sortedWith(localeComparator)
                listOfServices = candidates.sortedWith(localeComparator)
                uiExecutor.execute(::notifyDataSetChanged)
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class ControlsFavoritingActivity @Inject constructor(
            target: RecyclerView.ViewHolder
        ): Boolean {
            return currentModel?.onMoveItem(
                    viewHolder.adapterPosition, target.adapterPosition) != null
                    viewHolder.layoutPosition, target.layoutPosition) != null
        }

        override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {}
+1 −1
Original line number Diff line number Diff line
@@ -45,6 +45,6 @@ interface ControlsListingController :

    @FunctionalInterface
    interface ControlsListingCallback {
        fun onServicesUpdated(list: List<CandidateInfo>)
        fun onServicesUpdated(candidates: List<CandidateInfo>)
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -130,8 +130,7 @@ class ControlsUiControllerImpl @Inject constructor (
    private val listingCallback = object : ControlsListingController.ControlsListingCallback {
        override fun onServicesUpdated(candidates: List<CandidateInfo>) {
            bgExecutor.execute {
                val collator = Collator.getInstance(context.getResources()
                        .getConfiguration().locale)
                val collator = Collator.getInstance(context.resources.configuration.locales[0])
                val localeComparator = compareBy<CandidateInfo, CharSequence>(collator) {
                    it.loadLabel()
                }
Loading