diff --git a/app/src/debug/res/values/strings.xml b/app/src/debug/res/values/strings.xml index ef58c36a6eb..92f0ffec672 100644 --- a/app/src/debug/res/values/strings.xml +++ b/app/src/debug/res/values/strings.xml @@ -1,4 +1,4 @@ - Dantotsu ß + Dantotsu β \ No newline at end of file diff --git a/app/src/main/java/ani/dantotsu/MainActivity.kt b/app/src/main/java/ani/dantotsu/MainActivity.kt index 3b8c4bbaeb3..39544ed7b9d 100644 --- a/app/src/main/java/ani/dantotsu/MainActivity.kt +++ b/app/src/main/java/ani/dantotsu/MainActivity.kt @@ -236,6 +236,7 @@ class MainActivity : AppCompatActivity() { .setData(Uri.parse("package:$packageName")) ) } + dismiss() } }.show(supportFragmentManager, "dialog") } diff --git a/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaAdapter.kt b/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaAdapter.kt index 87dfebed275..3093b0c4535 100644 --- a/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaAdapter.kt +++ b/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaAdapter.kt @@ -51,6 +51,7 @@ class OfflineMangaAdapter( val itemScoreBG = view.findViewById(R.id.itemCompactScoreBG) val ongoing = view.findViewById(R.id.itemCompactOngoing) val totalchapter = view.findViewById(R.id.itemCompactTotal) + val typeimage = view.findViewById(R.id.itemCompactTypeImage) val type = view.findViewById(R.id.itemCompactRelation) val typeView = view.findViewById(R.id.itemCompactType) @@ -69,6 +70,7 @@ class OfflineMangaAdapter( } // Bind item data to the views + typeimage.setImageResource(if (item.type == "Novel" ) R.drawable.ic_round_book_24 else R.drawable.ic_round_import_contacts_24) type.text = item.type typeView.visibility = View.VISIBLE imageView.setImageURI(item.image) diff --git a/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaFragment.kt b/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaFragment.kt index 116c1267f6d..ea1812dc22f 100644 --- a/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaFragment.kt +++ b/app/src/main/java/ani/dantotsu/download/manga/OfflineMangaFragment.kt @@ -1,6 +1,7 @@ package ani.dantotsu.download.manga import android.animation.ObjectAnimator +import android.annotation.SuppressLint import android.content.Context import android.content.Intent import android.net.Uri @@ -20,6 +21,7 @@ import android.widget.AbsListView import android.widget.AutoCompleteTextView import android.widget.GridView import android.widget.ImageView +import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.cardview.widget.CardView import androidx.fragment.app.Fragment @@ -57,6 +59,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener { private lateinit var gridView: GridView private lateinit var adapter: OfflineMangaAdapter + @SuppressLint("SetTextI18n") override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -177,7 +180,8 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener { snackString("no media found") } } - + val total = view.findViewById(R.id.total) + total.text = if (gridView.count > 0) "Manga and Novels (${gridView.count})" else "Empty List" gridView.setOnItemLongClickListener { parent, view, position, id -> // Get the OfflineMangaModel that was clicked val item = adapter.getItem(position) as OfflineMangaModel @@ -194,6 +198,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener { downloadManager.removeMedia(item.title, type) getDownloads() adapter.setItems(downloads) + } builder.setNegativeButton("No") { _, _ -> // Do nothing @@ -202,7 +207,6 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener { dialog.window?.setDimAmount(0.8f) true } - return view } diff --git a/app/src/main/java/ani/dantotsu/home/LoginFragment.kt b/app/src/main/java/ani/dantotsu/home/LoginFragment.kt index d3144237311..58bb2fc9055 100644 --- a/app/src/main/java/ani/dantotsu/home/LoginFragment.kt +++ b/app/src/main/java/ani/dantotsu/home/LoginFragment.kt @@ -28,5 +28,6 @@ class LoginFragment : Fragment() { binding.loginButton.setOnClickListener { Anilist.loginIntent(requireActivity()) } binding.loginDiscord.setOnClickListener { openLinkInBrowser(getString(R.string.discord)) } binding.loginGithub.setOnClickListener { openLinkInBrowser(getString(R.string.github)) } + binding.loginTelegram.setOnClickListener { openLinkInBrowser(getString(R.string.telegram)) } } } \ No newline at end of file diff --git a/app/src/main/java/ani/dantotsu/media/CalendarActivity.kt b/app/src/main/java/ani/dantotsu/media/CalendarActivity.kt index d6428a38e38..77035416c47 100644 --- a/app/src/main/java/ani/dantotsu/media/CalendarActivity.kt +++ b/app/src/main/java/ani/dantotsu/media/CalendarActivity.kt @@ -4,11 +4,13 @@ import android.annotation.SuppressLint import android.os.Bundle import android.util.TypedValue import android.view.View +import android.view.ViewGroup import android.view.Window import android.view.WindowManager import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat +import androidx.core.view.updateLayoutParams import androidx.lifecycle.MutableLiveData import androidx.lifecycle.lifecycleScope import ani.dantotsu.R @@ -16,8 +18,10 @@ import ani.dantotsu.Refresh import ani.dantotsu.databinding.ActivityListBinding import ani.dantotsu.loadData import ani.dantotsu.media.user.ListViewPagerAdapter +import ani.dantotsu.navBarHeight import ani.dantotsu.others.LangSet import ani.dantotsu.settings.UserInterfaceSettings +import ani.dantotsu.statusBarHeight import ani.dantotsu.themes.ThemeManager import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator @@ -76,6 +80,10 @@ class CalendarActivity : AppCompatActivity() { WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ) + binding.settingsContainer.updateLayoutParams { + topMargin = statusBarHeight + bottomMargin = navBarHeight + } } setContentView(binding.root) diff --git a/app/src/main/java/ani/dantotsu/media/MediaDetailsActivity.kt b/app/src/main/java/ani/dantotsu/media/MediaDetailsActivity.kt index a902a1cf43d..0d64ccad049 100644 --- a/app/src/main/java/ani/dantotsu/media/MediaDetailsActivity.kt +++ b/app/src/main/java/ani/dantotsu/media/MediaDetailsActivity.kt @@ -305,7 +305,6 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi } adult = media.isAdult - tabLayout.menu.clear() if (media.anime != null) { viewPager.adapter = @@ -317,7 +316,12 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi lifecycle, if (media.format == "NOVEL") SupportedMedia.NOVEL else SupportedMedia.MANGA ) - tabLayout.inflateMenu(R.menu.manga_menu_detail) + if (media.format == "NOVEL") { + tabLayout.inflateMenu(R.menu.novel_menu_detail) + } + else { + tabLayout.inflateMenu(R.menu.manga_menu_detail) + } anime = false } @@ -361,7 +365,6 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi R.id.info -> { selected = 0 } - R.id.watch, R.id.read -> { selected = 1 } diff --git a/app/src/main/java/ani/dantotsu/media/anime/AnimeWatchAdapter.kt b/app/src/main/java/ani/dantotsu/media/anime/AnimeWatchAdapter.kt index 2c4244ab82e..d91c2941486 100644 --- a/app/src/main/java/ani/dantotsu/media/anime/AnimeWatchAdapter.kt +++ b/app/src/main/java/ani/dantotsu/media/anime/AnimeWatchAdapter.kt @@ -386,7 +386,7 @@ class AnimeWatchAdapter( ext.sourceLanguage = lang } try { - binding?.animeSourceLanguage?.setText(parser.extension.sources[lang].lang) + binding?.animeSourceLanguage?.setText(parser.extension.sources.sortedBy { it.lang }[lang].lang) } catch (e: IndexOutOfBoundsException) { binding?.animeSourceLanguage?.setText( parser.extension.sources.firstOrNull()?.lang ?: "Unknown" diff --git a/app/src/main/java/ani/dantotsu/media/manga/MangaReadAdapter.kt b/app/src/main/java/ani/dantotsu/media/manga/MangaReadAdapter.kt index 9237c6b9e2b..1f91ed0910b 100644 --- a/app/src/main/java/ani/dantotsu/media/manga/MangaReadAdapter.kt +++ b/app/src/main/java/ani/dantotsu/media/manga/MangaReadAdapter.kt @@ -416,7 +416,7 @@ class MangaReadAdapter( ext.sourceLanguage = lang } try { - binding?.animeSourceLanguage?.setText(parser.extension.sources[lang].lang) + binding?.animeSourceLanguage?.setText(parser.extension.sources.sortedBy { it.lang }[lang].lang) } catch (e: IndexOutOfBoundsException) { binding?.animeSourceLanguage?.setText( parser.extension.sources.firstOrNull()?.lang ?: "Unknown" diff --git a/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt b/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt index 87930156776..b64c8cdb976 100644 --- a/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt +++ b/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt @@ -5,12 +5,14 @@ import android.content.Context import android.os.Bundle import android.util.TypedValue import android.view.View +import android.view.ViewGroup import android.view.Window import android.view.WindowManager import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.PopupMenu import androidx.core.content.ContextCompat +import androidx.core.view.updateLayoutParams import androidx.lifecycle.MutableLiveData import androidx.lifecycle.lifecycleScope import ani.dantotsu.R @@ -18,9 +20,11 @@ import ani.dantotsu.Refresh import ani.dantotsu.currContext import ani.dantotsu.databinding.ActivityListBinding import ani.dantotsu.loadData +import ani.dantotsu.navBarHeight import ani.dantotsu.others.LangSet import ani.dantotsu.saveData import ani.dantotsu.settings.UserInterfaceSettings +import ani.dantotsu.statusBarHeight import ani.dantotsu.themes.ThemeManager import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator @@ -77,12 +81,16 @@ class ListActivity : AppCompatActivity() { WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ) + binding.settingsContainer.updateLayoutParams { + topMargin = statusBarHeight + bottomMargin = navBarHeight + } } setContentView(binding.root) val anime = intent.getBooleanExtra("anime", true) - binding.listTitle.text = (if (anime) "Anime" else "Manga") + " List" - + binding.listTitle.text = + intent.getStringExtra("username") + "'s " + (if (anime) "Anime" else "Manga") + " List" binding.listTabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { override fun onTabSelected(tab: TabLayout.Tab?) { this@ListActivity.selectedTabIdx = tab?.position ?: 0 diff --git a/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt b/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt index 32e3a7e7f53..93cecdcd08b 100644 --- a/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt @@ -6,6 +6,7 @@ import android.os.Build.VERSION.* import android.os.Bundle import android.text.Editable import android.text.TextWatcher +import android.view.View import android.view.ViewGroup import android.widget.AutoCompleteTextView import androidx.activity.OnBackPressedCallback @@ -23,12 +24,8 @@ import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator class ExtensionsActivity : AppCompatActivity() { - private val restartMainActivity = object : OnBackPressedCallback(false) { - override fun handleOnBackPressed() = startMainActivity(this@ExtensionsActivity) - } lateinit var binding: ActivityExtensionsBinding - @SuppressLint("SetTextI18n") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -119,6 +116,7 @@ class ExtensionsActivity : AppCompatActivity() { initActivity(this) + binding.languageselect.visibility = View.GONE /* TODO binding.languageselect.setOnClickListener { val popup = PopupMenu(this, it) diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 953cc617446..d20afc39981 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -508,10 +508,6 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListen lifecycleScope.launch { binding.settingBuyMeCoffee.pop() } - binding.settingUPI.visibility = if (checkCountry(this)) View.VISIBLE else View.GONE - lifecycleScope.launch { - binding.settingUPI.pop() - } binding.loginDiscord.setOnClickListener { openLinkInBrowser(getString(R.string.discord)) @@ -519,7 +515,9 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListen binding.loginGithub.setOnClickListener { openLinkInBrowser(getString(R.string.github)) } - + binding.loginTelegram.setOnClickListener { + openLinkInBrowser(getString(R.string.telegram)) + } binding.settingsUi.setOnClickListener { startActivity(Intent(this, UserInterfaceSettingsActivity::class.java)) } @@ -757,8 +755,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListen } setPositiveButton("denote :)") { - if (binding.settingUPI.visibility == View.VISIBLE) binding.settingUPI.performClick() - else binding.settingBuyMeCoffee.performClick() + binding.settingBuyMeCoffee.performClick() dismiss() } show(supportFragmentManager, "dialog") diff --git a/app/src/main/java/ani/dantotsu/themes/ThemeManager.kt b/app/src/main/java/ani/dantotsu/themes/ThemeManager.kt index 8ee3f62dfc5..076277fd564 100644 --- a/app/src/main/java/ani/dantotsu/themes/ThemeManager.kt +++ b/app/src/main/java/ani/dantotsu/themes/ThemeManager.kt @@ -49,7 +49,7 @@ class ThemeManager(private val context: Context) { "SAIKOU" -> if (useOLED) R.style.Theme_Dantotsu_SaikouOLED else R.style.Theme_Dantotsu_Saikou "RED" -> if (useOLED) R.style.Theme_Dantotsu_RedOLED else R.style.Theme_Dantotsu_Red "LAVENDER" -> if (useOLED) R.style.Theme_Dantotsu_LavenderOLED else R.style.Theme_Dantotsu_Lavender - "EMERALD" -> if (useOLED) R.style.Theme_Dantotsu_EmeraldOLED else R.style.Theme_Dantotsu_Emerald + "OCEAN" -> if (useOLED) R.style.Theme_Dantotsu_OceanOLED else R.style.Theme_Dantotsu_Ocean "MONOCHROME (BETA)" -> if (useOLED) R.style.Theme_Dantotsu_MonochromeOLED else R.style.Theme_Dantotsu_Monochrome else -> if (useOLED) R.style.Theme_Dantotsu_PurpleOLED else R.style.Theme_Dantotsu_Purple } @@ -117,7 +117,7 @@ class ThemeManager(private val context: Context) { SAIKOU("SAIKOU"), RED("RED"), LAVENDER("LAVENDER"), - EMERALD("EMERALD"), + OCEAN("OCEAN"), MONOCHROME("MONOCHROME (BETA)"); companion object { diff --git a/app/src/main/res/drawable/ic_round_book_24.xml b/app/src/main/res/drawable/ic_round_book_24.xml new file mode 100644 index 00000000000..3ab0b826ac3 --- /dev/null +++ b/app/src/main/res/drawable/ic_round_book_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_round_filter_24.xml b/app/src/main/res/drawable/ic_round_filter_24.xml index c5b854847da..103f077195c 100644 --- a/app/src/main/res/drawable/ic_round_filter_24.xml +++ b/app/src/main/res/drawable/ic_round_filter_24.xml @@ -1,4 +1,12 @@ - + + + diff --git a/app/src/main/res/layout/activity_extensions.xml b/app/src/main/res/layout/activity_extensions.xml index 728236ba892..f4611599ad6 100644 --- a/app/src/main/res/layout/activity_extensions.xml +++ b/app/src/main/res/layout/activity_extensions.xml @@ -80,9 +80,7 @@ app:tabPaddingEnd="16dp" app:tabPaddingStart="16dp" app:tabTextAppearance="@style/NavBarText" - app:tabGravity="fill"> - - + app:tabGravity="fill"/> diff --git a/app/src/main/res/layout/activity_list.xml b/app/src/main/res/layout/activity_list.xml index 395c1e92c58..3b48c587324 100644 --- a/app/src/main/res/layout/activity_list.xml +++ b/app/src/main/res/layout/activity_list.xml @@ -4,8 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".media.user.ListActivity" - android:fitsSystemWindows="true"> + tools:context=".media.user.ListActivity"> - + android:orientation="vertical"> + - + - + - + + - + tools:ignore="SpeakableTextPresentCheck"/> - - - - - - + diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml index 5d906baf9ef..c93d5700d09 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/app/src/main/res/layout/fragment_login.xml @@ -76,6 +76,15 @@ android:src="@drawable/ic_github" app:tint="?attr/colorOutline" tools:ignore="ContentDescription" /> + diff --git a/app/src/main/res/layout/fragment_manga_offline.xml b/app/src/main/res/layout/fragment_manga_offline.xml index f829fe32a4a..307a2f49acd 100644 --- a/app/src/main/res/layout/fragment_manga_offline.xml +++ b/app/src/main/res/layout/fragment_manga_offline.xml @@ -87,15 +87,16 @@ android:orientation="horizontal"> + tools:ignore="HardcodedText,RtlSymmetry" /> - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/menu/novel_menu_detail.xml b/app/src/main/res/menu/novel_menu_detail.xml new file mode 100644 index 00000000000..94b4ec7e460 --- /dev/null +++ b/app/src/main/res/menu/novel_menu_detail.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index fbda070994f..d5466d50a87 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -209,7 +209,7 @@ @color/md_theme_dark_7_inversePrimary - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 23e646c500b..c8bc28c093b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,7 +11,7 @@ https://discord.gg/4HPZ5nAWwM https://github.com/rebelonion/Dantotsu - + https://t.me/+gzBCQExtLQo1YTNh Home Anime Browse Anime diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 5b893737322..691ac4aef66 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -285,7 +285,7 @@ @color/md_theme_light_7_inversePrimary -