some customizations (#59)

* quickfix

* android locale tuning

* toggle option to setting

* some customizations

---------

Co-authored-by: rebelonion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
aayush262 2023-11-24 12:58:44 +05:30 committed by GitHub
parent ba351df331
commit af326c8258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 40 additions and 33 deletions

View file

@ -56,7 +56,7 @@ ThemeManager(this).applyTheme()
window.navigationBarColor = primaryColor
binding.listTabLayout.setBackgroundColor(primaryColor)
binding.listAppBar.setBackgroundColor(primaryColor)
binding.listTitle.setTextColor(titleTextColor)
binding.listTitle.setTextColor(primaryTextColor)
binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor)
binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor)
val uiSettings = loadData<UserInterfaceSettings>("ui_settings") ?: UserInterfaceSettings()

View file

@ -54,7 +54,7 @@ ThemeManager(this).applyTheme()
window.navigationBarColor = primaryColor
binding.listTabLayout.setBackgroundColor(primaryColor)
binding.listAppBar.setBackgroundColor(primaryColor)
binding.listTitle.setTextColor(titleTextColor)
binding.listTitle.setTextColor(primaryTextColor)
binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor)
binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor)
val uiSettings = loadData<UserInterfaceSettings>("ui_settings") ?: UserInterfaceSettings()

View file

@ -53,7 +53,7 @@ class InstalledAnimeExtensionsFragment : Fragment() {
if (allSettings.size > 1) {
val names = allSettings.map { it.lang }.toTypedArray()
var selectedIndex = 0
AlertDialog.Builder(requireContext())
AlertDialog.Builder(requireContext(), R.style.MyPopup)
.setTitle("Select a Source")
.setSingleChoiceItems(names, selectedIndex) { _, which ->
selectedIndex = which

View file

@ -60,7 +60,7 @@ class InstalledMangaExtensionsFragment : Fragment() {
if (allSettings.size > 1) {
val names = allSettings.map { it.lang }.toTypedArray()
var selectedIndex = 0
AlertDialog.Builder(requireContext())
AlertDialog.Builder(requireContext(), R.style.MyPopup)
.setTitle("Select a Source")
.setSingleChoiceItems(names, selectedIndex) { _, which ->
selectedIndex = which

View file

@ -182,17 +182,21 @@ OS Version: $CODENAME $RELEASE ($SDK_INT)
val dialogView = layoutInflater.inflate(R.layout.dialog_user_agent, null)
val editText = dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox)
editText.setText(networkPreferences.defaultUserAgent().get())
val alertDialog = AlertDialog.Builder(this)
val alertDialog = AlertDialog.Builder(this ,R.style.MyPopup)
.setTitle("User Agent")
.setView(dialogView)
.setPositiveButton("OK") { dialog, _ ->
networkPreferences.defaultUserAgent().set(editText.text.toString())
dialog.dismiss()
}
.setNegativeButton("Reset") { dialog, _ ->
.setNeutralButton("Reset") { dialog, _ ->
networkPreferences.defaultUserAgent().set("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0") // Reset to default or empty
editText.setText("")
dialog.dismiss()
}
.setNegativeButton("Cancel") { dialog, _ ->
dialog.dismiss()
}
.create()
alertDialog.show()

View file

@ -79,7 +79,7 @@ class AnimeExtensionPagingSource(
val installedExtensions = installedExtensionsFlow.first().map { it.pkgName }.toSet()
val availableExtensions = availableExtensionsFlow.first().filterNot { it.pkgName in installedExtensions }
val query = searchQuery.first()
val isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: false
val isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: true
val filteredExtensions = if (query.isEmpty()) {
availableExtensions

View file

@ -81,7 +81,7 @@ class MangaExtensionPagingSource(
val installedExtensions = installedExtensionsFlow.first().map { it.pkgName }.toSet()
val availableExtensions = availableExtensionsFlow.first().filterNot { it.pkgName in installedExtensions }
val query = searchQuery.first()
val isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: false
val isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: true
val filteredExtensions = if (query.isEmpty()) {
availableExtensions
} else {

View file

@ -33,6 +33,7 @@
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/extensions"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginStart="32dp"

View file

@ -6,11 +6,6 @@
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/userAgentTextBox"
android:layout_width="match_parent"
@ -23,5 +18,4 @@
app:boxCornerRadiusTopStart="8dp"
app:hintAnimationEnabled="true" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View file

@ -248,8 +248,8 @@
android:valueTo="10"
app:labelBehavior="gone"
app:thumbElevation="0dp"
app:trackColorInactive="?attr/colorOnSecondary"
app:trackColorActive="?attr/colorSecondary"
app:trackColorInactive="?attr/colorOnPrimary"
app:trackColorActive="?attr/colorPrimary"
app:trackHeight="24dp" />
<ImageView
@ -291,8 +291,8 @@
android:valueTo="10"
app:labelBehavior="gone"
app:thumbElevation="0dp"
app:trackColorInactive="?attr/colorOnSecondary"
app:trackColorActive="?attr/colorSecondary"
app:trackColorInactive="?attr/colorOnPrimary"
app:trackColorActive="?attr/colorPrimary"
app:trackHeight="24dp" />
<ImageView

View file

@ -17,7 +17,7 @@
android:fontFamily="@font/poppins_bold"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="?attr/colorPrimary"
android:textColor="@color/fg"
tools:text="Episode 2 will be released in" />
<TextView

View file

@ -305,7 +305,7 @@
<color name="md_theme_light_5_outlineVariant">#00FF00</color>
<color name="md_theme_light_5_scrim">#00FF00</color>
<color name="md_theme_dark_5_primary">#FF5DAE</color> <!-- good -->
<color name="md_theme_dark_5_onPrimary">#EEEEEE</color> <!-- good but shared with anime and manga list headers -->
<color name="md_theme_dark_5_onPrimary">#610046</color> <!-- good but shared with anime and manga list headers -->
<color name="md_theme_dark_5_primaryContainer">#EEEEEE</color> <!-- good-ish, it's shared with slider colors so I've had to set it to "#EEEEEE" instead of "#928F98" -->
<color name="md_theme_dark_5_onPrimaryContainer">#FF5DAE</color> <!-- good (login button text, "#000000" also works) -->
<color name="md_theme_dark_5_secondary">#91A6FF</color> <!-- good -->
@ -320,7 +320,7 @@
<color name="md_theme_dark_5_errorContainer">#00FF00</color>
<color name="md_theme_dark_5_onError">#00FF00</color>
<color name="md_theme_dark_5_onErrorContainer">#00FF00</color>
<color name="md_theme_dark_5_background">#000000</color> <!-- good -->
<color name="md_theme_dark_5_background">#191C1E</color> <!-- good -->
<color name="md_theme_dark_5_onBackground">#EEEEEE</color> <!-- good -->
<color name="md_theme_dark_5_surface">#1C1B20</color> <!-- good -->
<color name="md_theme_dark_5_onSurface">#EEEEEE</color> <!-- good -->

View file

@ -49,8 +49,16 @@
<item name="shapeAppearance">@style/ShapeAppearance.MaterialComponents.Tooltip</item>
</style>
<style name="MyPopup" parent="@style/Widget.MaterialComponents.PopupMenu">
<item name="android:popupBackground">?android:colorBackground</item>
<style name="MyPopup" parent="">
<item name="android:fontFamily">@font/poppins</item>
<item name="android:textColor">?attr/colorOnBackground</item>
<item name="android:popupBackground">?attr/colorSurface</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:windowBackground">@drawable/shape_corner_16dp</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
<style name="BottomNavBar" parent="">