Use compat library to load drawables (#33)

This commit is contained in:
Jean-Baptiste 2024-03-30 11:07:44 +01:00 committed by jacques
parent 2fb0192c81
commit 1a3b245c0f
18 changed files with 124 additions and 104 deletions

View file

@ -48,7 +48,7 @@
android:cropToPadding="false" android:cropToPadding="false"
android:foregroundTint="@android:color/darker_gray" android:foregroundTint="@android:color/darker_gray"
android:onClick="onCancel" android:onClick="onCancel"
android:src="@drawable/ic_cancel_black_24dp" /> app:srcCompat="@drawable/ic_cancel_black_24dp" />
<ImageButton <ImageButton
android:id="@+id/keyboard_button" android:id="@+id/keyboard_button"
@ -59,7 +59,7 @@
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:contentDescription="@string/button_keyboard" android:contentDescription="@string/button_keyboard"
android:onClick="onKeyboard" android:onClick="onKeyboard"
android:src="@drawable/ic_keyboard_black_24dp" app:srcCompat="@drawable/ic_keyboard_black_24dp"
tools:ignore="PrivateResource" /> tools:ignore="PrivateResource" />
</merge> </merge>

View file

@ -29,7 +29,7 @@
android:layout_height="61dp" android:layout_height="61dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:src="@drawable/ic_launcher_foreground" app:srcCompat="@drawable/ic_launcher_foreground"
android:background="@drawable/shadow_bg" android:background="@drawable/shadow_bg"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>

View file

@ -29,7 +29,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:background="@drawable/shadow_bg" android:background="@drawable/shadow_bg"
android:src="@drawable/ic_launcher_foreground" /> app:srcCompat="@drawable/ic_launcher_foreground" />
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@id/msg" android:id="@id/msg"

View file

@ -24,7 +24,7 @@
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:contentDescription="@string/flashlightButton" android:contentDescription="@string/flashlightButton"
android:onClick="switchFlashlight" android:onClick="switchFlashlight"
android:src="@drawable/ic_baseline_highlight_24" /> app:srcCompat="@drawable/ic_baseline_highlight_24" />
</com.journeyapps.barcodescanner.DecoratedBarcodeView> </com.journeyapps.barcodescanner.DecoratedBarcodeView>
</RelativeLayout> </RelativeLayout>

View file

@ -45,7 +45,7 @@
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:accessibilityHeading="true" android:accessibilityHeading="true"
android:contentDescription="@string/add_button" android:contentDescription="@string/add_button"
android:src="@drawable/ic_add" app:srcCompat="@drawable/ic_add"
app:backgroundTint="@color/colorPrimary" app:backgroundTint="@color/colorPrimary"
app:tint="@color/white"/> app:tint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="80dp" android:layout_height="80dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- Drug's name--> <!-- Drug's name-->
@ -17,7 +19,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:contentDescription="@string/stockIcon" android:contentDescription="@string/stockIcon"
android:src="@drawable/ok_stock_vect" /> app:srcCompat="@drawable/ok_stock_vect" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/value" android:id="@+id/value"
@ -59,6 +61,6 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="10sp" android:layout_marginEnd="10sp"
android:contentDescription="@string/detail_view" android:contentDescription="@string/detail_view"
android:src="@drawable/ic_navigate_next_black_24dp" /> app:srcCompat="@drawable/ic_navigate_next_black_24dp" />
</RelativeLayout> </RelativeLayout>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen1" android:background="@color/bg_screen1"
android:gravity="center" android:gravity="center"
@ -13,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/pilldroid_icon" android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" /> app:srcCompat="@drawable/pilldroid_icon" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen5" android:background="@color/bg_screen5"
android:gravity="center" android:gravity="center"
@ -11,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/suspended_treatment_icon" android:contentDescription="@string/suspended_treatment_icon"
android:src="@drawable/ic_suspended_pill" /> app:srcCompat="@drawable/ic_suspended_pill" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen3" android:background="@color/bg_screen3"
android:gravity="center" android:gravity="center"
@ -11,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/save_icon" android:contentDescription="@string/save_icon"
android:src="@drawable/ic_save_black_24dp" /> app:srcCompat="@drawable/ic_save_black_24dp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_centerInParent="true" android:layout_centerInParent="true"
@ -11,7 +12,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/pilldroid_icon" android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" /> app:srcCompat="@drawable/pilldroid_icon" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen2" android:background="@color/bg_screen2"
android:gravity="center" android:gravity="center"
@ -11,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/the_plus_icon" android:contentDescription="@string/the_plus_icon"
android:src="@drawable/ic_add_circle_black_24dp" /> app:srcCompat="@drawable/ic_add_circle_black_24dp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen3" android:background="@color/bg_screen3"
android:gravity="center" android:gravity="center"
@ -11,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/barcode_icon" android:contentDescription="@string/barcode_icon"
android:src="@drawable/ic_barcode" /> app:srcCompat="@drawable/ic_barcode" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/bg_screen4" android:background="@color/bg_screen4"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -10,7 +12,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/qr_code_icon" android:contentDescription="@string/qr_code_icon"
android:src="@drawable/ic_qr_code" /> app:srcCompat="@drawable/ic_qr_code" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen3" android:background="@color/bg_screen3"
android:gravity="center" android:gravity="center"
@ -13,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/happy_face" android:contentDescription="@string/happy_face"
android:src="@drawable/ok_stock_vect" /> app:srcCompat="@drawable/ok_stock_vect" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen2" android:background="@color/bg_screen2"
android:gravity="center" android:gravity="center"
@ -12,7 +13,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/neutral_face" android:contentDescription="@string/neutral_face"
android:src="@drawable/warning_stock_vect" /> app:srcCompat="@drawable/warning_stock_vect" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/bg_screen4" android:background="@color/bg_screen4"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -10,7 +12,7 @@
android:layout_width="@dimen/img_width_height" android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height" android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/unhappy_face" android:contentDescription="@string/unhappy_face"
android:src="@drawable/lower_stock_vect" /> app:srcCompat="@drawable/lower_stock_vect" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="349dp" android:layout_width="349dp"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen1" android:background="@color/bg_screen1"
android:gravity="center" android:gravity="center"
@ -11,7 +13,7 @@
android:layout_width="@dimen/screen_shot_height" android:layout_width="@dimen/screen_shot_height"
android:layout_height="@dimen/screen_shot_height" android:layout_height="@dimen/screen_shot_height"
android:contentDescription="@string/drug_info" android:contentDescription="@string/drug_info"
android:src="@drawable/info" /> app:srcCompat="@drawable/info" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen2" android:background="@color/bg_screen2"
android:gravity="center" android:gravity="center"
@ -11,7 +13,7 @@
android:layout_width="@dimen/screen_shot_height" android:layout_width="@dimen/screen_shot_height"
android:layout_height="@dimen/screen_shot_height" android:layout_height="@dimen/screen_shot_height"
android:contentDescription="@string/tunable" android:contentDescription="@string/tunable"
android:src="@drawable/tunable" /> app:srcCompat="@drawable/tunable" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"