ktlint format

This commit is contained in:
Felix 2020-04-08 00:56:34 +02:00
parent e698bdc870
commit cc06a502f6
7 changed files with 11 additions and 14 deletions

View file

@ -74,13 +74,13 @@ object ChaosflixUtil {
.flatten()
.filterNot { it.matches("\\d+".toRegex()) }
.filterNot { it.toLowerCase() == acronym.toLowerCase() }
val tagCount: MutableMap<String,Int> = mutableMapOf()
for(tag in tagList.filterNotNull()) {
val tagCount: MutableMap<String, Int> = mutableMapOf()
for (tag in tagList.filterNotNull()) {
tagCount[tag] = tagCount[tag]?.plus(1) ?: 1
}
val usefulTags = tagCount.keys
.filter { tagCount[it]!! < events.size - 1 }
.filter { tagCount[it]!! > 1}
.filter { tagCount[it]!! > 1 }
.filter { it.length >= 3 }
return usefulTags.isNotEmpty()
}

View file

@ -5,14 +5,14 @@ import android.util.Log
import com.google.gson.Gson
import de.nicidienase.chaosflix.BuildConfig
import de.nicidienase.chaosflix.common.SingletonHolder2
import java.io.File
import java.net.SocketTimeoutException
import java.util.concurrent.TimeUnit
import okhttp3.Cache
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.io.File
import java.net.SocketTimeoutException
import java.util.concurrent.TimeUnit
class ApiFactory private constructor(private val recordingUrl: String, cache: File? = null) {

View file

@ -1,7 +1,6 @@
package de.nicidienase.chaosflix
import android.content.Context
import leakcanary.LeakCanary
object LeakCanaryLauncher {

View file

@ -8,7 +8,6 @@ import org.junit.jupiter.api.Test
class ChaosflixUtilTest {
val api = ApiFactory.getInstance("https://api.media.ccc.de", null).recordingApi
@Test
@ -35,7 +34,6 @@ class ChaosflixUtilTest {
@Test
fun chaosradio() = genericTest("chaosradio", false)
fun genericTest(acronym: String, expResult: Boolean) = runBlocking {
val conference = api.getConferenceByName(acronym).body()
val map = conference?.events?.map { Event(it) }

View file

@ -50,7 +50,7 @@ class ItemViewClickedListener(private val fragment: Fragment) : OnItemViewClicke
SelectableContentItem.About -> {
}
SelectableContentItem.LeakCanary -> {
if(BuildConfig.DEBUG){
if (BuildConfig.DEBUG) {
LeakCanaryLauncher.launch(fragment.requireContext())
}
}

View file

@ -90,7 +90,7 @@ class ConferencesBrowseFragment : BrowseSupportFragment() {
val listRowAdapter = ArrayObjectAdapter(settingsPresenter)
listRowAdapter.add(SelectableContentItem.Settings)
listRowAdapter.add(SelectableContentItem.About)
if(BuildConfig.DEBUG){
if (BuildConfig.DEBUG) {
listRowAdapter.add(SelectableContentItem.LeakCanary)
}
settingsRow = ListRow(HeaderItem("Chaosflix"), listRowAdapter)