chore: lint performance optimization

This includes shadowed variables, unnecessary parameters, layouts with string literals, items that cause performance bottlenecks, and the merge of extension types into only the necessary separate classes.
This commit is contained in:
TwistedUmbrellaX 2024-03-14 09:23:30 -04:00
parent 958aa634b1
commit 37ec165319
111 changed files with 1561 additions and 2091 deletions

View file

@ -452,7 +452,7 @@
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="Auto Hide Time Stamps"
android:text="@string/auto_hide_time_stamps"
android:textAlignment="viewStart"
android:textColor="@color/bg_opp"
app:cornerRadius="0dp"
@ -1175,7 +1175,7 @@
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="Show Rotate Button"
android:text="@string/show_rotate_button"
android:textAlignment="viewStart"
android:textColor="@color/bg_opp"
app:cornerRadius="0dp"

View file

@ -86,7 +86,7 @@
android:gravity="center_vertical"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="Default Manga Settings"
android:text="@string/default_manga_settings"
android:textColor="?attr/colorSecondary"
app:drawableEndCompat="@drawable/ic_round_arrow_drop_down_24"
tools:ignore="TextContrastCheck" />
@ -1134,7 +1134,7 @@
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="Use Dark Theme"
android:text="@string/use_dark_theme"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
@ -1155,7 +1155,7 @@
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="Use OLED Theme"
android:text="@string/use_oled_theme"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"

View file

@ -504,7 +504,7 @@
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
android:minHeight="64dp"
android:text="Use Dark Theme"
android:text="@string/use_dark_theme"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
@ -523,7 +523,7 @@
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
android:minHeight="64dp"
android:text="Use OLED Theme"
android:text="@string/use_oled_theme"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"

View file

@ -1,6 +1,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:theme="@style/Theme.Dantotsu.AppWidgetContainer">
<ImageView
@ -8,7 +9,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/gradient_background" />
android:src="@drawable/gradient_background"
tools:ignore="ContentDescription"/>
<RelativeLayout
android:id="@+id/widgetContainer"
@ -23,7 +25,8 @@
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:foregroundGravity="center_vertical"
android:src="@drawable/ic_dantotsu_round" />
android:src="@drawable/ic_dantotsu_round"
tools:ignore="ContentDescription"/>
<TextView
android:id="@+id/widgetTitle"
@ -34,7 +37,7 @@
android:layout_marginStart="0dp"
android:layout_toEndOf="@+id/logoView"
android:gravity="center_vertical"
android:text="Currently Airing"
android:text="@string/currently_airing"
android:textSize="18sp"
android:textStyle="bold" />
@ -44,12 +47,12 @@
android:layout_height="match_parent"
android:layout_below="@id/widgetTitle" />
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
<TextView
android:id="@+id/empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="No shows to display"
android:text="@string/no_shows_to_display"
android:textColor="#ffffff"
android:textSize="20sp"
android:textStyle="bold" />

View file

@ -1,6 +1,7 @@
<!-- custom_dialog_layout.xml -->
<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:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -13,7 +14,7 @@
android:fontFamily="@font/poppins_bold"
android:gravity="center|start"
android:singleLine="true"
android:text="Scanlators"
android:text="@string/scanlators"
android:textColor="?attr/colorOnBackground"
android:textSize="16sp" />
@ -40,7 +41,8 @@
android:layout_marginEnd="5dp"
android:background="@null"
android:src="@drawable/untick_all_boxes"
app:tint="?attr/colorPrimary" />
app:tint="?attr/colorPrimary"
tools:ignore="ContentDescription" />
</FrameLayout>
</LinearLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -12,6 +13,7 @@
android:inputType="number"
android:maxLines="1"
android:maxLength="4"
android:autofillHints="e.g. 1" />
android:autofillHints="e.g. 1"
tools:ignore="LabelFor" />
</LinearLayout>

View file

@ -120,7 +120,7 @@
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="Sort" />
android:text="@string/sort" />
<TextView
android:id="@+id/sortText"
@ -169,7 +169,7 @@
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="Download" />
android:text="@string/download" />
<TextView
android:id="@+id/downloadNo"
@ -215,7 +215,7 @@
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="Scanlator" />
android:text="@string/scanlator" />
<TextView
android:id="@+id/scanlatorNo"
@ -263,13 +263,13 @@
android:layout_height="wrap_content"
android:alpha="0.58"
android:fontFamily="@font/poppins_bold"
android:text="Set Cookies" />
android:text="@string/set_cookies" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:text="Open Website"
android:text="@string/open_website"
android:textColor="?attr/colorSecondary"
tools:ignore="TextContrastCheck" />

