Skip to content

Commit

Permalink
minor tweaks (#115)
Browse files Browse the repository at this point in the history
* Added telegram link

* Removed UPI (rebel not indian)

* minor changes

* Shows number of manga/Ln downloaded

* fixed list name overlapping with notch

* wrong index selection in language fixed

* novel icon

* Emerald theme name changed to Ocean

* forgot to remove

* why was these still there
  • Loading branch information
aayush2622 authored Jan 9, 2024
1 parent af992bd commit 01f9e86
Show file tree
Hide file tree
Showing 25 changed files with 149 additions and 190 deletions.
2 changes: 1 addition & 1 deletion app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Dantotsu ß</string>
<string name="app_name">Dantotsu β</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/java/ani/dantotsu/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class MainActivity : AppCompatActivity() {
.setData(Uri.parse("package:$packageName"))
)
}
dismiss()
}
}.show(supportFragmentManager, "dialog")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class OfflineMangaAdapter(
val itemScoreBG = view.findViewById<View>(R.id.itemCompactScoreBG)
val ongoing = view.findViewById<CardView>(R.id.itemCompactOngoing)
val totalchapter = view.findViewById<TextView>(R.id.itemCompactTotal)
val typeimage = view.findViewById<ImageView>(R.id.itemCompactTypeImage)
val type = view.findViewById<TextView>(R.id.itemCompactRelation)
val typeView = view.findViewById<LinearLayout>(R.id.itemCompactType)

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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?,
Expand Down Expand Up @@ -177,7 +180,8 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
snackString("no media found")
}
}

val total = view.findViewById<TextView>(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
Expand All @@ -194,6 +198,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
downloadManager.removeMedia(item.title, type)
getDownloads()
adapter.setItems(downloads)

}
builder.setNegativeButton("No") { _, _ ->
// Do nothing
Expand All @@ -202,7 +207,6 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
dialog.window?.setDimAmount(0.8f)
true
}

return view
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/ani/dantotsu/home/LoginFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)) }
}
}
8 changes: 8 additions & 0 deletions app/src/main/java/ani/dantotsu/media/CalendarActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ 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
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
Expand Down Expand Up @@ -76,6 +80,10 @@ class CalendarActivity : AppCompatActivity() {
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = statusBarHeight
bottomMargin = navBarHeight
}
}
setContentView(binding.root)

Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/ani/dantotsu/media/MediaDetailsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
}

adult = media.isAdult

tabLayout.menu.clear()
if (media.anime != null) {
viewPager.adapter =
Expand All @@ -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
}

Expand Down Expand Up @@ -361,7 +365,6 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
R.id.info -> {
selected = 0
}

R.id.watch, R.id.read -> {
selected = 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/ani/dantotsu/media/user/ListActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@ 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
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
Expand Down Expand Up @@ -77,12 +81,16 @@ class ListActivity : AppCompatActivity() {
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
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
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -119,6 +116,7 @@ class ExtensionsActivity : AppCompatActivity() {


initActivity(this)
binding.languageselect.visibility = View.GONE
/* TODO
binding.languageselect.setOnClickListener {
val popup = PopupMenu(this, it)
Expand Down
11 changes: 4 additions & 7 deletions app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,16 @@ 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))
}
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))
}
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/ani/dantotsu/themes/ThemeManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_round_book_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,2H6C4.895,2 4,2.895 4,4v16c0,1.105 0.895,2 2,2h12c1.105,0 2,-0.895 2,-2V4C20,2.895 19.105,2 18,2zM11,12l-2.5,-1.5L6,12V5c0,-0.552 0.448,-1 1,-1h3c0.552,0 1,0.448 1,1V12z"
android:fillColor="#000000"/>
</vector>
10 changes: 9 additions & 1 deletion app/src/main/res/drawable/ic_round_filter_24.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<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="#000000" android:fillType="evenOdd" android:pathData="M3,7C3,6.448 3.448,6 4,6H20C20.552,6 21,6.448 21,7C21,7.552 20.552,8 20,8H4C3.448,8 3,7.552 3,7ZM6,12C6,11.448 6.448,11 7,11H17C17.552,11 18,11.448 18,12C18,12.552 17.552,13 17,13H7C6.448,13 6,12.552 6,12ZM9,17C9,16.448 9.448,16 10,16H14C14.552,16 15,16.448 15,17C15,17.552 14.552,18 14,18H10C9.448,18 9,17.552 9,17Z"/>
<path android:fillColor="#00000000" android:pathData="M5,7H19"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="3"/>
<path android:fillColor="#00000000" android:pathData="M5,12L19,12"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="3"/>
<path android:fillColor="#00000000" android:pathData="M5,17L19,17"
android:strokeColor="#000000" android:strokeLineCap="round"
android:strokeLineJoin="round" android:strokeWidth="3"/>
</vector>
6 changes: 2 additions & 4 deletions app/src/main/res/layout/activity_extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@
app:tabPaddingEnd="16dp"
app:tabPaddingStart="16dp"
app:tabTextAppearance="@style/NavBarText"
app:tabGravity="fill">
</com.google.android.material.tabs.TabLayout>

app:tabGravity="fill"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/searchView"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
Expand Down Expand Up @@ -117,7 +115,7 @@
</com.google.android.material.textfield.TextInputLayout>

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
Expand Down
Loading

0 comments on commit 01f9e86

Please sign in to comment.