mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-22 20:33:05 +00:00
ktlint format
This commit is contained in:
parent
e698bdc870
commit
cc06a502f6
7 changed files with 11 additions and 14 deletions
|
@ -8,4 +8,4 @@ object LeakCanaryLauncher {
|
|||
fun launch(context: Context) {
|
||||
context.startActivity(LeakCanary.newLeakDisplayActivityIntent())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package de.nicidienase.chaosflix
|
||||
|
||||
import android.content.Context
|
||||
import leakcanary.LeakCanary
|
||||
|
||||
object LeakCanaryLauncher {
|
||||
|
||||
fun launch(context: Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) }
|
||||
|
@ -43,4 +41,4 @@ class ChaosflixUtilTest {
|
|||
assertTrue(expResult == ChaosflixUtil.areTagsUsefull(map, conference.acronym))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue