feat: WIP new settings UI
This commit is contained in:
parent
f8a6fad513
commit
91d1d2cf1d
20 changed files with 1061 additions and 1503 deletions
|
@ -1,10 +1,18 @@
|
||||||
package ani.dantotsu.settings
|
package ani.dantotsu.settings
|
||||||
|
|
||||||
import android.app.Activity
|
import ani.dantotsu.databinding.ItemSettingsBinding
|
||||||
|
import ani.dantotsu.databinding.ItemSettingsSwitchBinding
|
||||||
|
import java.lang.reflect.Array
|
||||||
|
|
||||||
data class Settings(
|
data class Settings(
|
||||||
|
val type: Int,
|
||||||
val name : String,
|
val name : String,
|
||||||
val icon : Int,
|
|
||||||
val desc: String,
|
val desc: String,
|
||||||
val activity: Class<out Activity>
|
val icon : Int,
|
||||||
)
|
val onClick: ((ItemSettingsBinding) -> Unit)? = null,
|
||||||
|
val onLongClick: (() -> Unit)? = null,
|
||||||
|
var isChecked : Boolean = false,
|
||||||
|
val switch: ((isChecked:Boolean , view: ItemSettingsSwitchBinding ) -> Unit)? = null,
|
||||||
|
val isVisible: Boolean = true,
|
||||||
|
val isActivity: Boolean = false
|
||||||
|
)
|
|
@ -2,28 +2,22 @@ package ani.dantotsu.settings
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.BuildConfig
|
import ani.dantotsu.BuildConfig
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.databinding.ActivitySettingsAboutBinding
|
import ani.dantotsu.databinding.ActivitySettingsAboutBinding
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
import ani.dantotsu.navBarHeight
|
import ani.dantotsu.navBarHeight
|
||||||
import ani.dantotsu.others.AppUpdater
|
|
||||||
import ani.dantotsu.others.CustomBottomDialog
|
import ani.dantotsu.others.CustomBottomDialog
|
||||||
import ani.dantotsu.restartApp
|
import ani.dantotsu.restartApp
|
||||||
import ani.dantotsu.settings.saving.PrefManager
|
import ani.dantotsu.settings.saving.PrefManager
|
||||||
import ani.dantotsu.settings.saving.PrefName
|
import ani.dantotsu.settings.saving.PrefName
|
||||||
import ani.dantotsu.snackString
|
|
||||||
import ani.dantotsu.statusBarHeight
|
import ani.dantotsu.statusBarHeight
|
||||||
import ani.dantotsu.themes.ThemeManager
|
import ani.dantotsu.themes.ThemeManager
|
||||||
import ani.dantotsu.util.Logger
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
|
|
||||||
class SettingsAboutActivity : AppCompatActivity() {
|
class SettingsAboutActivity : AppCompatActivity() {
|
||||||
private lateinit var binding: ActivitySettingsAboutBinding
|
private lateinit var binding: ActivitySettingsAboutBinding
|
||||||
|
@ -43,84 +37,91 @@ class SettingsAboutActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
aboutSettingsBack.setOnClickListener { onBackPressedDispatcher.onBackPressed() }
|
aboutSettingsBack.setOnClickListener { onBackPressedDispatcher.onBackPressed() }
|
||||||
|
|
||||||
settingsDev.setOnClickListener {
|
settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
DevelopersDialogFragment().show(supportFragmentManager, "dialog")
|
arrayListOf(
|
||||||
}
|
Settings(
|
||||||
settingsForks.setOnClickListener {
|
type = 1,
|
||||||
ForksDialogFragment().show(supportFragmentManager, "dialog")
|
name = getString(R.string.faq),
|
||||||
}
|
desc = getString(R.string.faq),
|
||||||
settingsDisclaimer.setOnClickListener {
|
icon = R.drawable.ic_round_help_24,
|
||||||
val text = TextView(context)
|
onClick = {
|
||||||
text.setText(R.string.full_disclaimer)
|
startActivity(Intent(context, FAQActivity::class.java))
|
||||||
|
},
|
||||||
CustomBottomDialog.newInstance().apply {
|
isActivity = true
|
||||||
setTitleText(context.getString(R.string.disclaimer))
|
),
|
||||||
addView(text)
|
Settings(
|
||||||
setNegativeButton(context.getString(R.string.close)) {
|
type = 2,
|
||||||
dismiss()
|
name = getString(R.string.check_app_updates),
|
||||||
}
|
desc = getString(R.string.check_app_updates),
|
||||||
show(supportFragmentManager, "dialog")
|
icon = R.drawable.ic_round_new_releases_24,
|
||||||
}
|
isChecked = PrefManager.getVal(PrefName.CheckUpdate),
|
||||||
}
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.CheckUpdate, isChecked)
|
||||||
settingsFAQ.setOnClickListener {
|
},
|
||||||
startActivity(Intent(context, FAQActivity::class.java))
|
isVisible = !BuildConfig.FLAVOR.contains("fdroid")
|
||||||
}
|
),
|
||||||
|
Settings(
|
||||||
if (!BuildConfig.FLAVOR.contains("fdroid")) {
|
type = 2,
|
||||||
|
name = getString(R.string.share_username_in_crash_reports),
|
||||||
settingsCheckUpdate.apply {
|
desc = getString(R.string.share_username_in_crash_reports),
|
||||||
isChecked = PrefManager.getVal(PrefName.CheckUpdate)
|
icon = R.drawable.ic_round_search_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.SharedUserID),
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
switch = { isChecked, _ ->
|
||||||
PrefManager.setVal(PrefName.CheckUpdate, isChecked)
|
PrefManager.setVal(PrefName.SharedUserID, isChecked)
|
||||||
if (!isChecked) {
|
},
|
||||||
snackString(getString(R.string.long_click_to_check_update))
|
isVisible = !BuildConfig.FLAVOR.contains("fdroid")
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.log_to_file),
|
||||||
|
desc = getString(R.string.logging_warning),
|
||||||
|
icon = R.drawable.ic_round_edit_note_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.LogToFile),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.LogToFile, isChecked)
|
||||||
|
restartApp(binding.root)
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.devs),
|
||||||
|
desc= getString(R.string.devs),
|
||||||
|
icon = R.drawable.ic_round_accessible_forward_24,
|
||||||
|
onClick = {
|
||||||
|
DevelopersDialogFragment().show(supportFragmentManager, "dialog")
|
||||||
}
|
}
|
||||||
}
|
),
|
||||||
|
Settings(
|
||||||
setOnLongClickListener {
|
type = 1,
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
name = getString(R.string.forks),
|
||||||
AppUpdater.check(context, true)
|
desc = getString(R.string.forks),
|
||||||
|
icon = R.drawable.ic_round_restaurant_24,
|
||||||
|
onClick = {
|
||||||
|
ForksDialogFragment().show(supportFragmentManager, "dialog")
|
||||||
}
|
}
|
||||||
true
|
),
|
||||||
}
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.disclaimer),
|
||||||
|
desc = getString(R.string.disclaimer),
|
||||||
|
icon = R.drawable.ic_round_info_24,
|
||||||
|
onClick = {
|
||||||
|
val text = TextView(context)
|
||||||
|
text.setText(R.string.full_disclaimer)
|
||||||
|
|
||||||
}
|
CustomBottomDialog.newInstance().apply {
|
||||||
|
setTitleText(context.getString(R.string.disclaimer))
|
||||||
settingsShareUsername.apply {
|
addView(text)
|
||||||
isChecked = PrefManager.getVal(PrefName.SharedUserID)
|
setNegativeButton(context.getString(R.string.close)) {
|
||||||
settingsShareUsername.setOnCheckedChangeListener { _, isChecked ->
|
dismiss()
|
||||||
PrefManager.setVal(PrefName.SharedUserID, isChecked)
|
}
|
||||||
}
|
show(supportFragmentManager, "dialog")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
),
|
||||||
settingsCheckUpdate.apply{
|
)
|
||||||
visibility = View.GONE
|
)
|
||||||
isEnabled = false
|
binding.settingsRecyclerView.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
isChecked = false
|
|
||||||
}
|
|
||||||
settingsShareUsername.apply{
|
|
||||||
visibility = View.GONE
|
|
||||||
isEnabled = false
|
|
||||||
isChecked = false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsLogToFile.apply {
|
|
||||||
isChecked = PrefManager.getVal(PrefName.LogToFile)
|
|
||||||
|
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
|
||||||
PrefManager.setVal(PrefName.LogToFile, isChecked)
|
|
||||||
restartApp(binding.root)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsShareLog.setOnClickListener {
|
|
||||||
Logger.shareLog(context)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package ani.dantotsu.settings
|
package ani.dantotsu.settings
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import android.graphics.drawable.Animatable
|
import android.graphics.drawable.Animatable
|
||||||
import android.os.Build.BRAND
|
import android.os.Build.BRAND
|
||||||
import android.os.Build.DEVICE
|
import android.os.Build.DEVICE
|
||||||
|
@ -75,61 +76,93 @@ class SettingsActivity : AppCompatActivity() {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
val settings = arrayListOf(
|
arrayListOf(
|
||||||
Settings(
|
Settings(
|
||||||
getString(R.string.accounts),
|
type = 1,
|
||||||
R.drawable.ic_round_person_24,
|
name = getString(R.string.accounts),
|
||||||
getString(R.string.accounts_desc),
|
desc = getString(R.string.accounts_desc),
|
||||||
SettingsAccountActivity::class.java
|
icon = R.drawable.ic_round_person_24,
|
||||||
),
|
onClick = {
|
||||||
Settings(
|
startActivity(Intent(context, SettingsAccountActivity::class.java))
|
||||||
getString(R.string.theme),
|
},
|
||||||
R.drawable.ic_palette,
|
isActivity = true
|
||||||
getString(R.string.theme_desc),
|
),
|
||||||
SettingsThemeActivity::class.java
|
Settings(
|
||||||
),
|
type = 1,
|
||||||
Settings(
|
name = getString(R.string.theme),
|
||||||
getString(R.string.common),
|
desc = getString(R.string.theme_desc),
|
||||||
R.drawable.ic_lightbulb_24,
|
icon = R.drawable.ic_palette,
|
||||||
getString(R.string.common_desc),
|
onClick = {
|
||||||
SettingsCommonActivity::class.java
|
startActivity(Intent(context, SettingsThemeActivity::class.java))
|
||||||
),
|
},
|
||||||
Settings(
|
isActivity = true
|
||||||
getString(R.string.anime),
|
),
|
||||||
R.drawable.ic_round_movie_filter_24,
|
Settings(
|
||||||
getString(R.string.anime_desc),
|
type = 1,
|
||||||
SettingsAnimeActivity::class.java
|
name = getString(R.string.common),
|
||||||
),
|
desc = getString(R.string.common_desc),
|
||||||
Settings(
|
icon = R.drawable.ic_lightbulb_24,
|
||||||
getString(R.string.manga),
|
onClick = {
|
||||||
R.drawable.ic_round_import_contacts_24,
|
startActivity(Intent(context, SettingsCommonActivity::class.java))
|
||||||
getString(R.string.manga_desc),
|
},
|
||||||
SettingsMangaActivity::class.java
|
isActivity = true
|
||||||
),
|
),
|
||||||
Settings(
|
Settings(
|
||||||
getString(R.string.extensions),
|
type = 1,
|
||||||
R.drawable.ic_extension,
|
name = getString(R.string.anime),
|
||||||
getString(R.string.extensions_desc),
|
desc = getString(R.string.anime_desc),
|
||||||
SettingsExtensionsActivity::class.java
|
icon = R.drawable.ic_round_movie_filter_24,
|
||||||
),
|
onClick = {
|
||||||
Settings(
|
startActivity(Intent(context, SettingsAnimeActivity::class.java))
|
||||||
getString(R.string.notifications),
|
},
|
||||||
R.drawable.ic_round_notifications_none_24,
|
isActivity = true
|
||||||
getString(R.string.notifications_desc),
|
),
|
||||||
SettingsNotificationActivity::class.java
|
Settings(
|
||||||
),
|
type = 1,
|
||||||
Settings(
|
name = getString(R.string.manga),
|
||||||
getString(R.string.about),
|
desc = getString(R.string.manga_desc),
|
||||||
R.drawable.ic_round_info_24,
|
icon = R.drawable.ic_round_import_contacts_24,
|
||||||
getString(R.string.about_desc),
|
onClick = {
|
||||||
SettingsAboutActivity::class.java
|
startActivity(Intent(context, SettingsMangaActivity::class.java))
|
||||||
),
|
},
|
||||||
|
isActivity = true
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.extensions),
|
||||||
|
desc = getString(R.string.extensions_desc),
|
||||||
|
icon = R.drawable.ic_extension,
|
||||||
|
onClick = {
|
||||||
|
startActivity(Intent(context, SettingsExtensionsActivity::class.java))
|
||||||
|
},
|
||||||
|
isActivity = true
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.notifications),
|
||||||
|
desc = getString(R.string.notifications_desc),
|
||||||
|
icon = R.drawable.ic_round_notifications_none_24,
|
||||||
|
onClick = {
|
||||||
|
startActivity(Intent(context, SettingsNotificationActivity::class.java))
|
||||||
|
},
|
||||||
|
isActivity = true
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.about),
|
||||||
|
desc = getString(R.string.about_desc),
|
||||||
|
icon = R.drawable.ic_round_info_24,
|
||||||
|
onClick = {
|
||||||
|
startActivity(Intent(context, SettingsAboutActivity::class.java))
|
||||||
|
},
|
||||||
|
isActivity = true
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
settingsRecyclerView.apply {
|
settingsRecyclerView.apply {
|
||||||
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
adapter = SettingsAdapter(settings)
|
|
||||||
setHasFixedSize(true)
|
setHasFixedSize(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,44 +1,97 @@
|
||||||
package ani.dantotsu.settings
|
package ani.dantotsu.settings
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import ani.dantotsu.databinding.ItemSettingsBinding
|
import ani.dantotsu.databinding.ItemSettingsBinding
|
||||||
|
import ani.dantotsu.databinding.ItemSettingsSwitchBinding
|
||||||
import ani.dantotsu.setAnimation
|
import ani.dantotsu.setAnimation
|
||||||
|
|
||||||
class SettingsAdapter(private val settings: ArrayList<Settings>) : RecyclerView.Adapter<SettingsAdapter.SettingsViewHolder>(){
|
class SettingsAdapter(private val settings: ArrayList<Settings>) :
|
||||||
|
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||||
inner class SettingsViewHolder(val binding: ItemSettingsBinding) :
|
inner class SettingsViewHolder(val binding: ItemSettingsBinding) :
|
||||||
RecyclerView.ViewHolder(binding.root) {
|
RecyclerView.ViewHolder(binding.root) {}
|
||||||
init {
|
|
||||||
itemView.setOnClickListener {
|
inner class SettingsSwitchViewHolder(val binding: ItemSettingsSwitchBinding) :
|
||||||
ContextCompat.startActivity(
|
RecyclerView.ViewHolder(binding.root) {}
|
||||||
binding.root.context, Intent(binding.root.context, settings[bindingAdapterPosition].activity),
|
|
||||||
null
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||||
|
return when (viewType) {
|
||||||
|
1 -> SettingsViewHolder(
|
||||||
|
ItemSettingsBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context), parent, false
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
2 -> SettingsSwitchViewHolder(
|
||||||
|
ItemSettingsSwitchBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context), parent, false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
else -> SettingsViewHolder(
|
||||||
|
ItemSettingsBinding.inflate(
|
||||||
|
LayoutInflater.from(parent.context), parent, false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||||
|
val settings = settings[position]
|
||||||
|
when (settings.type) {
|
||||||
|
1 -> {
|
||||||
|
val b = (holder as SettingsViewHolder).binding
|
||||||
|
setAnimation(b.root.context, b.root)
|
||||||
|
|
||||||
|
b.settingsTitle.text = settings.name
|
||||||
|
b.settingsDesc.text = settings.desc
|
||||||
|
b.settingsIcon.setImageDrawable(
|
||||||
|
ContextCompat.getDrawable(
|
||||||
|
b.root.context, settings.icon
|
||||||
|
)
|
||||||
|
)
|
||||||
|
b.settingsLayout.setOnClickListener {
|
||||||
|
settings.onClick?.invoke(b)
|
||||||
|
}
|
||||||
|
b.settingsLayout.setOnLongClickListener {
|
||||||
|
settings.onLongClick?.invoke()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
b.settingsLayout.visibility = if (settings.isVisible) View.VISIBLE else View.GONE
|
||||||
|
b.settingsIconRight.visibility =
|
||||||
|
if (settings.isActivity) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> {
|
||||||
|
val b = (holder as SettingsSwitchViewHolder).binding
|
||||||
|
setAnimation(b.root.context, b.root)
|
||||||
|
|
||||||
|
b.settingsButton.text = settings.name
|
||||||
|
b.settingsDesc.text = settings.desc
|
||||||
|
b.settingsIcon.setImageDrawable(
|
||||||
|
ContextCompat.getDrawable(
|
||||||
|
b.root.context, settings.icon
|
||||||
|
)
|
||||||
|
)
|
||||||
|
b.settingsButton.isChecked = settings.isChecked
|
||||||
|
b.settingsButton.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
settings.switch?.invoke(isChecked, b)
|
||||||
|
}
|
||||||
|
b.settingsLayout.setOnLongClickListener() {
|
||||||
|
settings.onLongClick?.invoke()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
b.settingsLayout.visibility = if (settings.isVisible) View.VISIBLE else View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SettingsViewHolder {
|
|
||||||
return SettingsViewHolder(
|
|
||||||
ItemSettingsBinding.inflate(
|
|
||||||
LayoutInflater.from(parent.context),
|
|
||||||
parent,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: SettingsViewHolder, position: Int) {
|
|
||||||
val b = holder.binding
|
|
||||||
setAnimation(b.root.context, b.root)
|
|
||||||
val settings = settings[position]
|
|
||||||
b.settingsTitle.text = settings.name
|
|
||||||
b.settingsDesc.text = settings.desc
|
|
||||||
b.settingsIcon.setImageDrawable(ContextCompat.getDrawable(b.root.context, settings.icon))
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getItemCount(): Int = settings.size
|
override fun getItemCount(): Int = settings.size
|
||||||
|
|
||||||
|
override fun getItemViewType(position: Int): Int {
|
||||||
|
return settings[position].type
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -7,9 +7,9 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.databinding.ActivitySettingsAnimeBinding
|
import ani.dantotsu.databinding.ActivitySettingsAnimeBinding
|
||||||
import ani.dantotsu.databinding.ActivitySettingsMangaBinding
|
|
||||||
import ani.dantotsu.download.DownloadsManager
|
import ani.dantotsu.download.DownloadsManager
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
import ani.dantotsu.media.MediaType
|
import ani.dantotsu.media.MediaType
|
||||||
|
@ -37,41 +37,77 @@ class SettingsAnimeActivity: AppCompatActivity(){
|
||||||
topMargin = statusBarHeight
|
topMargin = statusBarHeight
|
||||||
bottomMargin = navBarHeight
|
bottomMargin = navBarHeight
|
||||||
}
|
}
|
||||||
settingsPlayer.setOnClickListener {
|
animeSettingsBack.setOnClickListener { onBackPressedDispatcher.onBackPressed() }
|
||||||
startActivity(Intent(context, PlayerSettingsActivity::class.java))
|
|
||||||
}
|
|
||||||
animeSettingsBack.setOnClickListener {
|
|
||||||
onBackPressedDispatcher.onBackPressed()
|
|
||||||
}
|
|
||||||
purgeAnimeDownloads.setOnClickListener {
|
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.purge_anime_downloads)
|
|
||||||
.setMessage(getString(R.string.purge_confirm, getString(R.string.anime)))
|
|
||||||
.setPositiveButton(R.string.yes) { dialog, _ ->
|
|
||||||
val downloadsManager = Injekt.get<DownloadsManager>()
|
|
||||||
downloadsManager.purgeDownloads(MediaType.ANIME)
|
|
||||||
dialog.dismiss()
|
|
||||||
}.setNegativeButton(R.string.no) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
}.create()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsPreferDub.isChecked = PrefManager.getVal(PrefName.SettingsPreferDub)
|
settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
settingsPreferDub.setOnCheckedChangeListener { _, isChecked ->
|
arrayListOf(
|
||||||
PrefManager.setVal(PrefName.SettingsPreferDub, isChecked)
|
Settings(
|
||||||
}
|
type = 1,
|
||||||
|
name = getString(R.string.player_settings),
|
||||||
|
desc = getString(R.string.player_settings),
|
||||||
|
icon = R.drawable.ic_round_video_settings_24,
|
||||||
|
onClick = {
|
||||||
|
startActivity(Intent(context, PlayerSettingsActivity::class.java))
|
||||||
|
},
|
||||||
|
isActivity = true
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.purge_anime_downloads),
|
||||||
|
desc = getString(R.string.purge_anime_downloads),
|
||||||
|
icon = R.drawable.ic_round_delete_24,
|
||||||
|
onClick = {
|
||||||
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.purge_anime_downloads)
|
||||||
|
.setMessage(getString(R.string.purge_confirm, getString(R.string.anime)))
|
||||||
|
.setPositiveButton(R.string.yes) { dialog, _ ->
|
||||||
|
val downloadsManager = Injekt.get<DownloadsManager>()
|
||||||
|
downloadsManager.purgeDownloads(MediaType.ANIME)
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(R.string.no) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
),
|
||||||
settingsShowYt.isChecked = PrefManager.getVal(PrefName.ShowYtButton)
|
Settings(
|
||||||
settingsShowYt.setOnCheckedChangeListener { _, isChecked ->
|
type = 2,
|
||||||
PrefManager.setVal(PrefName.ShowYtButton, isChecked)
|
name = getString(R.string.prefer_dub),
|
||||||
}
|
desc = getString(R.string.prefer_dub),
|
||||||
settingsIncludeAnimeList.isChecked = PrefManager.getVal(PrefName.IncludeAnimeList)
|
icon = R.drawable.ic_round_audiotrack_24,
|
||||||
settingsIncludeAnimeList.setOnCheckedChangeListener { _, isChecked ->
|
isChecked = PrefManager.getVal(PrefName.SettingsPreferDub),
|
||||||
PrefManager.setVal(PrefName.IncludeAnimeList, isChecked)
|
switch = { isChecked, _ ->
|
||||||
restartApp(binding.root)
|
PrefManager.setVal(PrefName.SettingsPreferDub, isChecked)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.show_yt),
|
||||||
|
desc = getString(R.string.show_yt),
|
||||||
|
icon = R.drawable.ic_round_play_circle_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.ShowYtButton),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.ShowYtButton, isChecked)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.include_list),
|
||||||
|
desc = getString(R.string.include_list),
|
||||||
|
icon = R.drawable.view_list_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.IncludeAnimeList),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.IncludeAnimeList, isChecked)
|
||||||
|
restartApp(binding.root)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
settingsRecyclerView.apply {
|
||||||
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
|
setHasFixedSize(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
var previousEp: View = when (PrefManager.getVal<Int>(PrefName.AnimeDefaultView)) {
|
var previousEp: View = when (PrefManager.getVal<Int>(PrefName.AnimeDefaultView)) {
|
||||||
|
@ -99,6 +135,7 @@ class SettingsAnimeActivity: AppCompatActivity(){
|
||||||
settingsEpCompact.setOnClickListener {
|
settingsEpCompact.setOnClickListener {
|
||||||
uiEp(2, it)
|
uiEp(2, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,7 +14,9 @@ import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.documentfile.provider.DocumentFile
|
import androidx.documentfile.provider.DocumentFile
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
|
import ani.dantotsu.connections.anilist.Anilist
|
||||||
import ani.dantotsu.databinding.ActivitySettingsCommonBinding
|
import ani.dantotsu.databinding.ActivitySettingsCommonBinding
|
||||||
import ani.dantotsu.download.DownloadsManager
|
import ani.dantotsu.download.DownloadsManager
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
|
@ -32,6 +34,7 @@ import ani.dantotsu.toast
|
||||||
import ani.dantotsu.util.LauncherWrapper
|
import ani.dantotsu.util.LauncherWrapper
|
||||||
import ani.dantotsu.util.StoragePermissions
|
import ani.dantotsu.util.StoragePermissions
|
||||||
import com.google.android.material.textfield.TextInputEditText
|
import com.google.android.material.textfield.TextInputEditText
|
||||||
|
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
@ -41,6 +44,7 @@ import uy.kohesive.injekt.api.get
|
||||||
class SettingsCommonActivity: AppCompatActivity(){
|
class SettingsCommonActivity: AppCompatActivity(){
|
||||||
private lateinit var binding: ActivitySettingsCommonBinding
|
private lateinit var binding: ActivitySettingsCommonBinding
|
||||||
private lateinit var launcher: LauncherWrapper
|
private lateinit var launcher: LauncherWrapper
|
||||||
|
@OptIn(DelicateCoroutinesApi::class)
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
ThemeManager(this).applyTheme()
|
ThemeManager(this).applyTheme()
|
||||||
|
@ -88,10 +92,7 @@ class SettingsCommonActivity: AppCompatActivity(){
|
||||||
}
|
}
|
||||||
val contract = ActivityResultContracts.OpenDocumentTree()
|
val contract = ActivityResultContracts.OpenDocumentTree()
|
||||||
launcher = LauncherWrapper(this, contract)
|
launcher = LauncherWrapper(this, contract)
|
||||||
val managers = arrayOf("Default", "1DM", "ADM")
|
|
||||||
val downloadManagerDialog =
|
|
||||||
AlertDialog.Builder(this, R.style.MyPopup).setTitle(R.string.download_manager)
|
|
||||||
var downloadManager: Int = PrefManager.getVal(PrefName.DownloadManager)
|
|
||||||
binding.apply {
|
binding.apply {
|
||||||
|
|
||||||
settingsCommonLayout.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
settingsCommonLayout.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
@ -101,66 +102,6 @@ class SettingsCommonActivity: AppCompatActivity(){
|
||||||
commonSettingsBack.setOnClickListener {
|
commonSettingsBack.setOnClickListener {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
}
|
}
|
||||||
settingsDownloadManager.setOnClickListener {
|
|
||||||
val dialog = downloadManagerDialog.setSingleChoiceItems(
|
|
||||||
managers, downloadManager
|
|
||||||
) { dialog, count ->
|
|
||||||
downloadManager = count
|
|
||||||
PrefManager.setVal(PrefName.DownloadManager, downloadManager)
|
|
||||||
dialog.dismiss()
|
|
||||||
}.show()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
}
|
|
||||||
|
|
||||||
importExportSettings.setOnClickListener {
|
|
||||||
StoragePermissions.downloadsPermission(context)
|
|
||||||
val selectedArray = mutableListOf(false)
|
|
||||||
val filteredLocations = Location.entries.filter { it.exportable }
|
|
||||||
selectedArray.addAll(List(filteredLocations.size - 1) { false })
|
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.backup_restore).setMultiChoiceItems(
|
|
||||||
filteredLocations.map { it.name }.toTypedArray(),
|
|
||||||
selectedArray.toBooleanArray()
|
|
||||||
) { _, which, isChecked ->
|
|
||||||
selectedArray[which] = isChecked
|
|
||||||
}.setPositiveButton(R.string.button_restore) { dialog, _ ->
|
|
||||||
openDocumentLauncher.launch(arrayOf("*/*"))
|
|
||||||
dialog.dismiss()
|
|
||||||
}.setNegativeButton(R.string.button_backup) { dialog, _ ->
|
|
||||||
if (!selectedArray.contains(true)) {
|
|
||||||
toast(R.string.no_location_selected)
|
|
||||||
return@setNegativeButton
|
|
||||||
}
|
|
||||||
dialog.dismiss()
|
|
||||||
val selected =
|
|
||||||
filteredLocations.filterIndexed { index, _ -> selectedArray[index] }
|
|
||||||
if (selected.contains(Location.Protected)) {
|
|
||||||
passwordAlertDialog(true) { password ->
|
|
||||||
if (password != null) {
|
|
||||||
savePrefsToDownloads(
|
|
||||||
"DantotsuSettings",
|
|
||||||
PrefManager.exportAllPrefs(selected),
|
|
||||||
context,
|
|
||||||
password
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
toast(R.string.password_cannot_be_empty)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
savePrefsToDownloads(
|
|
||||||
"DantotsuSettings",
|
|
||||||
PrefManager.exportAllPrefs(selected),
|
|
||||||
context,
|
|
||||||
null
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}.setNeutralButton(R.string.cancel) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
}.create()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
val exDns = listOf(
|
val exDns = listOf(
|
||||||
"None",
|
"None",
|
||||||
"Cloudflare",
|
"Cloudflare",
|
||||||
|
@ -189,60 +130,181 @@ class SettingsCommonActivity: AppCompatActivity(){
|
||||||
restartApp(binding.root)
|
restartApp(binding.root)
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsContinueMedia.isChecked = PrefManager.getVal(PrefName.ContinueMedia)
|
settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
settingsContinueMedia.setOnCheckedChangeListener { _, isChecked ->
|
arrayListOf(
|
||||||
PrefManager.setVal(PrefName.ContinueMedia, isChecked)
|
Settings(
|
||||||
}
|
type = 1,
|
||||||
|
name = getString(R.string.ui_settings),
|
||||||
settingsSearchSources.isChecked = PrefManager.getVal(PrefName.SearchSources)
|
desc = getString(R.string.ui_settings),
|
||||||
settingsSearchSources.setOnCheckedChangeListener { _, isChecked ->
|
icon = R.drawable.ic_round_auto_awesome_24,
|
||||||
PrefManager.setVal(PrefName.SearchSources, isChecked)
|
onClick = {
|
||||||
}
|
startActivity(Intent(context, UserInterfaceSettingsActivity::class.java))
|
||||||
|
},
|
||||||
settingsRecentlyListOnly.isChecked = PrefManager.getVal(PrefName.RecentlyListOnly)
|
isActivity = true
|
||||||
settingsRecentlyListOnly.setOnCheckedChangeListener { _, isChecked ->
|
),
|
||||||
PrefManager.setVal(PrefName.RecentlyListOnly, isChecked)
|
Settings(
|
||||||
}
|
type = 1,
|
||||||
settingsAdultAnimeOnly.isChecked = PrefManager.getVal(PrefName.AdultOnly)
|
name = getString(R.string.download_manager_select),
|
||||||
settingsAdultAnimeOnly.setOnCheckedChangeListener { _, isChecked ->
|
desc = getString(R.string.download_manager_select),
|
||||||
PrefManager.setVal(PrefName.AdultOnly, isChecked)
|
icon = R.drawable.ic_download_24,
|
||||||
restartApp(binding.root)
|
onClick = {
|
||||||
}
|
val managers = arrayOf("Default", "1DM", "ADM")
|
||||||
|
val downloadManagerDialog =
|
||||||
settingsDownloadLocation.setOnClickListener {
|
AlertDialog.Builder(context, R.style.MyPopup).setTitle(R.string.download_manager)
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
var downloadManager: Int = PrefManager.getVal(PrefName.DownloadManager)
|
||||||
.setTitle(R.string.change_download_location)
|
val dialog = downloadManagerDialog.setSingleChoiceItems(
|
||||||
.setMessage(R.string.download_location_msg)
|
managers, downloadManager
|
||||||
.setPositiveButton(R.string.ok) { dialog, _ ->
|
) { dialog, count ->
|
||||||
val oldUri = PrefManager.getVal<String>(PrefName.DownloadsDir)
|
downloadManager = count
|
||||||
launcher.registerForCallback { success ->
|
PrefManager.setVal(PrefName.DownloadManager, downloadManager)
|
||||||
if (success) {
|
dialog.dismiss()
|
||||||
toast(getString(R.string.please_wait))
|
}.show()
|
||||||
val newUri = PrefManager.getVal<String>(PrefName.DownloadsDir)
|
dialog.window?.setDimAmount(0.8f)
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
}
|
||||||
Injekt.get<DownloadsManager>().moveDownloadsDir(
|
),
|
||||||
context, Uri.parse(oldUri), Uri.parse(newUri)
|
Settings(
|
||||||
) { finished, message ->
|
type = 1,
|
||||||
if (finished) {
|
name = getString(R.string.backup_restore),
|
||||||
toast(getString(R.string.success))
|
desc = getString(R.string.backup_restore),
|
||||||
|
icon = R.drawable.backup_restore,
|
||||||
|
onClick = {
|
||||||
|
StoragePermissions.downloadsPermission(context)
|
||||||
|
val selectedArray = mutableListOf(false)
|
||||||
|
val filteredLocations = Location.entries.filter { it.exportable }
|
||||||
|
selectedArray.addAll(List(filteredLocations.size - 1) { false })
|
||||||
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.backup_restore).setMultiChoiceItems(
|
||||||
|
filteredLocations.map { it.name }.toTypedArray(),
|
||||||
|
selectedArray.toBooleanArray()
|
||||||
|
) { _, which, isChecked ->
|
||||||
|
selectedArray[which] = isChecked
|
||||||
|
}.setPositiveButton(R.string.button_restore) { dialog, _ ->
|
||||||
|
openDocumentLauncher.launch(arrayOf("*/*"))
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(R.string.button_backup) { dialog, _ ->
|
||||||
|
if (!selectedArray.contains(true)) {
|
||||||
|
toast(R.string.no_location_selected)
|
||||||
|
return@setNegativeButton
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
val selected =
|
||||||
|
filteredLocations.filterIndexed { index, _ -> selectedArray[index] }
|
||||||
|
if (selected.contains(Location.Protected)) {
|
||||||
|
passwordAlertDialog(true) { password ->
|
||||||
|
if (password != null) {
|
||||||
|
savePrefsToDownloads(
|
||||||
|
"DantotsuSettings",
|
||||||
|
PrefManager.exportAllPrefs(selected),
|
||||||
|
context,
|
||||||
|
password
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
toast(R.string.password_cannot_be_empty)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
savePrefsToDownloads(
|
||||||
|
"DantotsuSettings",
|
||||||
|
PrefManager.exportAllPrefs(selected),
|
||||||
|
context,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}.setNeutralButton(R.string.cancel) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.change_download_location),
|
||||||
|
desc = getString(R.string.change_download_location),
|
||||||
|
icon = R.drawable.ic_round_source_24,
|
||||||
|
onClick = {
|
||||||
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.change_download_location)
|
||||||
|
.setMessage(R.string.download_location_msg)
|
||||||
|
.setPositiveButton(R.string.ok) { dialog, _ ->
|
||||||
|
val oldUri = PrefManager.getVal<String>(PrefName.DownloadsDir)
|
||||||
|
launcher.registerForCallback { success ->
|
||||||
|
if (success) {
|
||||||
|
toast(getString(R.string.please_wait))
|
||||||
|
val newUri = PrefManager.getVal<String>(PrefName.DownloadsDir)
|
||||||
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
|
Injekt.get<DownloadsManager>().moveDownloadsDir(
|
||||||
|
context, Uri.parse(oldUri), Uri.parse(newUri)
|
||||||
|
) { finished, message ->
|
||||||
|
if (finished) {
|
||||||
|
toast(getString(R.string.success))
|
||||||
|
} else {
|
||||||
|
toast(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
toast(message)
|
toast(getString(R.string.error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
launcher.launch()
|
||||||
} else {
|
dialog.dismiss()
|
||||||
toast(getString(R.string.error))
|
}.setNeutralButton(R.string.cancel) { dialog, _ ->
|
||||||
}
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
}
|
}
|
||||||
launcher.launch()
|
),
|
||||||
dialog.dismiss()
|
Settings(
|
||||||
}.setNeutralButton(R.string.cancel) { dialog, _ ->
|
type = 2,
|
||||||
dialog.dismiss()
|
name = getString(R.string.always_continue_content),
|
||||||
}.create()
|
desc = getString(R.string.always_continue_content),
|
||||||
dialog.window?.setDimAmount(0.8f)
|
icon = R.drawable.ic_round_delete_24,
|
||||||
dialog.show()
|
isChecked = PrefManager.getVal(PrefName.ContinueMedia),
|
||||||
}
|
switch = {isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.ContinueMedia, isChecked)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.search_source_list),
|
||||||
|
desc = getString(R.string.search_source_list),
|
||||||
|
icon = R.drawable.ic_round_search_sources_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.SearchSources),
|
||||||
|
switch = {isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.SearchSources, isChecked)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.recentlyListOnly),
|
||||||
|
desc = getString(R.string.recentlyListOnly),
|
||||||
|
icon = R.drawable.ic_round_new_releases_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.RecentlyListOnly),
|
||||||
|
switch = {isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.RecentlyListOnly, isChecked)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.adult_only_content),
|
||||||
|
desc = getString(R.string.adult_only_content),
|
||||||
|
icon = R.drawable.ic_round_nsfw_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.AdultOnly),
|
||||||
|
switch = {isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.AdultOnly, isChecked)
|
||||||
|
restartApp(binding.root)
|
||||||
|
},
|
||||||
|
isVisible = Anilist.adult
|
||||||
|
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
settingsRecyclerView.apply {
|
||||||
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
|
setHasFixedSize(true)
|
||||||
|
}
|
||||||
var previousStart: View = when (PrefManager.getVal<Int>(PrefName.DefaultStartUpTab)) {
|
var previousStart: View = when (PrefManager.getVal<Int>(PrefName.DefaultStartUpTab)) {
|
||||||
0 -> uiSettingsAnime
|
0 -> uiSettingsAnime
|
||||||
1 -> uiSettingsHome
|
1 -> uiSettingsHome
|
||||||
|
@ -270,13 +332,6 @@ class SettingsCommonActivity: AppCompatActivity(){
|
||||||
uiDefault(2, it)
|
uiDefault(2, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsUi.setOnClickListener {
|
|
||||||
startActivity(
|
|
||||||
Intent(
|
|
||||||
context, UserInterfaceSettingsActivity::class.java
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private fun passwordAlertDialog(isExporting: Boolean, callback: (CharArray?) -> Unit) {
|
private fun passwordAlertDialog(isExporting: Boolean, callback: (CharArray?) -> Unit) {
|
||||||
|
|
|
@ -11,9 +11,11 @@ import android.widget.EditText
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.copyToClipboard
|
import ani.dantotsu.copyToClipboard
|
||||||
import ani.dantotsu.databinding.ActivitySettingsExtensionsBinding
|
import ani.dantotsu.databinding.ActivitySettingsExtensionsBinding
|
||||||
|
import ani.dantotsu.databinding.DialogUserAgentBinding
|
||||||
import ani.dantotsu.databinding.ItemRepositoryBinding
|
import ani.dantotsu.databinding.ItemRepositoryBinding
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
import ani.dantotsu.media.MediaType
|
import ani.dantotsu.media.MediaType
|
||||||
|
@ -199,48 +201,77 @@ class SettingsExtensionsActivity: AppCompatActivity() {
|
||||||
alertDialog.show()
|
alertDialog.show()
|
||||||
alertDialog.window?.setDimAmount(0.8f)
|
alertDialog.window?.setDimAmount(0.8f)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
settingsForceLegacyInstall.isChecked =
|
binding.settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
extensionInstaller.get() == BasePreferences.ExtensionInstaller.LEGACY
|
arrayListOf(
|
||||||
settingsForceLegacyInstall.setOnCheckedChangeListener { _, isChecked ->
|
Settings(
|
||||||
if (isChecked) {
|
type = 1,
|
||||||
extensionInstaller.set(BasePreferences.ExtensionInstaller.LEGACY)
|
name = getString(R.string.user_agent),
|
||||||
} else {
|
desc = getString(R.string.NSFWExtention),
|
||||||
extensionInstaller.set(BasePreferences.ExtensionInstaller.PACKAGEINSTALLER)
|
icon = R.drawable.ic_round_video_settings_24,
|
||||||
}
|
onClick = {
|
||||||
}
|
val dialogView = DialogUserAgentBinding.inflate(layoutInflater)
|
||||||
|
val editText = dialogView.userAgentTextBox
|
||||||
|
editText.setText(PrefManager.getVal<String>(PrefName.DefaultUserAgent))
|
||||||
|
val alertDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.user_agent).setView(dialogView.root)
|
||||||
|
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||||
|
PrefManager.setVal(PrefName.DefaultUserAgent, editText.text.toString())
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNeutralButton(getString(R.string.reset)) { dialog, _ ->
|
||||||
|
PrefManager.removeVal(PrefName.DefaultUserAgent)
|
||||||
|
editText.setText("")
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(getString(R.string.cancel)) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
|
||||||
skipExtensionIcons.isChecked = PrefManager.getVal(PrefName.SkipExtensionIcons)
|
alertDialog.show()
|
||||||
skipExtensionIcons.setOnCheckedChangeListener { _, isChecked ->
|
alertDialog.window?.setDimAmount(0.8f)
|
||||||
PrefManager.getVal(PrefName.SkipExtensionIcons, isChecked)
|
}
|
||||||
}
|
),
|
||||||
NSFWExtension.isChecked = PrefManager.getVal(PrefName.NSFWExtension)
|
Settings(
|
||||||
NSFWExtension.setOnCheckedChangeListener { _, isChecked ->
|
type = 2,
|
||||||
PrefManager.setVal(PrefName.NSFWExtension, isChecked)
|
name = getString(R.string.force_legacy_installer),
|
||||||
|
desc = getString(R.string.force_legacy_installer),
|
||||||
|
icon = R.drawable.ic_round_new_releases_24,
|
||||||
|
isChecked = extensionInstaller.get() == BasePreferences.ExtensionInstaller.LEGACY,
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
if (isChecked) {
|
||||||
|
extensionInstaller.set(BasePreferences.ExtensionInstaller.LEGACY)
|
||||||
|
} else {
|
||||||
|
extensionInstaller.set(BasePreferences.ExtensionInstaller.PACKAGEINSTALLER)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.skip_loading_extension_icons),
|
||||||
|
desc = getString(R.string.skip_loading_extension_icons),
|
||||||
|
icon = R.drawable.ic_round_no_icon_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.SkipExtensionIcons),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.SkipExtensionIcons, isChecked)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.NSFWExtention),
|
||||||
|
desc = getString(R.string.NSFWExtention),
|
||||||
|
icon = R.drawable.ic_round_nsfw_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.NSFWExtension),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.NSFWExtension, isChecked)
|
||||||
|
}
|
||||||
|
|
||||||
userAgent.setOnClickListener {
|
)
|
||||||
val dialogView = layoutInflater.inflate(R.layout.dialog_user_agent, null)
|
)
|
||||||
val editText = dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox)
|
)
|
||||||
editText.setText(PrefManager.getVal<String>(PrefName.DefaultUserAgent))
|
binding.settingsRecyclerView.apply {
|
||||||
val alertDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
.setTitle(R.string.user_agent).setView(dialogView)
|
setHasFixedSize(true)
|
||||||
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
|
||||||
PrefManager.setVal(PrefName.DefaultUserAgent, editText.text.toString())
|
|
||||||
dialog.dismiss()
|
|
||||||
}.setNeutralButton(getString(R.string.reset)) { dialog, _ ->
|
|
||||||
PrefManager.removeVal(PrefName.DefaultUserAgent)
|
|
||||||
editText.setText("")
|
|
||||||
dialog.dismiss()
|
|
||||||
}.setNegativeButton(getString(R.string.cancel)) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
}.create()
|
|
||||||
|
|
||||||
alertDialog.show()
|
|
||||||
alertDialog.window?.setDimAmount(0.8f)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,6 +7,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.databinding.ActivitySettingsMangaBinding
|
import ani.dantotsu.databinding.ActivitySettingsMangaBinding
|
||||||
import ani.dantotsu.download.DownloadsManager
|
import ani.dantotsu.download.DownloadsManager
|
||||||
|
@ -39,39 +40,6 @@ class SettingsMangaActivity: AppCompatActivity(){
|
||||||
mangaSettingsBack.setOnClickListener {
|
mangaSettingsBack.setOnClickListener {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
}
|
}
|
||||||
purgeMangaDownloads.setOnClickListener {
|
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.purge_manga_downloads)
|
|
||||||
.setMessage(getString(R.string.purge_confirm, getString(R.string.manga)))
|
|
||||||
.setPositiveButton(R.string.yes) { dialog, _ ->
|
|
||||||
val downloadsManager = Injekt.get<DownloadsManager>()
|
|
||||||
downloadsManager.purgeDownloads(MediaType.MANGA)
|
|
||||||
dialog.dismiss()
|
|
||||||
}.setNegativeButton(R.string.no) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
}.create()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
purgeNovelDownloads.setOnClickListener {
|
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.purge_novel_downloads)
|
|
||||||
.setMessage(getString(R.string.purge_confirm, getString(R.string.novels)))
|
|
||||||
.setPositiveButton(R.string.yes) { dialog, _ ->
|
|
||||||
val downloadsManager = Injekt.get<DownloadsManager>()
|
|
||||||
downloadsManager.purgeDownloads(MediaType.NOVEL)
|
|
||||||
dialog.dismiss()
|
|
||||||
}.setNegativeButton(R.string.no) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
}.create()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsReader.setOnClickListener {
|
|
||||||
startActivity(Intent(context, ReaderSettingsActivity::class.java))
|
|
||||||
}
|
|
||||||
|
|
||||||
var previousChp: View = when (PrefManager.getVal<Int>(PrefName.MangaDefaultView)) {
|
var previousChp: View = when (PrefManager.getVal<Int>(PrefName.MangaDefaultView)) {
|
||||||
0 -> settingsChpList
|
0 -> settingsChpList
|
||||||
|
@ -94,10 +62,75 @@ class SettingsMangaActivity: AppCompatActivity(){
|
||||||
uiChp(1, it)
|
uiChp(1, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsIncludeMangaList.isChecked = PrefManager.getVal(PrefName.IncludeMangaList)
|
settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
settingsIncludeMangaList.setOnCheckedChangeListener { _, isChecked ->
|
arrayListOf(
|
||||||
PrefManager.setVal(PrefName.IncludeMangaList, isChecked)
|
Settings(
|
||||||
restartApp(binding.root)
|
type = 1,
|
||||||
|
name = getString(R.string.reader_settings),
|
||||||
|
desc = getString(R.string.reader_settings),
|
||||||
|
icon = R.drawable.ic_round_reader_settings,
|
||||||
|
onClick = {
|
||||||
|
startActivity(Intent(context, ReaderSettingsActivity::class.java))
|
||||||
|
},
|
||||||
|
isActivity = true
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.purge_manga_downloads),
|
||||||
|
desc = getString(R.string.purge_manga_downloads),
|
||||||
|
icon = R.drawable.ic_round_delete_24,
|
||||||
|
onClick = {
|
||||||
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.purge_manga_downloads)
|
||||||
|
.setMessage(getString(R.string.purge_confirm, getString(R.string.manga)))
|
||||||
|
.setPositiveButton(R.string.yes) { dialog, _ ->
|
||||||
|
val downloadsManager = Injekt.get<DownloadsManager>()
|
||||||
|
downloadsManager.purgeDownloads(MediaType.MANGA)
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(R.string.no) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.purge_novel_downloads),
|
||||||
|
desc = getString(R.string.purge_novel_downloads),
|
||||||
|
icon = R.drawable.ic_round_delete_24,
|
||||||
|
onClick = {
|
||||||
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.purge_novel_downloads)
|
||||||
|
.setMessage(getString(R.string.purge_confirm, getString(R.string.novels)))
|
||||||
|
.setPositiveButton(R.string.yes) { dialog, _ ->
|
||||||
|
val downloadsManager = Injekt.get<DownloadsManager>()
|
||||||
|
downloadsManager.purgeDownloads(MediaType.NOVEL)
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(R.string.no) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.include_list),
|
||||||
|
desc = getString(R.string.include_list),
|
||||||
|
icon = R.drawable.view_list_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.IncludeMangaList),
|
||||||
|
switch = {isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.IncludeMangaList, isChecked)
|
||||||
|
restartApp(binding.root)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
settingsRecyclerView.apply {
|
||||||
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
|
setHasFixedSize(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,20 +9,26 @@ import android.os.Bundle
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.connections.anilist.api.NotificationType
|
import ani.dantotsu.connections.anilist.api.NotificationType
|
||||||
import ani.dantotsu.databinding.ActivitySettingsNotificationsBinding
|
import ani.dantotsu.databinding.ActivitySettingsNotificationsBinding
|
||||||
|
import ani.dantotsu.download.DownloadsManager
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
|
import ani.dantotsu.media.MediaType
|
||||||
import ani.dantotsu.navBarHeight
|
import ani.dantotsu.navBarHeight
|
||||||
import ani.dantotsu.notifications.TaskScheduler
|
import ani.dantotsu.notifications.TaskScheduler
|
||||||
import ani.dantotsu.notifications.anilist.AnilistNotificationWorker
|
import ani.dantotsu.notifications.anilist.AnilistNotificationWorker
|
||||||
import ani.dantotsu.notifications.comment.CommentNotificationWorker
|
import ani.dantotsu.notifications.comment.CommentNotificationWorker
|
||||||
import ani.dantotsu.notifications.subscription.SubscriptionNotificationWorker
|
import ani.dantotsu.notifications.subscription.SubscriptionNotificationWorker
|
||||||
import ani.dantotsu.openSettings
|
import ani.dantotsu.openSettings
|
||||||
|
import ani.dantotsu.restartApp
|
||||||
import ani.dantotsu.settings.saving.PrefManager
|
import ani.dantotsu.settings.saving.PrefManager
|
||||||
import ani.dantotsu.settings.saving.PrefName
|
import ani.dantotsu.settings.saving.PrefName
|
||||||
import ani.dantotsu.statusBarHeight
|
import ani.dantotsu.statusBarHeight
|
||||||
import ani.dantotsu.themes.ThemeManager
|
import ani.dantotsu.themes.ThemeManager
|
||||||
|
import uy.kohesive.injekt.Injekt
|
||||||
|
import uy.kohesive.injekt.api.get
|
||||||
|
|
||||||
class SettingsNotificationActivity: AppCompatActivity(){
|
class SettingsNotificationActivity: AppCompatActivity(){
|
||||||
private lateinit var binding: ActivitySettingsNotificationsBinding
|
private lateinit var binding: ActivitySettingsNotificationsBinding
|
||||||
|
@ -49,31 +55,6 @@ class SettingsNotificationActivity: AppCompatActivity(){
|
||||||
notificationSettingsBack.setOnClickListener {
|
notificationSettingsBack.setOnClickListener {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
}
|
}
|
||||||
settingsSubscriptionsTime.text =
|
|
||||||
getString(R.string.subscriptions_checking_time_s, timeNames[curTime])
|
|
||||||
val speedDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.subscriptions_checking_time)
|
|
||||||
settingsSubscriptionsTime.setOnClickListener {
|
|
||||||
val dialog = speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
|
||||||
curTime = i
|
|
||||||
settingsSubscriptionsTime.text =
|
|
||||||
getString(R.string.subscriptions_checking_time_s, timeNames[i])
|
|
||||||
PrefManager.setVal(PrefName.SubscriptionNotificationInterval, curTime)
|
|
||||||
dialog.dismiss()
|
|
||||||
TaskScheduler.create(
|
|
||||||
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
|
||||||
).scheduleAllTasks(context)
|
|
||||||
}.show()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsSubscriptionsTime.setOnLongClickListener {
|
|
||||||
TaskScheduler.create(
|
|
||||||
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
|
||||||
).scheduleAllTasks(context)
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
val aTimeNames = AnilistNotificationWorker.checkIntervals.map { it.toInt() }
|
val aTimeNames = AnilistNotificationWorker.checkIntervals.map { it.toInt() }
|
||||||
val aItems = aTimeNames.map {
|
val aItems = aTimeNames.map {
|
||||||
val mins = it % 60
|
val mins = it % 60
|
||||||
|
@ -81,48 +62,6 @@ class SettingsNotificationActivity: AppCompatActivity(){
|
||||||
if (it > 0) "${if (hours > 0) "$hours hrs " else ""}${if (mins > 0) "$mins mins" else ""}"
|
if (it > 0) "${if (hours > 0) "$hours hrs " else ""}${if (mins > 0) "$mins mins" else ""}"
|
||||||
else getString(R.string.do_not_update)
|
else getString(R.string.do_not_update)
|
||||||
}
|
}
|
||||||
settingsAnilistSubscriptionsTime.text = getString(
|
|
||||||
R.string.anilist_notifications_checking_time,
|
|
||||||
aItems[PrefManager.getVal(PrefName.AnilistNotificationInterval)]
|
|
||||||
)
|
|
||||||
settingsAnilistSubscriptionsTime.setOnClickListener {
|
|
||||||
|
|
||||||
val selected = PrefManager.getVal<Int>(PrefName.AnilistNotificationInterval)
|
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.subscriptions_checking_time)
|
|
||||||
.setSingleChoiceItems(aItems.toTypedArray(), selected) { dialog, i ->
|
|
||||||
PrefManager.setVal(PrefName.AnilistNotificationInterval, i)
|
|
||||||
settingsAnilistSubscriptionsTime.text =
|
|
||||||
getString(R.string.anilist_notifications_checking_time, aItems[i])
|
|
||||||
dialog.dismiss()
|
|
||||||
TaskScheduler.create(
|
|
||||||
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
|
||||||
).scheduleAllTasks(context)
|
|
||||||
}.create()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsAnilistNotifications.setOnClickListener {
|
|
||||||
val types = NotificationType.entries.map { it.name }
|
|
||||||
val filteredTypes =
|
|
||||||
PrefManager.getVal<Set<String>>(PrefName.AnilistFilteredTypes).toMutableSet()
|
|
||||||
val selected = types.map { filteredTypes.contains(it) }.toBooleanArray()
|
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
|
||||||
.setTitle(R.string.anilist_notification_filters)
|
|
||||||
.setMultiChoiceItems(types.toTypedArray(), selected) { _, which, isChecked ->
|
|
||||||
val type = types[which]
|
|
||||||
if (isChecked) {
|
|
||||||
filteredTypes.add(type)
|
|
||||||
} else {
|
|
||||||
filteredTypes.remove(type)
|
|
||||||
}
|
|
||||||
PrefManager.setVal(PrefName.AnilistFilteredTypes, filteredTypes)
|
|
||||||
}.create()
|
|
||||||
dialog.window?.setDimAmount(0.8f)
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
val cTimeNames = CommentNotificationWorker.checkIntervals.map { it.toInt() }
|
val cTimeNames = CommentNotificationWorker.checkIntervals.map { it.toInt() }
|
||||||
val cItems = cTimeNames.map {
|
val cItems = cTimeNames.map {
|
||||||
val mins = it % 60
|
val mins = it % 60
|
||||||
|
@ -130,70 +69,172 @@ class SettingsNotificationActivity: AppCompatActivity(){
|
||||||
if (it > 0) "${if (hours > 0) "$hours hrs " else ""}${if (mins > 0) "$mins mins" else ""}"
|
if (it > 0) "${if (hours > 0) "$hours hrs " else ""}${if (mins > 0) "$mins mins" else ""}"
|
||||||
else getString(R.string.do_not_update)
|
else getString(R.string.do_not_update)
|
||||||
}
|
}
|
||||||
|
settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
|
arrayListOf(
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.subscriptions_checking_time_s, timeNames[curTime]),
|
||||||
|
desc = getString(R.string.subscriptions_info),
|
||||||
|
icon = R.drawable.ic_round_notifications_none_24,
|
||||||
|
onClick = {
|
||||||
|
val speedDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.subscriptions_checking_time)
|
||||||
|
val dialog = speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
||||||
|
curTime = i
|
||||||
|
it.settingsTitle.text=
|
||||||
|
getString(R.string.subscriptions_checking_time_s, timeNames[i])
|
||||||
|
PrefManager.setVal(PrefName.SubscriptionNotificationInterval, curTime)
|
||||||
|
dialog.dismiss()
|
||||||
|
TaskScheduler.create(
|
||||||
|
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
||||||
|
).scheduleAllTasks(context)
|
||||||
|
}.show()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
},
|
||||||
|
onLongClick = {
|
||||||
|
TaskScheduler.create(
|
||||||
|
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
||||||
|
).scheduleAllTasks(context)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.anilist_notification_filters),
|
||||||
|
desc = getString(R.string.anilist_notification_filters),
|
||||||
|
icon = R.drawable.ic_anilist,
|
||||||
|
onClick = {
|
||||||
|
val types = NotificationType.entries.map { it.name }
|
||||||
|
val filteredTypes =
|
||||||
|
PrefManager.getVal<Set<String>>(PrefName.AnilistFilteredTypes).toMutableSet()
|
||||||
|
val selected = types.map { filteredTypes.contains(it) }.toBooleanArray()
|
||||||
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.anilist_notification_filters)
|
||||||
|
.setMultiChoiceItems(types.toTypedArray(), selected) { _, which, isChecked ->
|
||||||
|
val type = types[which]
|
||||||
|
if (isChecked) {
|
||||||
|
filteredTypes.add(type)
|
||||||
|
} else {
|
||||||
|
filteredTypes.remove(type)
|
||||||
|
}
|
||||||
|
PrefManager.setVal(PrefName.AnilistFilteredTypes, filteredTypes)
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
settingsCommentSubscriptionsTime.text = getString(
|
),
|
||||||
R.string.comment_notification_checking_time,
|
Settings(
|
||||||
cItems[PrefManager.getVal(PrefName.CommentNotificationInterval)]
|
type = 1,
|
||||||
)
|
name = getString(
|
||||||
settingsCommentSubscriptionsTime.setOnClickListener {
|
R.string.anilist_notifications_checking_time,
|
||||||
val selected = PrefManager.getVal<Int>(PrefName.CommentNotificationInterval)
|
aItems[PrefManager.getVal(PrefName.AnilistNotificationInterval)]
|
||||||
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
),
|
||||||
.setTitle(R.string.subscriptions_checking_time)
|
desc = getString(
|
||||||
.setSingleChoiceItems(cItems.toTypedArray(), selected) { dialog, i ->
|
R.string.anilist_notifications_checking_time,
|
||||||
PrefManager.setVal(PrefName.CommentNotificationInterval, i)
|
aItems[PrefManager.getVal(PrefName.AnilistNotificationInterval)]
|
||||||
settingsCommentSubscriptionsTime.text =
|
),
|
||||||
getString(R.string.comment_notification_checking_time, cItems[i])
|
icon = R.drawable.ic_round_notifications_none_24,
|
||||||
dialog.dismiss()
|
onClick = {
|
||||||
TaskScheduler.create(
|
val selected = PrefManager.getVal<Int>(PrefName.AnilistNotificationInterval)
|
||||||
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
).scheduleAllTasks(context)
|
.setTitle(R.string.subscriptions_checking_time)
|
||||||
}.create()
|
.setSingleChoiceItems(aItems.toTypedArray(), selected) { dialog, i ->
|
||||||
dialog.window?.setDimAmount(0.8f)
|
PrefManager.setVal(PrefName.AnilistNotificationInterval, i)
|
||||||
dialog.show()
|
it.settingsTitle.text =
|
||||||
}
|
getString(R.string.anilist_notifications_checking_time, aItems[i])
|
||||||
|
dialog.dismiss()
|
||||||
settingsNotificationsCheckingSubscriptions.isChecked =
|
TaskScheduler.create(
|
||||||
PrefManager.getVal(PrefName.SubscriptionCheckingNotifications)
|
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
||||||
settingsNotificationsCheckingSubscriptions.setOnCheckedChangeListener { _, isChecked ->
|
).scheduleAllTasks(context)
|
||||||
PrefManager.setVal(PrefName.SubscriptionCheckingNotifications, isChecked)
|
}.create()
|
||||||
}
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
settingsNotificationsCheckingSubscriptions.setOnLongClickListener {
|
}
|
||||||
openSettings(context, null)
|
),
|
||||||
}
|
Settings(
|
||||||
|
type = 1,
|
||||||
settingsNotificationsUseAlarmManager.isChecked =
|
name = getString(
|
||||||
PrefManager.getVal(PrefName.UseAlarmManager)
|
R.string.comment_notification_checking_time,
|
||||||
|
cItems[PrefManager.getVal(PrefName.CommentNotificationInterval)]
|
||||||
settingsNotificationsUseAlarmManager.setOnCheckedChangeListener { _, isChecked ->
|
),
|
||||||
if (isChecked) {
|
desc = getString(
|
||||||
val alertDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
R.string.comment_notification_checking_time,
|
||||||
.setTitle(R.string.use_alarm_manager)
|
cItems[PrefManager.getVal(PrefName.CommentNotificationInterval)]
|
||||||
.setMessage(R.string.use_alarm_manager_confirm)
|
),
|
||||||
.setPositiveButton(R.string.use) { dialog, _ ->
|
icon = R.drawable.ic_round_notifications_none_24,
|
||||||
PrefManager.setVal(PrefName.UseAlarmManager, true)
|
onClick = {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
val selected = PrefManager.getVal<Int>(PrefName.CommentNotificationInterval)
|
||||||
if (!(getSystemService(Context.ALARM_SERVICE) as AlarmManager).canScheduleExactAlarms()) {
|
val dialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
val intent =
|
.setTitle(R.string.subscriptions_checking_time)
|
||||||
Intent("android.settings.REQUEST_SCHEDULE_EXACT_ALARM")
|
.setSingleChoiceItems(cItems.toTypedArray(), selected) { dialog, i ->
|
||||||
startActivity(intent)
|
PrefManager.setVal(PrefName.CommentNotificationInterval, i)
|
||||||
settingsNotificationsCheckingSubscriptions.isChecked = true
|
it.settingsTitle.text =
|
||||||
}
|
getString(R.string.comment_notification_checking_time, cItems[i])
|
||||||
|
dialog.dismiss()
|
||||||
|
TaskScheduler.create(
|
||||||
|
context, PrefManager.getVal(PrefName.UseAlarmManager)
|
||||||
|
).scheduleAllTasks(context)
|
||||||
|
}.create()
|
||||||
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
dialog.show()
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.notification_for_checking_subscriptions),
|
||||||
|
desc = getString(R.string.notification_for_checking_subscriptions),
|
||||||
|
icon = R.drawable.ic_round_smart_button_24,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.SubscriptionCheckingNotifications),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.SubscriptionCheckingNotifications, isChecked)
|
||||||
|
},
|
||||||
|
onLongClick = {
|
||||||
|
openSettings(context, null)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.use_alarm_manager_reliable),
|
||||||
|
desc = getString(R.string.use_alarm_manager_reliable),
|
||||||
|
icon = R.drawable.ic_anilist,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.UseAlarmManager),
|
||||||
|
switch = {isChecked, view ->
|
||||||
|
if (isChecked) {
|
||||||
|
val alertDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||||
|
.setTitle(R.string.use_alarm_manager)
|
||||||
|
.setMessage(R.string.use_alarm_manager_confirm)
|
||||||
|
.setPositiveButton(R.string.use) { dialog, _ ->
|
||||||
|
PrefManager.setVal(PrefName.UseAlarmManager, true)
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
|
if (!(getSystemService(Context.ALARM_SERVICE) as AlarmManager).canScheduleExactAlarms()) {
|
||||||
|
val intent =
|
||||||
|
Intent("android.settings.REQUEST_SCHEDULE_EXACT_ALARM")
|
||||||
|
startActivity(intent)
|
||||||
|
view.settingsButton.isChecked = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}.setNegativeButton(R.string.cancel) { dialog, _ ->
|
||||||
|
view.settingsButton.isChecked = false
|
||||||
|
PrefManager.setVal(PrefName.UseAlarmManager, false)
|
||||||
|
|
||||||
|
dialog.dismiss()
|
||||||
|
}.create()
|
||||||
|
alertDialog.window?.setDimAmount(0.8f)
|
||||||
|
alertDialog.show()
|
||||||
|
} else {
|
||||||
|
PrefManager.setVal(PrefName.UseAlarmManager, false)
|
||||||
|
TaskScheduler.create(context, true).cancelAllTasks()
|
||||||
|
TaskScheduler.create(context, false)
|
||||||
|
.scheduleAllTasks(context)
|
||||||
}
|
}
|
||||||
dialog.dismiss()
|
},
|
||||||
}.setNegativeButton(R.string.cancel) { dialog, _ ->
|
),
|
||||||
settingsNotificationsCheckingSubscriptions.isChecked = false
|
)
|
||||||
PrefManager.setVal(PrefName.UseAlarmManager, false)
|
)
|
||||||
dialog.dismiss()
|
settingsRecyclerView.apply {
|
||||||
}.create()
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
alertDialog.window?.setDimAmount(0.8f)
|
setHasFixedSize(true)
|
||||||
alertDialog.show()
|
|
||||||
} else {
|
|
||||||
PrefManager.setVal(PrefName.UseAlarmManager, false)
|
|
||||||
TaskScheduler.create(context, true).cancelAllTasks()
|
|
||||||
TaskScheduler.create(context, false)
|
|
||||||
.scheduleAllTasks(context)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.view.ViewGroup
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.databinding.ActivitySettingsThemeBinding
|
import ani.dantotsu.databinding.ActivitySettingsThemeBinding
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
|
@ -58,7 +59,7 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsUiLight.setOnClickListener {
|
settingsUiLight.setOnClickListener {
|
||||||
settingsUseOLED.isChecked = false
|
PrefManager.setVal(PrefName.UseOLED, false)
|
||||||
uiTheme(1, it)
|
uiTheme(1, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,64 +90,85 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
|
||||||
restartApp(binding.root)
|
restartApp(binding.root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settingsUseOLED.apply {
|
|
||||||
isChecked = PrefManager.getVal(PrefName.UseOLED)
|
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
|
||||||
PrefManager.setVal(PrefName.UseOLED, isChecked)
|
|
||||||
restartApp(binding.root)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
|
|
||||||
|
|
||||||
settingsUseMaterialYou.apply {
|
settingsRecyclerView.adapter = SettingsAdapter(
|
||||||
isChecked = PrefManager.getVal(PrefName.UseMaterialYou)
|
arrayListOf(
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
Settings(
|
||||||
PrefManager.setVal(PrefName.UseMaterialYou, isChecked)
|
type = 2,
|
||||||
if (isChecked) settingsUseCustomTheme.isChecked = false
|
name = getString(R.string.oled_theme_variant),
|
||||||
restartApp(binding.root)
|
desc = getString(R.string.oled_theme_variant),
|
||||||
}
|
icon = R.drawable.ic_round_brightness_4_24,
|
||||||
visibility = View.VISIBLE
|
isChecked = PrefManager.getVal(PrefName.UseOLED),
|
||||||
}
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.UseOLED, isChecked)
|
||||||
settingsUseSourceTheme.apply {
|
restartApp(binding.root)
|
||||||
isChecked = PrefManager.getVal(PrefName.UseSourceTheme)
|
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
|
||||||
PrefManager.setVal(PrefName.UseSourceTheme, isChecked)
|
|
||||||
restartApp(binding.root)
|
|
||||||
}
|
|
||||||
visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
settingsUseCustomTheme.apply {
|
|
||||||
isChecked = PrefManager.getVal(PrefName.UseCustomTheme)
|
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
|
||||||
PrefManager.setVal(PrefName.UseCustomTheme, isChecked)
|
|
||||||
if (isChecked) {
|
|
||||||
settingsUseMaterialYou.isChecked = false
|
|
||||||
}
|
}
|
||||||
restartApp(binding.root)
|
),
|
||||||
}
|
Settings(
|
||||||
visibility = View.VISIBLE
|
type = 2,
|
||||||
}
|
name = getString(R.string.use_material_you),
|
||||||
|
desc = getString(R.string.use_material_you),
|
||||||
customTheme.apply {
|
icon = R.drawable.ic_round_new_releases_24,
|
||||||
setOnClickListener {
|
isChecked = PrefManager.getVal(PrefName.UseMaterialYou),
|
||||||
val originalColor: Int = PrefManager.getVal(PrefName.CustomThemeInt)
|
switch = { isChecked, _ ->
|
||||||
class CustomColorDialog : SimpleColorDialog() {
|
PrefManager.setVal(PrefName.UseMaterialYou, isChecked)
|
||||||
override fun onPositiveButtonClick() {
|
if (isChecked) PrefManager.setVal(PrefName.UseCustomTheme, false)
|
||||||
restartApp(binding.root)
|
restartApp(binding.root)
|
||||||
super.onPositiveButtonClick()
|
},
|
||||||
|
isVisible = Build.VERSION.SDK_INT > Build.VERSION_CODES.R
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.use_unique_theme_for_each_item),
|
||||||
|
desc = getString(R.string.use_unique_theme_for_each_item),
|
||||||
|
icon = R.drawable.ic_palette,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.UseSourceTheme),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.UseSourceTheme, isChecked)
|
||||||
|
restartApp(binding.root)
|
||||||
|
},
|
||||||
|
isVisible = Build.VERSION.SDK_INT > Build.VERSION_CODES.R
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 2,
|
||||||
|
name = getString(R.string.use_custom_theme),
|
||||||
|
desc = getString(R.string.use_custom_theme),
|
||||||
|
icon = R.drawable.ic_palette,
|
||||||
|
isChecked = PrefManager.getVal(PrefName.UseCustomTheme),
|
||||||
|
switch = { isChecked, _ ->
|
||||||
|
PrefManager.setVal(PrefName.UseCustomTheme, isChecked)
|
||||||
|
if (isChecked) PrefManager.setVal(PrefName.UseMaterialYou, false)
|
||||||
|
restartApp(binding.root)
|
||||||
|
},
|
||||||
|
isVisible = Build.VERSION.SDK_INT > Build.VERSION_CODES.R
|
||||||
|
),
|
||||||
|
Settings(
|
||||||
|
type = 1,
|
||||||
|
name = getString(R.string.color_picker),
|
||||||
|
desc = getString(R.string.color_picker),
|
||||||
|
icon = R.drawable.ic_palette,
|
||||||
|
onClick = {
|
||||||
|
val originalColor: Int = PrefManager.getVal(PrefName.CustomThemeInt)
|
||||||
|
class CustomColorDialog : SimpleColorDialog() {
|
||||||
|
override fun onPositiveButtonClick() {
|
||||||
|
restartApp(binding.root)
|
||||||
|
super.onPositiveButtonClick()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
val tag = "colorPicker"
|
||||||
val tag = "colorPicker"
|
CustomColorDialog().title(R.string.custom_theme).colorPreset(originalColor)
|
||||||
CustomColorDialog().title(R.string.custom_theme).colorPreset(originalColor)
|
.colors(context, SimpleColorDialog.MATERIAL_COLOR_PALLET)
|
||||||
.colors(context, SimpleColorDialog.MATERIAL_COLOR_PALLET)
|
.allowCustom(true).showOutline(0x46000000).gridNumColumn(5)
|
||||||
.allowCustom(true).showOutline(0x46000000).gridNumColumn(5)
|
.choiceMode(SimpleColorDialog.SINGLE_CHOICE).neg()
|
||||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE).neg()
|
.show(context, tag)
|
||||||
.show(context, tag)
|
},
|
||||||
}
|
isVisible = Build.VERSION.SDK_INT > Build.VERSION_CODES.R
|
||||||
visibility = View.VISIBLE
|
)
|
||||||
}
|
)
|
||||||
customThemeTitle.visibility = View.VISIBLE
|
)
|
||||||
|
settingsRecyclerView.apply {
|
||||||
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
|
setHasFixedSize(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
android:id="@+id/settingsRecyclerView"
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:nestedScrollingEnabled="true"
|
android:nestedScrollingEnabled="false"
|
||||||
android:requiresFadingEdge="vertical"
|
android:requiresFadingEdge="vertical"
|
||||||
tools:itemCount="5"
|
tools:itemCount="5"
|
||||||
tools:listitem="@layout/item_settings" />
|
tools:listitem="@layout/item_settings" />
|
||||||
|
|
|
@ -10,15 +10,12 @@
|
||||||
android:id="@+id/settingsAboutLayout"
|
android:id="@+id/settingsAboutLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -44,7 +41,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/about"
|
android:text="@string/about"
|
||||||
|
@ -53,7 +50,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
app:srcCompat="@drawable/ic_round_info_24"
|
app:srcCompat="@drawable/ic_round_info_24"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
|
@ -61,174 +59,14 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
android:id="@+id/settingsFAQ"
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="-31dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginEnd="-21dp"
|
android:nestedScrollingEnabled="false"
|
||||||
android:background="@drawable/ui_bg"
|
android:requiresFadingEdge="vertical"
|
||||||
android:backgroundTint="?attr/colorOnBackground"
|
tools:itemCount="5"
|
||||||
android:backgroundTintMode="src_atop"
|
tools:listitem="@layout/item_settings" />
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/faq"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_help_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsCheckUpdate"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="true"
|
|
||||||
android:drawableStart="@drawable/ic_round_new_releases_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/check_app_updates"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsShareUsername"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_search_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/share_username_in_crash_reports"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsLogToFile"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_edit_note_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/log_to_file"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:alpha="0.58"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:text="@string/logging_warning" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/settingsShareLog"
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:src="@drawable/ic_round_share_24"
|
|
||||||
tools:ignore="ContentDescription" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsDev"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/devs"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_accessible_forward_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsForks"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/forks"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_restaurant_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsDisclaimer"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/disclaimer"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_info_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -10,15 +10,12 @@
|
||||||
android:id="@+id/settingsAnimeLayout"
|
android:id="@+id/settingsAnimeLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -44,7 +41,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/anime"
|
android:text="@string/anime"
|
||||||
|
@ -53,8 +50,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
app:srcCompat="@drawable/ic_round_movie_filter_24"
|
app:srcCompat="@drawable/ic_round_movie_filter_24"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
|
@ -66,6 +63,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
@ -134,105 +132,15 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
android:id="@+id/settingsPlayer"
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="-31dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginEnd="-31dp"
|
android:nestedScrollingEnabled="false"
|
||||||
android:background="@drawable/ui_bg"
|
android:requiresFadingEdge="vertical"
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
tools:itemCount="5"
|
||||||
android:backgroundTintMode="src_atop"
|
tools:listitem="@layout/item_settings" />
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/player_settings"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_video_settings_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/purgeAnimeDownloads"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/purge_anime_downloads"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_delete_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsPreferDub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_audiotrack_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/prefer_dub"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsShowYt"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="true"
|
|
||||||
android:drawableStart="@drawable/ic_round_play_circle_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/show_yt"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsIncludeAnimeList"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="true"
|
|
||||||
android:drawableStart="@drawable/view_list_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/include_list"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -10,15 +10,12 @@
|
||||||
android:id="@+id/settingsCommonLayout"
|
android:id="@+id/settingsCommonLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -44,7 +41,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/common"
|
android:text="@string/common"
|
||||||
|
@ -53,7 +50,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
app:srcCompat="@drawable/ic_lightbulb_24"
|
app:srcCompat="@drawable/ic_lightbulb_24"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
|
@ -65,6 +63,7 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -133,87 +132,10 @@
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsUi"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/ui_settings"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_auto_awesome_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsDownloadManager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
|
||||||
android:backgroundTintMode="src_atop"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/download_manager_select"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_download_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/importExportSettings"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
|
||||||
android:backgroundTintMode="src_atop"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/backup_restore"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/backup_restore"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="-16dp"
|
|
||||||
android:layout_marginEnd="-16dp"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
android:alpha="0.58"
|
android:alpha="0.58"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/selected_dns" />
|
android:text="@string/selected_dns" />
|
||||||
|
@ -222,6 +144,7 @@
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
app:boxCornerRadiusBottomEnd="8dp"
|
app:boxCornerRadiusBottomEnd="8dp"
|
||||||
app:boxCornerRadiusBottomStart="8dp"
|
app:boxCornerRadiusBottomStart="8dp"
|
||||||
|
@ -246,101 +169,15 @@
|
||||||
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
|
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
android:id="@+id/settingsContinueMedia"
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:checked="true"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:drawableStart="@drawable/ic_round_play_disabled_24"
|
android:nestedScrollingEnabled="false"
|
||||||
android:drawablePadding="16dp"
|
android:requiresFadingEdge="vertical"
|
||||||
android:elegantTextHeight="true"
|
tools:itemCount="5"
|
||||||
android:fontFamily="@font/poppins_bold"
|
tools:listitem="@layout/item_settings" />
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/always_continue_content"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsSearchSources"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="true"
|
|
||||||
android:drawableStart="@drawable/ic_round_search_sources_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/search_source_list"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsRecentlyListOnly"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_new_releases_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/recentlyListOnly"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsAdultAnimeOnly"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="true"
|
|
||||||
android:drawableStart="@drawable/ic_round_nsfw_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/adult_only_content"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsDownloadLocation"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
|
||||||
android:backgroundTintMode="src_atop"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/change_download_location"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_source_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -10,15 +10,13 @@
|
||||||
android:id="@+id/settingsExtensionsLayout"
|
android:id="@+id/settingsExtensionsLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -44,7 +42,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/extensions"
|
android:text="@string/extensions"
|
||||||
|
@ -53,51 +51,20 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
app:srcCompat="@drawable/ic_extension"
|
app:srcCompat="@drawable/ic_extension"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/userAgent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
|
||||||
android:backgroundTintMode="src_atop"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingHorizontal="31dp"
|
|
||||||
android:text="@string/user_agent"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_video_settings_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="-16dp"
|
|
||||||
android:layout_marginEnd="-16dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
android:layout_marginHorizontal="12dp"
|
||||||
android:id="@+id/animeAddRepository"
|
android:id="@+id/animeAddRepository"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
android:background="@drawable/ui_bg"
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
android:backgroundTint="?attr/colorSecondary"
|
||||||
android:backgroundTintMode="src_atop"
|
android:backgroundTintMode="src_atop"
|
||||||
|
@ -126,19 +93,11 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:ignore="RtlSymmetry" />
|
tools:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="-16dp"
|
|
||||||
android:layout_marginEnd="-16dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/mangaAddRepository"
|
android:id="@+id/mangaAddRepository"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:layout_marginStart="-31dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
android:background="@drawable/ui_bg"
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
android:backgroundTint="?attr/colorSecondary"
|
||||||
android:backgroundTintMode="src_atop"
|
android:backgroundTintMode="src_atop"
|
||||||
|
@ -166,66 +125,14 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:ignore="RtlSymmetry" />
|
tools:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
<View
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginEnd="-16dp"
|
android:nestedScrollingEnabled="false"
|
||||||
android:background="?android:attr/listDivider" />
|
android:requiresFadingEdge="vertical"
|
||||||
|
tools:itemCount="5"
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
tools:listitem="@layout/item_settings" />
|
||||||
android:id="@+id/settingsForceLegacyInstall"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_new_releases_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/force_legacy_installer"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/skipExtensionIcons"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_no_icon_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/skip_loading_extension_icons"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/NSFWExtension"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_nsfw_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/NSFWExtention"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -10,14 +10,12 @@
|
||||||
android:id="@+id/settingsMangaLayout"
|
android:id="@+id/settingsMangaLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -43,7 +41,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/manga"
|
android:text="@string/manga"
|
||||||
|
@ -52,7 +50,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
app:srcCompat="@drawable/ic_round_import_contacts_24"
|
app:srcCompat="@drawable/ic_round_import_contacts_24"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
|
@ -64,6 +63,7 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -114,89 +114,14 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
android:id="@+id/settingsReader"
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="-31dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginEnd="-31dp"
|
android:nestedScrollingEnabled="false"
|
||||||
android:background="@drawable/ui_bg"
|
android:requiresFadingEdge="vertical"
|
||||||
android:fontFamily="@font/poppins_bold"
|
tools:itemCount="5"
|
||||||
android:insetTop="0dp"
|
tools:listitem="@layout/item_settings" />
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/reader_settings"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_reader_settings"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/purgeMangaDownloads"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/purge_manga_downloads"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_delete_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/purgeNovelDownloads"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/purge_novel_downloads"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_delete_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsIncludeMangaList"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/view_list_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/include_list"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -10,15 +10,13 @@
|
||||||
android:id="@+id/settingsNotificationsLayout"
|
android:id="@+id/settingsNotificationsLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -44,7 +42,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/notifications"
|
android:text="@string/notifications"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
|
@ -53,7 +51,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
app:srcCompat="@drawable/ic_round_notifications_none_24"
|
app:srcCompat="@drawable/ic_round_notifications_none_24"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
|
@ -61,145 +60,15 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
<Button
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:id="@+id/settingsSubscriptionsTime"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="-11dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginTop="8dp"
|
android:nestedScrollingEnabled="false"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:requiresFadingEdge="vertical"
|
||||||
android:insetTop="0dp"
|
tools:itemCount="5"
|
||||||
android:insetBottom="0dp"
|
tools:listitem="@layout/item_settings" />
|
||||||
android:text="@string/subscriptions_checking_time_s"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_notifications_none_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:alpha="0.58"
|
|
||||||
android:fontFamily="@font/poppins_family"
|
|
||||||
android:text="@string/subscriptions_info"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="-16dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginEnd="-16dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsAnilistNotifications"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/anilist_notification_filters"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_anilist"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsAnilistSubscriptionsTime"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-11dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:text="@string/anilist_notifications_checking_time"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_notifications_none_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/settingsCommentSubscriptionsTime"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-11dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:text="@string/comment_notification_checking_time"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_notifications_none_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="-16dp"
|
|
||||||
android:layout_marginEnd="-16dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsNotificationsCheckingSubscriptions"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_smart_button_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/notification_for_checking_subscriptions"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsNotificationsUseAlarmManager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_new_releases_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/use_alarm_manager_reliable"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -10,15 +10,13 @@
|
||||||
android:id="@+id/settingsThemeLayout"
|
android:id="@+id/settingsThemeLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:paddingStart="32dp"
|
|
||||||
android:paddingEnd="32dp">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
app:cardBackgroundColor="@color/nav_bg_inv"
|
app:cardBackgroundColor="@color/nav_bg_inv"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
|
@ -44,7 +42,7 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="32dp"
|
android:layout_margin="32dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:text="@string/theme"
|
android:text="@string/theme"
|
||||||
|
@ -53,7 +51,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="96dp"
|
android:layout_width="96dp"
|
||||||
android:layout_height="96dp"
|
android:layout_height="96dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
app:srcCompat="@drawable/ic_palette"
|
app:srcCompat="@drawable/ic_palette"
|
||||||
app:tint="?attr/colorOnBackground"
|
app:tint="?attr/colorOnBackground"
|
||||||
|
@ -66,6 +65,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginHorizontal="32dp"
|
||||||
app:boxCornerRadiusBottomEnd="8dp"
|
app:boxCornerRadiusBottomEnd="8dp"
|
||||||
app:boxCornerRadiusBottomStart="8dp"
|
app:boxCornerRadiusBottomStart="8dp"
|
||||||
app:boxCornerRadiusTopEnd="8dp"
|
app:boxCornerRadiusTopEnd="8dp"
|
||||||
|
@ -162,122 +163,14 @@
|
||||||
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
|
tools:ignore="LabelFor,TextContrastCheck,DuplicateSpeakableTextCheck" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
android:id="@+id/settingsUseOLED"
|
android:id="@+id/settingsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:checked="false"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:drawableStart="@drawable/ic_round_brightness_4_24"
|
android:nestedScrollingEnabled="false"
|
||||||
android:drawablePadding="16dp"
|
android:requiresFadingEdge="vertical"
|
||||||
android:elegantTextHeight="true"
|
tools:itemCount="5"
|
||||||
android:fontFamily="@font/poppins_bold"
|
tools:listitem="@layout/item_settings" />
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/oled_theme_variant"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track" />
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsUseMaterialYou"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_round_new_releases_24"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/use_material_you"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsUseSourceTheme"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_palette"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/use_unique_theme_for_each_item"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/customThemeTitle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="-11dp"
|
|
||||||
android:alpha="0.58"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:text="@string/custom_theme"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/settingsUseCustomTheme"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:drawableStart="@drawable/ic_palette"
|
|
||||||
android:drawablePadding="16dp"
|
|
||||||
android:elegantTextHeight="true"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:minHeight="64dp"
|
|
||||||
android:text="@string/use_custom_theme"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:drawableTint="?attr/colorPrimary"
|
|
||||||
app:showText="false"
|
|
||||||
app:thumbTint="@color/button_switch_track"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/customTheme"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginStart="-31dp"
|
|
||||||
android:layout_marginEnd="-31dp"
|
|
||||||
android:background="@drawable/ui_bg"
|
|
||||||
android:backgroundTint="?attr/colorSecondary"
|
|
||||||
android:backgroundTintMode="src_atop"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingStart="31dp"
|
|
||||||
android:paddingEnd="31dp"
|
|
||||||
android:text="@string/color_picker"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="?attr/colorOnBackground"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_color_picker_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp"
|
|
||||||
app:iconTint="?attr/colorPrimary"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
|
@ -19,8 +19,9 @@
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
android:minHeight="44sp"
|
android:minHeight="44sp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -43,4 +44,15 @@
|
||||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/settingsIconRight"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"
|
||||||
|
app:srcCompat="@drawable/ic_round_arrow_back_ios_new_24"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
|
android:rotation="180"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
55
app/src/main/res/layout/item_settings_switch.xml
Normal file
55
app/src/main/res/layout/item_settings_switch.xml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/settingsLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:gravity="center_vertical|start"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/settingsIcon"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_margin="24dp"
|
||||||
|
app:srcCompat="@drawable/ic_circle_add"
|
||||||
|
app:tint="?attr/colorPrimary"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="44sp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/settingsButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="12dp"
|
||||||
|
android:checked="false"
|
||||||
|
android:elegantTextHeight="true"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:fontFamily="@font/poppins_bold"
|
||||||
|
android:text="@string/name"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textColor="?attr/colorOnBackground"
|
||||||
|
app:cornerRadius="0dp"
|
||||||
|
app:drawableTint="?attr/colorPrimary"
|
||||||
|
app:showText="false"
|
||||||
|
app:thumbTint="@color/button_switch_track" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/settingsDesc"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="64dp"
|
||||||
|
android:alpha="0.66"
|
||||||
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
|
android:text="@string/slogan"
|
||||||
|
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue