Skip to content

Commit

Permalink
Add methods for settings
Browse files Browse the repository at this point in the history
  • Loading branch information
CranberrySoup committed Dec 7, 2023
1 parent 6817fa1 commit ee81c5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
targetSdk 33
minSdkVersion 21
targetSdkVersion 33
versionCode 6
versionName "1.0.5"
versionCode 7
versionName "1.1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eu.kanade.tachiyomi.extension.anime.model

import android.graphics.drawable.Drawable
import androidx.preference.PreferenceScreen
import com.lagradost.awaitSingle
import com.lagradost.cloudstream3.APIHolder.capitalize
import com.lagradost.cloudstream3.DubStatus
Expand All @@ -20,6 +21,7 @@ import com.lagradost.cloudstream3.utils.getQualityFromName
import eu.kanade.domain.source.anime.model.AnimeSourceData
import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource
import eu.kanade.tachiyomi.animesource.AnimeSource
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
import eu.kanade.tachiyomi.animesource.model.SAnime
import eu.kanade.tachiyomi.animesource.model.SEpisode
Expand Down Expand Up @@ -77,6 +79,14 @@ sealed class AnimeExtension {
}
}

fun canShowPreferenceScreen(): Boolean = source is ConfigurableAnimeSource
fun getPkgName(): String = pkgName
fun showPreferenceScreen(screen: PreferenceScreen) {
if (source is ConfigurableAnimeSource) {
source.setupPreferenceScreen(screen)
}
}

val popular = MainPageData("Popular", "1")
val latest = MainPageData("Latest", "2")
override val mainPage = listOf(popular, latest)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.5.0")
classpath("com.github.recloudstream:gradle:master-SNAPSHOT")
classpath("com.github.recloudstream:gradle:-SNAPSHOT")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
Expand Down

0 comments on commit ee81c5e

Please sign in to comment.