Indicate obsolete extensions (#2494)

* Indicate obsolete extensions

* Make obsolete indicators red

* Move obsolete extensions up the list

* Add base button theme for holder

* Use red button color state instead of explicit text color
This commit is contained in:
arkon
2020-01-12 18:27:04 -05:00
committed by GitHub
parent 6b5742c1ff
commit f3e228e8a4
8 changed files with 87 additions and 15 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true" android:color="@color/md_white_1000">
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="@color/red_error" />
<padding android:left="8dp" android:right="8dp" />
</shape>
</item>
<item android:state_enabled="false" android:color="@color/textColorHintLight">
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="@android:color/transparent" />
<stroke android:width="1dp" android:color="@color/textColorHintLight" />
<padding android:left="8dp" android:right="8dp" />
</shape>
</item>
<item android:color="@color/red_error">
<shape android:color="@color/red_error" android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="@android:color/transparent" />
<stroke android:width="1dp" android:color="@color/red_error" />
<padding android:left="8dp" android:right="8dp" />
</shape>
</item>
</selector>

View File

@@ -60,6 +60,22 @@
app:layout_constraintEnd_toEndOf="parent"
tools:text="eu.kanade.tachiyomi.extension.en.myext"/>
<TextView
android:id="@+id/extension_obsolete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:background="@color/red_error"
android:gravity="center"
android:padding="16dp"
android:text="@string/obsolete_extension_message"
android:textColor="@android:color/white"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/extension_pkg" />
<Button
android:id="@+id/extension_uninstall_button"
android:layout_width="0dp"
@@ -71,7 +87,7 @@
style="@style/Theme.Widget.Button.Colored"
app:layout_constraintStart_toStartOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/extension_pkg" />
app:layout_constraintTop_toBottomOf="@id/extension_obsolete" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/extension_prefs_recycler"

View File

@@ -161,6 +161,7 @@
<string name="all_lang">All</string>
<string name="ext_details">Details</string>
<string name="ext_update">Update</string>
<string name="ext_obsolete">Obsolete</string>
<string name="ext_install">Install</string>
<string name="ext_pending">Pending</string>
<string name="ext_downloading">Downloading</string>
@@ -173,6 +174,7 @@
<string name="ext_available">Available</string>
<string name="untrusted_extension">Untrusted extension</string>
<string name="untrusted_extension_message">This extension was signed with an untrusted certificate and wasn\'t activated.\n\nA malicious extension could read any login credentials stored in Tachiyomi or execute arbitrary code.\n\nBy trusting this certificate you accept these risks.</string>
<string name="obsolete_extension_message">This extension is no longer available.</string>
<string name="ext_version_info">Version: %1$s</string>
<string name="ext_language_info">Language: %1$s</string>
<string name="ext_empty_preferences">No preferences to edit for this extension</string>