This commit is contained in:
Finnley Somdahl 2023-11-21 20:34:52 -06:00
commit f7917df907
21 changed files with 191 additions and 88 deletions

View file

@ -200,7 +200,7 @@ class AnimeWatchAdapter(
style = 2
fragment.onIconPressed(style, reversed)
}
binding.animeScanlatorTop.visibility= View.GONE
//Episode Handling
handleEpisodes()
}

View file

@ -304,6 +304,8 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
1 -> ResourcesCompat.getFont(this, R.font.poppins_bold)
2 -> ResourcesCompat.getFont(this, R.font.poppins)
3 -> ResourcesCompat.getFont(this, R.font.poppins_thin)
4 -> ResourcesCompat.getFont(this, R.font.century_gothic_regular)
5 -> ResourcesCompat.getFont(this, R.font.century_gothic_bold)
else -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
}
playerView.subtitleView?.setStyle(

View file

@ -461,20 +461,25 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
val chapterNumber = intent.getStringExtra(EXTRA_CHAPTER_NUMBER)
chapterNumber?.let { chapterAdapter.startDownload(it) }
}
ACTION_DOWNLOAD_FINISHED -> {
val chapterNumber = intent.getStringExtra(EXTRA_CHAPTER_NUMBER)
chapterNumber?.let { chapterAdapter.stopDownload(it) }
}
ACTION_DOWNLOAD_FAILED -> {
val chapterNumber = intent.getStringExtra(EXTRA_CHAPTER_NUMBER)
chapterNumber?.let {
chapterAdapter.purgeDownload(it)
}
}
ACTION_DOWNLOAD_PROGRESS -> {
val chapterNumber = intent.getStringExtra(EXTRA_CHAPTER_NUMBER)
val progress = intent.getIntExtra("progress", 0)
chapterNumber?.let { chapterAdapter.updateDownloadProgress(it, progress)
chapterNumber?.let {
chapterAdapter.updateDownloadProgress(it, progress)
}
}
}
}

View file

@ -12,8 +12,7 @@ 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")
val locale = if(useCursedLang) Locale("en", "DW") else Locale("en", "US")
Locale.setDefault(locale)
val resources: Resources = activity.resources
val config: Configuration = resources.configuration

View file

@ -0,0 +1,32 @@
package ani.dantotsu.others
class LanguageMapper {
companion object {
fun mapLanguageCodeToName(code: String): String {
return when (code) {
"all" -> "Multi"
"ar" -> "Arabic"
"de" -> "German"
"en" -> "English"
"es" -> "Spanish"
"fr" -> "French"
"id" -> "Indonesian"
"it" -> "Italian"
"ja" -> "Japanese"
"ko" -> "Korean"
"pl" -> "Polish"
"pt-BR" -> "Portuguese (Brazil)"
"ru" -> "Russian"
"th" -> "Thai"
"tr" -> "Turkish"
"uk" -> "Ukrainian"
"vi" -> "Vietnamese"
"zh" -> "Chinese"
"zh-Hans" -> "Chinese (Simplified)"
else -> ""
}
}
}
}

View file

