mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
Add source Manga-Link "ar" (#1032)
This commit is contained in:
parent
677ccb853b
commit
d9406a3334
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
51
multisrc/overrides/madara/mangalink/src/Mangalink.kt
Normal file
51
multisrc/overrides/madara/mangalink/src/Mangalink.kt
Normal file
@ -0,0 +1,51 @@
|
||||
package eu.kanade.tachiyomi.extension.ar.mangalink
|
||||
|
||||
import android.app.Application
|
||||
import android.content.SharedPreferences
|
||||
import android.widget.Toast
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.extension.BuildConfig
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class Mangalink : Madara("مانجا لينك", "https://manga-link.net", "ar", SimpleDateFormat("MMMM dd, yyyy", Locale("ar"))) {
|
||||
|
||||
override val chapterUrlSuffix = ""
|
||||
|
||||
private val defaultBaseUrl = "https://manga-link.net"
|
||||
override val baseUrl by lazy { getPrefBaseUrl() }
|
||||
|
||||
private val preferences: SharedPreferences by lazy {
|
||||
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val RESTART_TACHIYOMI = ".لتطبيق الإعدادات الجديدة Tachiyomi أعد تشغيل"
|
||||
private const val BASE_URL_PREF_TITLE = "تعديل الرابط"
|
||||
private const val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_CODE}"
|
||||
private const val BASE_URL_PREF_SUMMARY = ".للاستخدام المؤقت. تحديث التطبيق سيؤدي الى حذف الإعدادات"
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
val baseUrlPref = androidx.preference.EditTextPreference(screen.context).apply {
|
||||
key = BASE_URL_PREF
|
||||
title = BASE_URL_PREF_TITLE
|
||||
summary = BASE_URL_PREF_SUMMARY
|
||||
this.setDefaultValue(defaultBaseUrl)
|
||||
dialogTitle = BASE_URL_PREF_TITLE
|
||||
dialogMessage = "Default: $defaultBaseUrl"
|
||||
|
||||
setOnPreferenceChangeListener { _, _ ->
|
||||
Toast.makeText(screen.context, RESTART_TACHIYOMI, Toast.LENGTH_LONG).show()
|
||||
true
|
||||
}
|
||||
}
|
||||
screen.addPreference(baseUrlPref)
|
||||
|
||||
super.setupPreferenceScreen(screen)
|
||||
}
|
||||
private fun getPrefBaseUrl(): String = preferences.getString(BASE_URL_PREF, defaultBaseUrl)!!
|
||||
}
|
@ -491,6 +491,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||
SingleLang("Comic Arab", "https://comicarab.com", "ar", isNsfw = true, sourceName = "كوميك العرب"),
|
||||
SingleLang("3asq", "https://3asq.org", "ar", className = "Manga3asq", sourceName = "مانجا العاشق", overrideVersionCode = 2),
|
||||
SingleLang("Mangalek", "https://manga-lek.net", "ar", sourceName = "مانجا ليك", overrideVersionCode = 4),
|
||||
SingleLang("Mangalink", "https://manga-link.net", "ar", sourceName = "ﻣﺎﻧﺠﺎ لينك"),
|
||||
)
|
||||
|
||||
companion object {
|
||||
|
Loading…
Reference in New Issue
Block a user