oh no
This commit is contained in:
parent
4db301ca7a
commit
3998d88297
39 changed files with 768 additions and 31 deletions
|
@ -20,6 +20,7 @@ import ani.dantotsu.setSafeOnClickListener
|
|||
import ani.dantotsu.shareImage
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import ani.dantotsu.others.LangSet
|
||||
import ani.dantotsu.toast
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation
|
||||
import com.davemorrissey.labs.subscaleview.ImageSource
|
||||
|
|
24
app/src/main/java/ani/dantotsu/others/LangSet.kt
Normal file
24
app/src/main/java/ani/dantotsu/others/LangSet.kt
Normal file
|
@ -0,0 +1,24 @@
|
|||
package ani.dantotsu.others
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Resources
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
|
||||
|
||||
class LangSet {
|
||||
companion object{
|
||||
fun setLocale(activity: Activity) {
|
||||
val useCursedLang = activity.getSharedPreferences("Dantotsu", Activity.MODE_PRIVATE).getBoolean("use_cursed_lang", false)
|
||||
if(!useCursedLang) return
|
||||
val locale = Locale("en", "rDW")
|
||||
Locale.setDefault(locale)
|
||||
val resources: Resources = activity.resources
|
||||
val config: Configuration = resources.configuration
|
||||
config.setLocale(locale)
|
||||
resources.updateConfiguration(config, resources.displayMetrics)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,6 +16,7 @@ import ani.dantotsu.connections.anilist.Anilist
|
|||
import ani.dantotsu.databinding.ActivityImageSearchBinding
|
||||
import ani.dantotsu.media.MediaDetailsActivity
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import ani.dantotsu.others.LangSet
|
||||
import ani.dantotsu.toast
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -47,7 +48,8 @@ class ImageSearchActivity : AppCompatActivity() {
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
LangSet.setLocale(this)
|
||||
ThemeManager(this).applyTheme()
|
||||
binding = ActivityImageSearchBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue