diff --git a/NginxProvider/build.gradle.kts b/NginxProvider/build.gradle.kts index ffad107..016a923 100644 --- a/NginxProvider/build.gradle.kts +++ b/NginxProvider/build.gradle.kts @@ -5,7 +5,7 @@ dependencies { } // use an integer for version numbers -version = 6 +version = 7 cloudstream { diff --git a/NginxProvider/src/main/kotlin/com/lagradost/NginxSettingsFragment.kt b/NginxProvider/src/main/kotlin/com/lagradost/NginxSettingsFragment.kt index 0ac5349..01f3409 100644 --- a/NginxProvider/src/main/kotlin/com/lagradost/NginxSettingsFragment.kt +++ b/NginxProvider/src/main/kotlin/com/lagradost/NginxSettingsFragment.kt @@ -10,6 +10,7 @@ import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import androidx.core.content.res.ResourcesCompat +import com.lagradost.cloudstream3.R import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.lagradost.cloudstream3.AcraApplication.Companion.openBrowser import com.lagradost.cloudstream3.plugins.Plugin @@ -17,7 +18,6 @@ import com.lagradost.cloudstream3.ui.settings.SettingsAccount.Companion.showLogi import com.lagradost.cloudstream3.ui.settings.SettingsAccount.Companion.addAccount import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute -const val packageName = "com.lagradost" class NginxSettingsFragment(private val plugin: Plugin, val nginxApi: NginxApi) : BottomSheetDialogFragment() { @@ -27,40 +27,24 @@ class NginxSettingsFragment(private val plugin: Plugin, val nginxApi: NginxApi) savedInstanceState: Bundle? ): View? { // Inflate the layout for this fragment - val id = plugin.resources!!.getIdentifier("nginx_settings", "layout", packageName) + val id = plugin.resources!!.getIdentifier("nginx_settings", "layout", BuildConfig.LIBRARY_PACKAGE_NAME) val layout = plugin.resources!!.getLayout(id) return inflater.inflate(layout, container, false) } private fun View.findView(name: String): T { - val id = plugin.resources!!.getIdentifier(name, "id", packageName) + val id = plugin.resources!!.getIdentifier(name, "id", BuildConfig.LIBRARY_PACKAGE_NAME) return this.findViewById(id) } private fun getDrawable(name: String): Drawable? { - val id = plugin.resources!!.getIdentifier(name, "drawable", packageName) + val id = plugin.resources!!.getIdentifier(name, "drawable", BuildConfig.LIBRARY_PACKAGE_NAME) return ResourcesCompat.getDrawable(plugin.resources!!, id, null) } - private fun getString(name: String): String { - val id = maxOf( - // Fuck it lets see if any works - plugin.resources!!.getIdentifier(name, "string", packageName), - plugin.resources!!.getIdentifier(name, "string", "$packageName.cloudstream3"), - this.context?.resources?.getIdentifier(name, "string", "$packageName.cloudstream3") - ?: 0, - this.context?.resources?.getIdentifier(name, "string", packageName) ?: 0, - this.activity?.resources?.getIdentifier(name, "string", "$packageName.cloudstream3") ?: 0, - this.activity?.resources?.getIdentifier(name, "string", packageName) ?: 0, - ) - return if (id <= 0) - "" - else - this.getString(id) - } - - private fun getAttr(name: String): Int { - return plugin.resources!!.getIdentifier(name, "attr", packageName) + private fun getString(name: String): String? { + val id = plugin.resources!!.getIdentifier(name, "string", BuildConfig.LIBRARY_PACKAGE_NAME) + return plugin.resources!!.getString(id) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -72,18 +56,16 @@ class NginxSettingsFragment(private val plugin: Plugin, val nginxApi: NginxApi) infoTextView.text = getString("nginx_info_title") infoSubTextView.text = getString("nginx_info_summary") - infoImageView.setImageDrawable( - getDrawable("nginx_question") - ) + infoImageView.setImageDrawable(getDrawable("nginx_question")) infoImageView.imageTintList = - ColorStateList.valueOf(view.context.colorFromAttribute(getAttr("white"))) + ColorStateList.valueOf(view.context.colorFromAttribute(R.attr.white)) val loginView = view.findView("nginx_login") val loginTextView = view.findView("main_text") val loginImageView = view.findView("nginx_login_imageview") loginImageView.setImageDrawable(getDrawable("nginx")) loginImageView.imageTintList = - ColorStateList.valueOf(view.context.colorFromAttribute(getAttr("white"))) + ColorStateList.valueOf(view.context.colorFromAttribute(R.attr.white)) // object : View.OnClickListener is required to make it compile because otherwise it used invoke-customs infoView.setOnClickListener(object : View.OnClickListener { diff --git a/NginxProvider/src/main/res/values-bp/strings.xml b/NginxProvider/src/main/res/values-bp/strings.xml new file mode 100644 index 0000000..3e974cf --- /dev/null +++ b/NginxProvider/src/main/res/values-bp/strings.xml @@ -0,0 +1,5 @@ + + + O que é Nginx ? + Nginx é um software que pode ser usado para exibir arquivos de um servidor que você possui. Clique para ver um guia de configuração do Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-cs/strings.xml b/NginxProvider/src/main/res/values-cs/strings.xml new file mode 100644 index 0000000..513a466 --- /dev/null +++ b/NginxProvider/src/main/res/values-cs/strings.xml @@ -0,0 +1,5 @@ + + + Co je to Nginx? + Nginx je software, který může být použit ke zobrazení souborů na serveru, který vlastníte. Klikněte pro zobrazení návodu k nastavení Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-es/strings.xml b/NginxProvider/src/main/res/values-es/strings.xml new file mode 100644 index 0000000..604a20b --- /dev/null +++ b/NginxProvider/src/main/res/values-es/strings.xml @@ -0,0 +1,5 @@ + + + ¿Qué es Nginx? + Nginx es un software que se puede usar para mostrar archivos de un servidor de su propiedad. Pulse para ver una guía de configuración de Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-fr/strings.xml b/NginxProvider/src/main/res/values-fr/strings.xml new file mode 100644 index 0000000..5877cda --- /dev/null +++ b/NginxProvider/src/main/res/values-fr/strings.xml @@ -0,0 +1,5 @@ + + + Nginx est un logiciel utilisé pour afficher les fichier d\'un server que vous possèdez. Cliquez pour voir un guide de mise en place. + Addresse du serveur Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-in/strings.xml b/NginxProvider/src/main/res/values-in/strings.xml new file mode 100644 index 0000000..3685d63 --- /dev/null +++ b/NginxProvider/src/main/res/values-in/strings.xml @@ -0,0 +1,5 @@ + + + Apa itu Nginx ? + Nginx adalah sebuah software yang dapat digunakan untuk menampilkan file dari server yang anda miliki. Klik untuk melihat panduan pengaturan Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-it/strings.xml b/NginxProvider/src/main/res/values-it/strings.xml new file mode 100644 index 0000000..435f963 --- /dev/null +++ b/NginxProvider/src/main/res/values-it/strings.xml @@ -0,0 +1,5 @@ + + + Cos\'è Nginx? + Nginx è un software che può essere utilizzato per visualizzare i file da un server di proprietà. Fare clic per vedere la guida all\'installazione di Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-nl/strings.xml b/NginxProvider/src/main/res/values-nl/strings.xml new file mode 100644 index 0000000..1cf37c2 --- /dev/null +++ b/NginxProvider/src/main/res/values-nl/strings.xml @@ -0,0 +1,5 @@ + + + Wat is Nginx ? + Nginx is een software die kan worden gebruikt om bestanden weer te geven van een server die u bezit. Klik om een Nginx installatiegids te zien + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-pl/strings.xml b/NginxProvider/src/main/res/values-pl/strings.xml new file mode 100644 index 0000000..0808836 --- /dev/null +++ b/NginxProvider/src/main/res/values-pl/strings.xml @@ -0,0 +1,5 @@ + + + Co to Nginx? + Nginx to oprogramowanie, które może być używane do wyświetlania plików z serwera, którego jesteś właścicielem. Kliknij, aby zobaczyć przewodnik konfiguracji Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-ro/strings.xml b/NginxProvider/src/main/res/values-ro/strings.xml new file mode 100644 index 0000000..d44ede0 --- /dev/null +++ b/NginxProvider/src/main/res/values-ro/strings.xml @@ -0,0 +1,5 @@ + + + Ce este Nginx? + Nginx este un software care poate fi utilizat pentru a vizualiza fișiere de pe un server proprietar. Faceți clic pentru a vedea ghidul de instalare Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-tr/strings.xml b/NginxProvider/src/main/res/values-tr/strings.xml new file mode 100644 index 0000000..ea0fb7a --- /dev/null +++ b/NginxProvider/src/main/res/values-tr/strings.xml @@ -0,0 +1,5 @@ + + + Nginx nedir? + Nginx, sahip olduğunuz bir sunucudan dosyaları görüntülemek için kullanılabilecek bir yazılımdır. Nginx kurulum kılavuzunu görmek için tıklayın + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values-vi/strings.xml b/NginxProvider/src/main/res/values-vi/strings.xml new file mode 100644 index 0000000..0852a2f --- /dev/null +++ b/NginxProvider/src/main/res/values-vi/strings.xml @@ -0,0 +1,5 @@ + + + Nginx là gì? + Nginx được dùng để hiển thị các tệp từ máy chủ mà bạn sở hữu. Chọn để xem hướng dẫn thiết lập Nginx + \ No newline at end of file diff --git a/NginxProvider/src/main/res/values/strings.xml b/NginxProvider/src/main/res/values/strings.xml new file mode 100644 index 0000000..699e083 --- /dev/null +++ b/NginxProvider/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + What is Nginx ? + Nginx is a software that can be used to display files from a server that you own. Click to see a Nginx setup guide + \ No newline at end of file