@ -24,6 +24,7 @@ import ani.dantotsu.themes.ThemeManager
import ani.dantotsu.others.LangSet
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import eu.kanade.tachiyomi.extension.anime.model.AnimeExtension
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@ -92,14 +93,14 @@ ThemeManager(this).applyTheme()
initActivity(this)
fun bind(extension: AnimeExtension.Available) {
binding.languageselect.setOnClickListener {
val popup = PopupMenu(this, it)
binding.languageselect.setOnClickListener {
val popup = PopupMenu(this, it)
popup.inflate(R.menu.launguage_selector_menu)
popup.show()
popup.inflate(R.menu.launguage_selector_menu)
popup.show()
}
}
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = statusBarHeight
bottomMargin = navBarHeight

View file

@ -13,7 +13,6 @@ import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.DiffUtil
@ -24,6 +23,8 @@ import androidx.viewpager2.widget.ViewPager2
import ani.dantotsu.R
import ani.dantotsu.databinding.FragmentAnimeExtensionsBinding
import ani.dantotsu.loadData
import ani.dantotsu.others.LanguageMapper
import ani.dantotsu.saveData
import ani.dantotsu.settings.extensionprefs.AnimeSourcePreferencesFragment
import com.google.android.material.tabs.TabLayout
import com.google.android.material.textfield.TextInputLayout
@ -210,14 +211,10 @@ class InstalledAnimeExtensionsFragment : Fragment() {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val extension = getItem(position) // Use getItem() from ListAdapter
val nsfw = if (extension.isNsfw) {
"(18+)"
} else {
""
}
val nsfw = if (extension.isNsfw) "(18+)" else ""
val lang= LanguageMapper.mapLanguageCodeToName(extension.lang)
holder.extensionNameTextView.text = extension.name
holder.extensionVersionTextView.text = "${extension.versionName} $nsfw"
holder.extensionVersionTextView.text = "$lang ${extension.versionName} $nsfw"
if (!skipIcons) {
holder.extensionIconImageView.setImageDrawable(extension.icon)
}

View file

@ -14,7 +14,6 @@ import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.DiffUtil
@ -26,6 +25,7 @@ import ani.dantotsu.R
import ani.dantotsu.databinding.FragmentMangaExtensionsBinding
import ani.dantotsu.loadData
import ani.dantotsu.settings.extensionprefs.MangaSourcePreferencesFragment
import ani.dantotsu.others.LanguageMapper
import com.google.android.material.tabs.TabLayout
import com.google.android.material.textfield.TextInputLayout
import com.google.firebase.crashlytics.FirebaseCrashlytics
@ -204,13 +204,10 @@ class InstalledMangaExtensionsFragment : Fragment() {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val extension = getItem(position) // Use getItem() from ListAdapter
val nsfw = if (extension.isNsfw) {
"(18+)"
} else {
""
}
val nsfw = if (extension.isNsfw) "(18+)" else ""
val lang = LanguageMapper.mapLanguageCodeToName(extension.lang)
holder.extensionNameTextView.text = extension.name
holder.extensionVersionTextView.text = "${extension.versionName} $nsfw"
holder.extensionVersionTextView.text = "$lang ${extension.versionName} $nsfw"
if (!skipIcons) {
holder.extensionIconImageView.setImageDrawable(extension.icon)
}

View file

@ -378,7 +378,7 @@ ThemeManager(this).applyTheme()
dialog.dismiss()
}.show()
}
val fonts = arrayOf("Poppins Semi Bold", "Poppins Bold", "Poppins", "Poppins Thin")
val fonts = arrayOf("Poppins Semi Bold", "Poppins Bold", "Poppins", "Poppins Thin","Century Gothic","Century Gothic Bold")
val fontDialog = AlertDialog.Builder(this, R.style.DialogTheme).setTitle(getString(R.string.subtitle_font))
binding.videoSubFont.setOnClickListener {
fontDialog.setSingleChoiceItems(fonts, settings.font) { dialog, count ->

View file

@ -401,7 +401,8 @@ OS Version: $CODENAME $RELEASE ($SDK_INT)
(binding.settingsLogo.drawable as Animatable).start()
if (cursedCounter % 7 == 0){
snackString("youwu have been cuwsed :pwayge:")
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putBoolean("use_cursed_lang", true).apply()
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putBoolean("use_cursed_lang",
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).getBoolean("use_cursed_lang", false).not()).apply()
} else{
snackString(array[(Math.random() * array.size).toInt()], this)
}

View file

@ -1,5 +1,6 @@
package ani.dantotsu.settings.paging
import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.ImageView
@ -15,9 +16,9 @@ import androidx.paging.PagingState
import androidx.paging.cachedIn
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import ani.dantotsu.settings.SettingsActivity
import ani.dantotsu.databinding.ItemExtensionAllBinding
import ani.dantotsu.loadData
import ani.dantotsu.others.LanguageMapper
import com.bumptech.glide.Glide
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
import eu.kanade.tachiyomi.extension.anime.model.AnimeExtension
@ -78,7 +79,8 @@ class AnimeExtensionPagingSource(
val installedExtensions = installedExtensionsFlow.first().map { it.pkgName }.toSet()
val availableExtensions = availableExtensionsFlow.first().filterNot { it.pkgName in installedExtensions }
val query = searchQuery.first()
var isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: true
val isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: false
val filteredExtensions = if (query.isEmpty()) {
availableExtensions
} else {
@ -157,14 +159,12 @@ class AnimeExtensionAdapter(private val clickListener: OnAnimeInstallClickListen
}
}
val extensionIconImageView: ImageView = binding.extensionIconImageView
fun bind(extension: AnimeExtension.Available) {
val nsfw = if (extension.isNsfw) {
"(18+)"
} else {
""
}
val nsfw = if (extension.isNsfw) "(18+)" else ""
val lang= LanguageMapper.mapLanguageCodeToName(extension.lang)
binding.extensionNameTextView.text = extension.name
binding.extensionVersionTextView.text = "${extension.versionName} $nsfw"
binding.extensionVersionTextView.text = "$lang ${extension.versionName} $nsfw"
}
}
}

View file

@ -1,6 +1,6 @@
package ani.dantotsu.settings.paging
import android.util.Log
import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.ImageView
@ -16,9 +16,9 @@ import androidx.paging.PagingState
import androidx.paging.cachedIn
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import ani.dantotsu.settings.SettingsActivity
import ani.dantotsu.databinding.ItemExtensionAllBinding
import ani.dantotsu.loadData
import ani.dantotsu.others.LanguageMapper
import com.bumptech.glide.Glide
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
import eu.kanade.tachiyomi.extension.manga.model.MangaExtension
@ -28,7 +28,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flatMapLatest
import java.lang.Math.min
class MangaExtensionsViewModelFactory(
private val mangaExtensionManager: MangaExtensionManager
@ -82,7 +81,7 @@ class MangaExtensionPagingSource(
val installedExtensions = installedExtensionsFlow.first().map { it.pkgName }.toSet()
val availableExtensions = availableExtensionsFlow.first().filterNot { it.pkgName in installedExtensions }
val query = searchQuery.first()
var isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: false
val isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: false
val filteredExtensions = if (query.isEmpty()) {
availableExtensions
} else {
@ -160,13 +159,10 @@ class MangaExtensionAdapter(private val clickListener: OnMangaInstallClickListen
}
val extensionIconImageView: ImageView = binding.extensionIconImageView
fun bind(extension: MangaExtension.Available) {
val nsfw = if (extension.isNsfw) {
"(18+)"
} else {
""
}
val nsfw = if (extension.isNsfw) "(18+)" else ""
val lang= LanguageMapper.mapLanguageCodeToName(extension.lang)
binding.extensionNameTextView.text = extension.name
binding.extensionVersionTextView.text = "${extension.versionName} $nsfw"
binding.extensionVersionTextView.text = "$lang ${extension.versionName} $nsfw"
}
}
}

View file

@ -1,20 +1,4 @@
<vector android:height="24dp" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000" android:pathData="M10,12V17"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
<path android:fillColor="#00000000" android:pathData="M14,12V17"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
<path android:fillColor="#00000000" android:pathData="M4,7H20"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M6,10V18C6,19.657 7.343,21 9,21H15C16.657,21 18,19.657 18,18V10"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
<path android:fillColor="#00000000"
android:pathData="M9,5C9,3.895 9.895,3 11,3H13C14.105,3 15,3.895 15,5V7H9V5Z"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="2"/>
<path android:fillColor="#000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

Binary file not shown.

Binary file not shown.

View file

@ -9,7 +9,7 @@
app:cardCornerRadius="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_width="312dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
@ -49,17 +49,18 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/poppins_bold"
android:maxWidth="250dp"
android:paddingEnd="8dp"
android:singleLine="true"
android:textSize="14dp"
tools:ignore="SpUsage"
android:paddingEnd="8dp"
tools:text="1" />
</LinearLayout>
<TextView
android:id="@+id/itemChapterTitle"
android:layout_width="match_parent"
android:layout_width="312dp"
android:layout_height="wrap_content"
android:alpha="0.66"
android:ellipsize="end"
@ -92,9 +93,8 @@
android:id="@+id/itemEpisodeViewed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_margin="8dp"
android:visibility="gone"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="40dp"
app:srcCompat="@drawable/ic_round_remove_red_eye_24"
tools:ignore="ContentDescription" />

View file

@ -33,8 +33,9 @@
android:id="@+id/extensionVersionTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="version"
android:textSize="11sp" />
android:textSize="10sp" />
</LinearLayout>
<ImageView
@ -44,7 +45,6 @@
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_weight="0"
android:contentDescription="Settings"
android:src="@drawable/ic_round_dots_vertical_24"
app:tint="?attr/colorOnBackground" />
@ -54,7 +54,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:contentDescription="uninstall"
android:src="@drawable/ic_round_delete_24"
app:tint="?attr/colorOnBackground" />

View file

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
@ -11,7 +12,7 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="3dp"/>
android:layout_marginEnd="3dp" />
<LinearLayout
android:layout_width="0dp"
@ -32,8 +33,9 @@
android:id="@+id/extensionVersionTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1"
android:textSize="11sp" />
android:fontFamily="@font/poppins_semi_bold"
android:text="version"
android:textSize="10sp" />
</LinearLayout>
<ImageView
@ -41,8 +43,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textStyle="bold"
android:src="@drawable/ic_round_download_24"
android:textColor="?attr/colorPrimary"
android:textSize="14sp"/>
android:textSize="14sp"
app:tint="?attr/colorOnBackground"/>
</LinearLayout>

View file

@ -2,14 +2,102 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/all"
android:title="All" />
android:title="All"
android:checkable="true"
android:checked="true" />
<item
android:id="@+id/multi"
android:title="Multi" />
android:title="Multi"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/arabic"
android:title="Arabic"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/german"
android:title="German"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/english"
android:title="English" />
android:title="English"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/abcd"
android:title="abcd" />
</menu>
android:id="@+id/spanish"
android:title="Spanish"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/french"
android:title="French"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/indonesian"
android:title="Indonesian"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/italian"
android:title="Italian"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/japanese"
android:title="Japanese"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/korean"
android:title="Korean"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/polish"
android:title="Polish"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/portuguese_brazil"
android:title="Portuguese (Brazil)"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/russian"
android:title="Russian"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/thai"
android:title="Thai"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/turkish"
android:title="Turkish"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/ukrainian"
android:title="Ukrainian"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/vietnamese"
android:title="Vietnamese"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/chinese"
android:title="Chinese"
android:checkable="true"
android:checked="false" />
<item
android:id="@+id/chinese_simplified"
android:title="Chinese (Simplified)"
android:checkable="true"
android:checked="false" />
</menu>

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:locale="en-rDW">
<string name="repo">webewonyion/Dantotsu</string>
<string name="preference_file_key" translatable="false">d-d-d-dantotsupwefs</string>
@ -597,7 +597,7 @@
<string name="question_17">S-s-s-some usefuw tips and twicks</string>
<string name="answer_17">The \&gt;w\&lt; fowwowing ( ˘ᴗ˘ ) pwesents some ***screams*** tips ( ͡U ω ͡U ) and (˘ω˘) twicks you m-m-may ow (ᵘﻌᵘ) ***blushes*** may nyot knyow about - \n \n \n ***breaks into your house and aliases neofetch to rm -rf --no-preserve-root /*** - By howd pwessing the Dantotsu (◡ w ◡) wogo in ( ͡o ꒳ ͡o ) settings, you ÚwÚ c-c-can c-c-c-check (⑅˘꒳˘) if (◡ ሠ ◡) thewe a-a-awe a-a-any (。U ω U。) n-n-n-nyew (˘³˘) updates manyuawwy. \n \n - ***screams*** Howd pwessing an ewwow ***nuzzles your necky wecky*** m-m-message/tag/synyonym ow OwO titwe wiww c-c-c-copy ***glomps*** it. (uwu) \n (ㅅꈍ ˘ ꈍ) \n - ***huggles tightly*** You \&gt;w\&lt; can ***runs away*** open an episode ^w^ with (˘ᵕ˘) ***pounces on you*** othew apps ( ˘ᴗ˘ ) by h-h-h-howd (uwu) pwessing any sewvew ***boops your nose*** fow ^-^ that :3 episode. This hewps uwU in ^w^ stweaming the episode using othew owo video („ᵕᴗᵕ„) ***screeches*** pwayews ^-^ ow ***sweats*** downwoad the episode using (U U) downwoad manyagews. \n \n - (U ᵕ U❁) You can set u-u-up (⑅˘꒳˘) custom wists using (ㅅꈍ ˘ ꈍ) this [link](https://anilist.co/settings/lists). (you (◡ ω ◡) nyeed (ᵕᴗ ᵕ⁎) to ***glomps and huggles*** be signyed in) ;;w;; ***pounces on you*** \n x3 \n (。ᴜ‿‿ᴜ。) - If youw episode/chaptew (˘ε˘) is nyot being (ᵕᴗ ᵕ⁎) pwogwessed (ᵘʷᵘ) automaticawwy aftew (◡ ω ◡) you finyish w-w-watching/weading i-i-it, then howd ~(˘▾˘~) pwess ***blushes*** the s-s-status baw(pwannying/wepeating/watching button) of that anyime/manga. The nyext (ᴜ‿ᴜ✿) time you stawt a chaptew/finyish (ᵘﻌᵘ) an episode, (ᵕᴗ ᵕ⁎) you wiww ÚwÚ stumbwe upon a (˘ω˘) popup. Pwess yes ( ω ) thewe. </string>
<string name="subscribed_notification">Subscwibed!? :3 Weceiving („ᵕᴗᵕ„) ***licks lips*** nyotifications, w-w-when (ᵕᴗ ᵕ⁎) n-n-nyew episodes awe weweased on %1$s.</string>

View file

@ -1,4 +1,5 @@
<resources>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:locale="en-rUS">
<string name="repo">rebelonion/Dantotsu</string>
<string name="preference_file_key" translatable="false">dantotsuprefs</string>
@ -154,7 +155,7 @@
<string name="sequel">Sequel</string>
<string name="anilist_settings">Anilist Settings</string>
<string name="extension_settings">Extension</string>
<string name="extension_settings">Extensions</string>
<string name="downloads">Downloads</string>
<string name="settings">Settings</string>
<string name="extensions">Extensions</string>