Procházet zdrojové kódy

crash — xml file: app:srcCompact instead of android:src to define your image,避免个别手机加载图片崩溃

liujiyuan před 5 roky
rodič
revize
b5dbc9bab9

+ 2 - 2
src/main/res/layout-land/activity_login_a.xml

@@ -36,7 +36,7 @@
             <ImageButton
                     android:id="@+id/btn_loginA_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -48,7 +48,7 @@
 
             <ImageView
                     android:id="@+id/iv_loginA_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="117dp"

+ 2 - 2
src/main/res/layout-land/activity_login_b.xml

@@ -45,7 +45,7 @@
             <ImageButton
                     android:id="@+id/btn_loginB_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -57,7 +57,7 @@
 
             <ImageView
                     android:id="@+id/iv_loginB_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="117dp"

+ 2 - 2
src/main/res/layout-land/activity_register_a.xml

@@ -36,7 +36,7 @@
             <ImageButton
                     android:id="@+id/btn_registerA_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -48,7 +48,7 @@
 
             <ImageView
                     android:id="@+id/iv_registerA_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="117dp"

+ 2 - 2
src/main/res/layout-land/activity_register_b.xml

@@ -45,7 +45,7 @@
             <ImageButton
                     android:id="@+id/btn_registerB_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -57,7 +57,7 @@
 
             <ImageView
                     android:id="@+id/iv_registerB_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="117dp"

+ 1 - 1
src/main/res/layout/activity_bind_account.xml

@@ -44,7 +44,7 @@
             <ImageButton
                     android:id="@+id/btn_bindAccount_back"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_arrow_back_blue_24dp"
+                    app:srcCompat="@drawable/ic_arrow_back_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"

+ 2 - 2
src/main/res/layout/activity_login_a.xml

@@ -45,7 +45,7 @@
             <ImageButton
                     android:id="@+id/btn_loginA_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -57,7 +57,7 @@
 
             <ImageView
                     android:id="@+id/iv_loginA_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="116dp"

+ 2 - 2
src/main/res/layout/activity_login_b.xml

@@ -45,7 +45,7 @@
             <ImageButton
                     android:id="@+id/btn_loginB_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -57,7 +57,7 @@
 
             <ImageView
                     android:id="@+id/iv_loginB_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="116dp"

+ 2 - 2
src/main/res/layout/activity_register_a.xml

@@ -45,7 +45,7 @@
             <ImageButton
                     android:id="@+id/btn_registerA_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"
@@ -57,7 +57,7 @@
 
             <ImageView
                     android:id="@+id/iv_registerA_kdanCloud"
-                    android:src="@drawable/kdancloud"
+                    app:srcCompat="@drawable/kdancloud"
                     android:scaleType="centerCrop"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="116dp"

+ 1 - 1
src/main/res/layout/activity_register_b.xml

@@ -45,7 +45,7 @@
             <ImageButton
                     android:id="@+id/btn_registerB_close"
                     android:background="?android:attr/selectableItemBackground"
-                    android:src="@drawable/ic_close_blue_24dp"
+                    app:srcCompat="@drawable/ic_close_blue_24dp"
                     android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
                     android:layout_width="48dp"
                     android:layout_height="48dp"

+ 1 - 1
src/main/res/layout/btn_email_login_register.xml

@@ -9,7 +9,7 @@
 
     <ImageView
             android:id="@+id/iv_emailLoginRegisterBtn_ic"
-            android:src="@drawable/btn_icon_mail"
+            app:srcCompat="@drawable/btn_icon_mail"
             android:scaleType="center"
             android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
             android:layout_width="40dp"

+ 1 - 1
src/main/res/layout/btn_facebook_login_register.xml

@@ -9,7 +9,7 @@
 
     <ImageView
             android:id="@+id/iv_facebookLoginRegisterBtn_ic"
-            android:src="@drawable/btn_icon_fb"
+            app:srcCompat="@drawable/btn_icon_fb"
             android:scaleType="centerCrop"
             android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
             android:layout_width="0dp"

+ 1 - 1
src/main/res/layout/btn_google_login_register.xml

@@ -9,7 +9,7 @@
 
     <ImageView
             android:id="@+id/iv_googleLoginRegisterBtn_ic"
-            android:src="@drawable/btn_icon_google"
+            app:srcCompat="@drawable/btn_icon_google"
             android:scaleType="centerCrop"
             android:contentDescription="@string/kdanlrui_emptyImageContextDescription"
             android:layout_width="0dp"