fix: some tweaks in settings
This commit is contained in:
parent
da56aecd5e
commit
e0df092a70
4 changed files with 76 additions and 63 deletions
|
@ -599,19 +599,29 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
||||||
val view = ItemRepositoryBinding.inflate(
|
val view = ItemRepositoryBinding.inflate(
|
||||||
LayoutInflater.from(animeRepoInventory.context), animeRepoInventory, true
|
LayoutInflater.from(animeRepoInventory.context), animeRepoInventory, true
|
||||||
)
|
)
|
||||||
view.repositoryItem.text = item
|
view.repositoryItem.text = item.replace("https://raw.githubusercontent.com/", "")
|
||||||
view.repositoryItem.setOnClickListener {
|
view.repositoryItem.setOnClickListener {
|
||||||
snackString(getString(R.string.long_click_delete))
|
AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
|
||||||
|
.setTitle("Delete Anime Repository")
|
||||||
|
.setMessage(item)
|
||||||
|
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||||
|
val anime = PrefManager.getVal<Set<String>>(PrefName.AnimeExtensionRepos).minus(item)
|
||||||
|
PrefManager.setVal(PrefName.AnimeExtensionRepos, anime)
|
||||||
|
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
||||||
|
setExtensionOutput()
|
||||||
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
animeExtensionManager.findAvailableExtensions()
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
.setNegativeButton(getString(R.string.cancel)) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
.create()
|
||||||
|
.show()
|
||||||
}
|
}
|
||||||
view.repositoryItem.setOnLongClickListener {
|
view.repositoryItem.setOnLongClickListener {
|
||||||
val anime = PrefManager.getVal<Set<String>>(PrefName.AnimeExtensionRepos)
|
copyToClipboard(item, true)
|
||||||
.minus(item)
|
|
||||||
PrefManager.setVal(PrefName.AnimeExtensionRepos, anime)
|
|
||||||
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
|
||||||
setExtensionOutput()
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
|
||||||
animeExtensionManager.findAvailableExtensions()
|
|
||||||
}
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -621,19 +631,29 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
||||||
val view = ItemRepositoryBinding.inflate(
|
val view = ItemRepositoryBinding.inflate(
|
||||||
LayoutInflater.from(mangaRepoInventory.context), mangaRepoInventory, true
|
LayoutInflater.from(mangaRepoInventory.context), mangaRepoInventory, true
|
||||||
)
|
)
|
||||||
view.repositoryItem.text = item
|
view.repositoryItem.text = item.replace("https://raw.githubusercontent.com/", "")
|
||||||
view.repositoryItem.setOnClickListener {
|
view.repositoryItem.setOnClickListener {
|
||||||
snackString(getString(R.string.long_click_delete))
|
AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
|
||||||
|
.setTitle("Delete Manga Repository")
|
||||||
|
.setMessage(item)
|
||||||
|
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||||
|
val manga = PrefManager.getVal<Set<String>>(PrefName.MangaExtensionRepos).minus(item)
|
||||||
|
PrefManager.setVal(PrefName.MangaExtensionRepos, manga)
|
||||||
|
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
||||||
|
setExtensionOutput()
|
||||||
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
|
mangaExtensionManager.findAvailableExtensions()
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
.setNegativeButton(getString(R.string.cancel)) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
.create()
|
||||||
|
.show()
|
||||||
}
|
}
|
||||||
view.repositoryItem.setOnLongClickListener {
|
view.repositoryItem.setOnLongClickListener {
|
||||||
val anime = PrefManager.getVal<Set<String>>(PrefName.MangaExtensionRepos)
|
copyToClipboard(item, true)
|
||||||
.minus(item)
|
|
||||||
PrefManager.setVal(PrefName.MangaExtensionRepos, anime)
|
|
||||||
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
|
||||||
setExtensionOutput()
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
|
||||||
mangaExtensionManager.findAvailableExtensions()
|
|
||||||
}
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -684,7 +704,8 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
||||||
hint = getString(R.string.anime_add_repository)
|
hint = getString(R.string.anime_add_repository)
|
||||||
}
|
}
|
||||||
val alertDialog = AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
|
val alertDialog = AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
|
||||||
.setTitle(R.string.anime_add_repository)
|
.setTitle(R.string.add_repository)
|
||||||
|
.setMessage("Add additional repo for anime extensions")
|
||||||
.setView(dialogView)
|
.setView(dialogView)
|
||||||
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||||
processUserInput(editText.text.toString(), MediaType.ANIME)
|
processUserInput(editText.text.toString(), MediaType.ANIME)
|
||||||
|
@ -712,8 +733,9 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
||||||
hint = getString(R.string.manga_add_repository)
|
hint = getString(R.string.manga_add_repository)
|
||||||
}
|
}
|
||||||
val alertDialog = AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
|
val alertDialog = AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
|
||||||
.setTitle(R.string.manga_add_repository)
|
.setTitle(R.string.add_repository)
|
||||||
.setView(dialogView)
|
.setView(dialogView)
|
||||||
|
.setMessage("Add additional repo for manga extensions")
|
||||||
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||||
processUserInput(editText.text.toString(), MediaType.MANGA)
|
processUserInput(editText.text.toString(), MediaType.MANGA)
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
|
|
@ -50,16 +50,6 @@
|
||||||
app:iconSize="24dp"
|
app:iconSize="24dp"
|
||||||
app:iconTint="?attr/colorPrimary" />
|
app:iconTint="?attr/colorPrimary" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/animeRepoHeading"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:text="@string/anime_repo_listing"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:ignore="RtlSymmetry" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
@ -67,16 +57,6 @@
|
||||||
android:layout_marginEnd="-16dp"
|
android:layout_marginEnd="-16dp"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/animeRepoInventory"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:paddingStart="36dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="RtlSymmetry"
|
|
||||||
android:orientation="vertical" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/animeAddRepository"
|
android:id="@+id/animeAddRepository"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -100,34 +80,24 @@
|
||||||
app:iconSize="24dp"
|
app:iconSize="24dp"
|
||||||
app:iconTint="?attr/colorPrimary" />
|
app:iconTint="?attr/colorPrimary" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/mangaRepoHeading"
|
<LinearLayout
|
||||||
|
android:id="@+id/animeRepoInventory"
|
||||||
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_marginTop="8dp"
|
||||||
android:fontFamily="@font/poppins_bold"
|
android:orientation="vertical"
|
||||||
android:text="@string/manga_repo_listing"
|
android:paddingStart="36dp"
|
||||||
android:textSize="14sp"
|
android:visibility="gone"
|
||||||
tools:ignore="RtlSymmetry" />
|
tools:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/mangaRepoDivider"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="-16dp"
|
||||||
android:layout_marginEnd="-16dp"
|
android:layout_marginEnd="-16dp"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/mangaRepoInventory"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:paddingStart="36dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="RtlSymmetry"
|
|
||||||
android:orientation="vertical" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/mangaAddRepository"
|
android:id="@+id/mangaAddRepository"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -151,6 +121,23 @@
|
||||||
app:iconSize="24dp"
|
app:iconSize="24dp"
|
||||||
app:iconTint="?attr/colorPrimary" />
|
app:iconTint="?attr/colorPrimary" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/mangaRepoInventory"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="36dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
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" />
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
android:id="@+id/settingsForceLegacyInstall"
|
android:id="@+id/settingsForceLegacyInstall"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -209,8 +196,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginStart="-16dp"
|
android:layout_marginStart="-16dp"
|
||||||
android:layout_marginEnd="-16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="-16dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
</ani.dantotsu.others.Xpandable>
|
</ani.dantotsu.others.Xpandable>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
@ -12,7 +12,10 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/poppins_semi_bold"
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
|
android:ellipsize="end"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textColor="?attr/colorOnBackground" />
|
android:textColor="?attr/colorOnBackground"
|
||||||
|
android:singleLine="true"
|
||||||
|
tools:text="xyz repo"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -868,6 +868,7 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
|
||||||
<string name="anime_add_repository">Add Anime Repo</string>
|
<string name="anime_add_repository">Add Anime Repo</string>
|
||||||
<string name="manga_repo_listing">Manga Extension Repos</string>
|
<string name="manga_repo_listing">Manga Extension Repos</string>
|
||||||
<string name="manga_add_repository">Add Manga Repo</string>
|
<string name="manga_add_repository">Add Manga Repo</string>
|
||||||
|
<string name="add_repository">Add Repo</string>
|
||||||
<string name="long_click_delete">Long click to delete</string>
|
<string name="long_click_delete">Long click to delete</string>
|
||||||
|
|
||||||
<string name="trending_movies">Trending Movies</string>
|
<string name="trending_movies">Trending Movies</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue