Use compat library to load drawables (#33)

This commit is contained in:
Jean-Baptiste 2024-03-30 11:07:44 +01:00 committed by GitHub
parent 3e5b0b1c66
commit fc439cc400
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 124 additions and 104 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@color/bg_screen3"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true"
android:background="@color/bg_screen3"
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
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
android:layout_width="wrap_content"

View file

@ -1,5 +1,6 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
@ -11,7 +12,7 @@
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" />
app:srcCompat="@drawable/pilldroid_icon" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"

View file

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@color/bg_screen2"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true"
android:background="@color/bg_screen2"
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
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
android:layout_width="wrap_content"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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