feat: settings to recycler view
This commit is contained in:
parent
108285021e
commit
820a09b28f
5 changed files with 246 additions and 511 deletions
10
app/src/main/java/ani/dantotsu/settings/Settings.kt
Normal file
10
app/src/main/java/ani/dantotsu/settings/Settings.kt
Normal file
|
@ -0,0 +1,10 @@
|
|||
package ani.dantotsu.settings
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
data class Settings(
|
||||
val name : String,
|
||||
val icon : Int,
|
||||
val desc: String,
|
||||
val activity: Class<out Activity>
|
||||
)
|
|
@ -1,12 +1,6 @@
|
|||
package ani.dantotsu.settings
|
||||
|
||||
import android.app.AlarmManager
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Animatable
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Build.BRAND
|
||||
import android.os.Build.DEVICE
|
||||
import android.os.Build.SUPPORTED_ABIS
|
||||
|
@ -14,150 +8,133 @@ import android.os.Build.VERSION.CODENAME
|
|||
import android.os.Build.VERSION.RELEASE
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import android.os.Bundle
|
||||
import android.view.HapticFeedbackConstants
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.documentfile.provider.DocumentFile
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import ani.dantotsu.BuildConfig
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.anilist.api.NotificationType
|
||||
import ani.dantotsu.copyToClipboard
|
||||
import ani.dantotsu.databinding.ActivitySettingsAnimeBinding
|
||||
import ani.dantotsu.databinding.ActivitySettingsBinding
|
||||
import ani.dantotsu.databinding.ActivitySettingsCommonBinding
|
||||
import ani.dantotsu.databinding.ActivitySettingsExtensionsBinding
|
||||
import ani.dantotsu.databinding.ActivitySettingsMangaBinding
|
||||
import ani.dantotsu.databinding.ActivitySettingsNotificationsBinding
|
||||
import ani.dantotsu.databinding.ActivitySettingsThemeBinding
|
||||
import ani.dantotsu.databinding.ItemRepositoryBinding
|
||||
import ani.dantotsu.download.DownloadsManager
|
||||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.media.MediaType
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.notifications.TaskScheduler
|
||||
import ani.dantotsu.notifications.anilist.AnilistNotificationWorker
|
||||
import ani.dantotsu.notifications.comment.CommentNotificationWorker
|
||||
import ani.dantotsu.notifications.subscription.SubscriptionNotificationWorker.Companion.checkIntervals
|
||||
import ani.dantotsu.openLinkInBrowser
|
||||
import ani.dantotsu.openLinkInYouTube
|
||||
import ani.dantotsu.openSettings
|
||||
import ani.dantotsu.others.AppUpdater
|
||||
import ani.dantotsu.others.CustomBottomDialog
|
||||
import ani.dantotsu.pop
|
||||
import ani.dantotsu.reloadActivity
|
||||
import ani.dantotsu.restartApp
|
||||
import ani.dantotsu.savePrefsToDownloads
|
||||
import ani.dantotsu.setSafeOnClickListener
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.internal.Location
|
||||
import ani.dantotsu.settings.saving.internal.PreferenceKeystore
|
||||
import ani.dantotsu.settings.saving.internal.PreferencePackager
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.startMainActivity
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import ani.dantotsu.toast
|
||||
import ani.dantotsu.util.LauncherWrapper
|
||||
import ani.dantotsu.util.Logger
|
||||
import ani.dantotsu.util.StoragePermissions.Companion.downloadsPermission
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import eltos.simpledialogfragment.SimpleDialog
|
||||
import eltos.simpledialogfragment.SimpleDialog.OnDialogResultListener.BUTTON_POSITIVE
|
||||
import eltos.simpledialogfragment.color.SimpleColorDialog
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListener {
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
private val restartMainActivity = object : OnBackPressedCallback(false) {
|
||||
override fun handleOnBackPressed() = startMainActivity(this@SettingsActivity)
|
||||
}
|
||||
lateinit var binding: ActivitySettingsBinding
|
||||
private var cursedCounter = 0
|
||||
|
||||
|
||||
@OptIn(UnstableApi::class)
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
initActivity(this)
|
||||
|
||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
initActivity(this)
|
||||
val context = this
|
||||
binding.apply {
|
||||
settingsVersion.apply {
|
||||
text = getString(R.string.version_current, BuildConfig.VERSION_NAME)
|
||||
|
||||
binding.settingsVersion.text = getString(R.string.version_current, BuildConfig.VERSION_NAME)
|
||||
binding.settingsVersion.setOnLongClickListener {
|
||||
settingsVersion.setOnLongClickListener {
|
||||
copyToClipboard(getDeviceInfo(), false)
|
||||
toast(getString(R.string.copied_device_info))
|
||||
return@setOnLongClickListener true
|
||||
}
|
||||
|
||||
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
}
|
||||
settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
bottomMargin = navBarHeight
|
||||
}
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, restartMainActivity)
|
||||
onBackPressedDispatcher.addCallback(context, restartMainActivity)
|
||||
|
||||
binding.settingsBack.setOnClickListener {
|
||||
settingsBack.setOnClickListener {
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
}
|
||||
|
||||
binding.apply {
|
||||
settingsAbout.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsAboutActivity::class.java))
|
||||
}
|
||||
settingsAccount.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsAccountActivity::class.java))
|
||||
}
|
||||
settingsAnime.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsAnimeActivity::class.java))
|
||||
}
|
||||
settingsManga.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsMangaActivity::class.java))
|
||||
}
|
||||
settingsCommon.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsCommonActivity::class.java))
|
||||
}
|
||||
settingsExtension.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsExtensionsActivity::class.java))
|
||||
}
|
||||
settingsNotification.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsNotificationActivity::class.java))
|
||||
}
|
||||
settingsTheme.setOnClickListener {
|
||||
startActivity(Intent(this@SettingsActivity, SettingsThemeActivity::class.java))
|
||||
}
|
||||
|
||||
val settings = arrayListOf(
|
||||
Settings(
|
||||
getString(R.string.accounts),
|
||||
R.drawable.ic_round_person_24,
|
||||
getString(R.string.accounts_desc),
|
||||
SettingsAccountActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.theme),
|
||||
R.drawable.ic_palette,
|
||||
getString(R.string.theme_desc),
|
||||
SettingsThemeActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.common),
|
||||
R.drawable.ic_lightbulb_24,
|
||||
getString(R.string.common_desc),
|
||||
SettingsCommonActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.anime),
|
||||
R.drawable.ic_round_movie_filter_24,
|
||||
getString(R.string.anime_desc),
|
||||
SettingsAnimeActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.manga),
|
||||
R.drawable.ic_round_import_contacts_24,
|
||||
getString(R.string.manga_desc),
|
||||
SettingsMangaActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.extensions),
|
||||
R.drawable.ic_extension,
|
||||
getString(R.string.extensions_desc),
|
||||
SettingsExtensionsActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.notifications),
|
||||
R.drawable.ic_round_notifications_none_24,
|
||||
getString(R.string.notifications_desc),
|
||||
SettingsNotificationActivity::class.java
|
||||
),
|
||||
Settings(
|
||||
getString(R.string.about),
|
||||
R.drawable.ic_round_info_24,
|
||||
getString(R.string.about_desc),
|
||||
SettingsAboutActivity::class.java
|
||||
),
|
||||
)
|
||||
|
||||
settingsRecyclerView.apply {
|
||||
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
adapter = SettingsAdapter(settings)
|
||||
setHasFixedSize(true)
|
||||
}
|
||||
|
||||
if (!BuildConfig.FLAVOR.contains("fdroid")) {
|
||||
binding.settingsLogo.setOnLongClickListener {
|
||||
settingsLogo.setOnLongClickListener {
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
AppUpdater.check(this@SettingsActivity, true)
|
||||
}
|
||||
|
@ -165,39 +142,39 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
|||
}
|
||||
}
|
||||
|
||||
binding.settingBuyMeCoffee.setOnClickListener {
|
||||
settingBuyMeCoffee.setOnClickListener {
|
||||
lifecycleScope.launch {
|
||||
it.pop()
|
||||
}
|
||||
openLinkInBrowser(getString(R.string.coffee))
|
||||
}
|
||||
lifecycleScope.launch {
|
||||
binding.settingBuyMeCoffee.pop()
|
||||
settingBuyMeCoffee.pop()
|
||||
}
|
||||
|
||||
binding.loginDiscord.setOnClickListener {
|
||||
loginDiscord.setOnClickListener {
|
||||
openLinkInBrowser(getString(R.string.discord))
|
||||
}
|
||||
binding.loginGithub.setOnClickListener {
|
||||
loginGithub.setOnClickListener {
|
||||
openLinkInBrowser(getString(R.string.github))
|
||||
}
|
||||
binding.loginTelegram.setOnClickListener {
|
||||
loginTelegram.setOnClickListener {
|
||||
openLinkInBrowser(getString(R.string.telegram))
|
||||
}
|
||||
|
||||
|
||||
(binding.settingsLogo.drawable as Animatable).start()
|
||||
(settingsLogo.drawable as Animatable).start()
|
||||
val array = resources.getStringArray(R.array.tips)
|
||||
|
||||
binding.settingsLogo.setSafeOnClickListener {
|
||||
settingsLogo.setSafeOnClickListener {
|
||||
cursedCounter++
|
||||
(binding.settingsLogo.drawable as Animatable).start()
|
||||
(settingsLogo.drawable as Animatable).start()
|
||||
if (cursedCounter % 7 == 0) {
|
||||
toast(R.string.you_cursed)
|
||||
openLinkInYouTube(getString(R.string.cursed_yt))
|
||||
//PrefManager.setVal(PrefName.ImageUrl, !PrefManager.getVal(PrefName.ImageUrl, false))
|
||||
} else {
|
||||
snackString(array[(Math.random() * array.size).toInt()], this)
|
||||
snackString(array[(Math.random() * array.size).toInt()], context)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -218,7 +195,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
|||
}
|
||||
|
||||
setPositiveButton(this@SettingsActivity.getString(R.string.donate)) {
|
||||
binding.settingBuyMeCoffee.performClick()
|
||||
settingBuyMeCoffee.performClick()
|
||||
dismiss()
|
||||
}
|
||||
show(supportFragmentManager, "dialog")
|
||||
|
@ -227,18 +204,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResult(dialogTag: String, which: Int, extras: Bundle): Boolean {
|
||||
if (which == BUTTON_POSITIVE) {
|
||||
if (dialogTag == "colorPicker") {
|
||||
val color = extras.getInt(SimpleColorDialog.COLOR)
|
||||
PrefManager.setVal(PrefName.CustomThemeInt, color)
|
||||
Logger.log("Custom Theme: $color")
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
fun getDeviceInfo(): String {
|
||||
|
|
44
app/src/main/java/ani/dantotsu/settings/SettingsAdapter.kt
Normal file
44
app/src/main/java/ani/dantotsu/settings/SettingsAdapter.kt
Normal file
|
@ -0,0 +1,44 @@
|
|||
package ani.dantotsu.settings
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ani.dantotsu.databinding.ItemSettingsBinding
|
||||
import ani.dantotsu.setAnimation
|
||||
|
||||
class SettingsAdapter(private val settings: ArrayList<Settings>) : RecyclerView.Adapter<SettingsAdapter.SettingsViewHolder>(){
|
||||
inner class SettingsViewHolder(val binding: ItemSettingsBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
init {
|
||||
itemView.setOnClickListener {
|
||||
ContextCompat.startActivity(
|
||||
binding.root.context, Intent(binding.root.context, settings[bindingAdapterPosition].activity),
|
||||
null
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
|
@ -66,6 +66,7 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -75,345 +76,14 @@
|
|||
android:orientation="vertical"
|
||||
tools:ignore="ContentDescription">
|
||||
|
||||
<!--account-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsAccount"
|
||||
<ani.dantotsu.FadingEdgeRecyclerView
|
||||
android:id="@+id/settingsRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_round_person_24"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/accounts"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/accounts_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--theme-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsTheme"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_palette"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/theme"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/theme_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--extentions-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsExtension"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
android:scaleX="0.92"
|
||||
android:scaleY="0.92"
|
||||
app:srcCompat="@drawable/ic_extension"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/extensions"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/extensions_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--Common-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsCommon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_lightbulb_24"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/common"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/common_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--Notification-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsNotification"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_round_notifications_none_24"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/notifications"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/notifications_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--Anime-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsAnime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_round_movie_filter_24"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/anime"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/anime_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--Manga-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsManga"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_round_import_contacts_24"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/manga"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/manga_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!--about-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsAbout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center_vertical|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_margin="24dp"
|
||||
app:srcCompat="@drawable/ic_round_info_24"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="44sp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/about"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.66"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/about_desc"
|
||||
android:textColor="?attr/colorOnSurfaceVariant" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
android:nestedScrollingEnabled="true"
|
||||
android:requiresFadingEdge="vertical"
|
||||
tools:itemCount="5"
|
||||
tools:listitem="@layout/item_settings" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
|
45
app/src/main/res/layout/item_settings.xml
Normal file
45
app/src/main/res/layout/item_settings.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?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: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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/name"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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