Quellcode durchsuchen

Fixed lint warnings

sirekanian vor 3 Jahren
Ursprung
Commit
ac06edff3e

+ 10 - 15
app/src/main/AndroidManifest.xml

@@ -9,17 +9,19 @@
     <application
         android:name=".App"
         android:allowBackup="false"
+        android:dataExtractionRules="@xml/data_extraction_rules"
+        android:fullBackupContent="false"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/common.title.app"
         android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
         android:theme="@style/Theme.Knigopis"
-        tools:ignore="GoogleAppIndexingWarning">
+        tools:ignore="GoogleAppIndexingWarning"
+        tools:targetApi="31">
 
         <activity
             android:name=".feature.MainActivity"
             android:exported="true"
-            android:label="@string/common.title.app"
             android:launchMode="singleTop"
             android:theme="@style/Theme.Knigopis.Splash">
             <intent-filter>
@@ -32,18 +34,10 @@
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
 
-                <data
-                    android:host="www.knigopis.com"
-                    android:scheme="http" />
-                <data
-                    android:host="www.knigopis.com"
-                    android:scheme="https" />
-                <data
-                    android:host="knigopis.com"
-                    android:scheme="http" />
-                <data
-                    android:host="knigopis.com"
-                    android:scheme="https" />
+                <data android:scheme="http" />
+                <data android:scheme="https" />
+                <data android:host="knigopis.com" />
+                <data android:host="www.knigopis.com" />
             </intent-filter>
         </activity>
 
@@ -56,7 +50,8 @@
         <activity
             android:name=".feature.profile.ProfileActivity"
             android:screenOrientation="portrait"
-            android:theme="@style/Theme.Knigopis.Profile" />
+            android:theme="@style/Theme.Knigopis.Profile"
+            tools:ignore="LockedOrientationActivity" />
 
         <activity
             android:name=".feature.login.LoginActivity"

+ 2 - 2
app/src/main/java/com/sirekanyan/knigopis/repository/config/PropertyDelegate.kt

@@ -8,14 +8,14 @@ import kotlin.reflect.KProperty
 
 class PreferenceDelegate<T>(
     private val load: SharedPreferences.(key: String) -> T,
-    private val save: Editor.(key: String, value: T) -> Editor
+    private val save: Editor.(key: String, value: T) -> Unit,
 ) {
 
     operator fun getValue(config: ConfigurationImpl, prop: KProperty<*>): T =
         config.prefs.load(prop.name)
 
     operator fun setValue(config: ConfigurationImpl, prop: KProperty<*>, value: T) =
-        config.prefs.edit().save(prop.name, value).apply()
+        config.prefs.edit().also { it.save(prop.name, value) }.apply()
 
 }
 

+ 2 - 1
app/src/main/res/layout/books_page.xml

@@ -34,6 +34,7 @@
         android:layout_gravity="end|bottom"
         android:layout_marginEnd="16dp"
         android:layout_marginBottom="72dp"
-        android:src="@drawable/ic_add" />
+        android:src="@drawable/ic_add"
+        tools:ignore="ContentDescription" />
 
 </FrameLayout>

+ 2 - 1
app/src/main/res/layout/user_activity.xml

@@ -81,6 +81,7 @@
         android:visibility="gone"
         app:backgroundTint="@drawable/subscribe_button_background"
         app:layout_anchor="@id/user_app_bar"
-        app:layout_anchorGravity="bottom|end" />
+        app:layout_anchorGravity="bottom|end"
+        tools:ignore="ContentDescription" />
 
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 16 - 0
app/src/main/res/xml/data_extraction_rules.xml

@@ -0,0 +1,16 @@
+<data-extraction-rules>
+    <cloud-backup>
+        <exclude domain="root" />
+        <exclude domain="file" />
+        <exclude domain="database" />
+        <exclude domain="sharedpref" />
+        <exclude domain="external" />
+    </cloud-backup>
+    <device-transfer>
+        <exclude domain="root" />
+        <exclude domain="file" />
+        <exclude domain="database" />
+        <exclude domain="sharedpref" />
+        <exclude domain="external" />
+    </device-transfer>
+</data-extraction-rules>