View file

@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins"
android:text="Exporting credentials requires a password for encryption."
android:text="@string/exporting_requires_encryption"
android:textSize="18sp"
android:visibility="gone" />

View file

@ -49,7 +49,8 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="horizontal"
android:padding="32dp">
android:padding="32dp"
android:baselineAligned="false">
<FrameLayout
android:layout_width="0dp"

View file

@ -22,12 +22,12 @@
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Anime Queue(WIP)" />
android:text="@string/anime_queue" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Manga Queue(WIP)" />
android:text="@string/manga_queue" />
</com.google.android.material.tabs.TabLayout>
<LinearLayout

View file

@ -130,7 +130,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="No offline manga found"
android:text="@string/no_offline_manga_found"
android:textColor="?attr/colorOnSurface"
android:textSize="18sp"
android:visibility="gone" />

View file

@ -24,7 +24,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:baselineAligned="false">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/animeSearchBar"

View file

@ -103,7 +103,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:baselineAligned="false">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/animeSourceLanguageContainer"
@ -176,10 +177,11 @@
android:ellipsize="marquee"
android:fontFamily="@font/poppins_bold"
android:marqueeRepeatLimit="marquee_forever"
android:paddingLeft="5dp"
android:paddingStart="5dp"
android:singleLine="true"
android:textSize="14sp"
tools:text="Dubbed" />
tools:text="Dubbed"
tools:ignore="RtlSymmetry" />
</LinearLayout>
@ -356,7 +358,7 @@
android:text="@string/source_not_found"
android:textAlignment="center"
android:textSize="16sp"
android:visibility="gone"/>
android:visibility="gone"/>
<Button
android:id="@+id/faqbutton"
@ -375,4 +377,4 @@
</LinearLayout>
</LinearLayout>

View file

@ -41,7 +41,8 @@
android:layout_marginEnd="5dp"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_round_remove_red_eye_24"
app:tint="?attr/colorOnBackground" />
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription"/>
<ImageButton
android:id="@+id/itemDownload"
@ -50,7 +51,8 @@
android:layout_marginEnd="5dp"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_download_24"
app:tint="?attr/colorOnBackground" />
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription"/>
</LinearLayout>
<LinearLayout

View file

@ -1,6 +1,7 @@
<?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/extensionCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -16,14 +17,16 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="-10dp"
android:layout_marginEnd="3dp"
android:src="@drawable/ic_round_equal_24" />
android:src="@drawable/ic_round_equal_24"
tools:ignore="ContentDescription"/>
<ImageView
android:id="@+id/extensionIconImageView"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="3dp" />
android:layout_marginEnd="3dp"
tools:ignore="ContentDescription"/>
<LinearLayout
android:layout_width="245dp"
@ -37,7 +40,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="Extension Name"
android:text="@string/extension_name"
android:textSize="15sp" />
<TextView
@ -45,8 +48,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="version"
android:textSize="10sp" />
android:text="@string/extension_version"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
<ImageView
@ -56,7 +60,8 @@
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:src="@drawable/ic_round_delete_24"
app:tint="?attr/colorOnBackground" />
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription"/>
<ImageView
android:id="@+id/settingsImageView"
@ -66,6 +71,7 @@
android:layout_marginEnd="10dp"
android:layout_weight="0"
android:src="@drawable/ic_round_dots_vertical_24"
app:tint="?attr/colorOnBackground" />
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription"/>
</LinearLayout>

View file

@ -1,6 +1,7 @@
<?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/extensionCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -13,7 +14,8 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="3dp" />
android:layout_marginEnd="3dp"
tools:ignore="ContentDescription"/>
<LinearLayout
android:layout_width="0dp"
@ -27,7 +29,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="Extension Name"
android:text="@string/extension_name"
android:textSize="15sp" />
<TextView
@ -35,8 +37,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:text="version"
android:textSize="10sp" />
android:text="@string/extension_version"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
<ImageView
@ -46,5 +49,6 @@
android:layout_gravity="center_vertical"
android:src="@drawable/ic_download_24"
android:textSize="14sp"
app:tint="?attr/colorOnBackground" />
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription"/>
</LinearLayout>

View file

@ -25,7 +25,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:baselineAligned="false">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mangaSearchBar"