From f308aff824a124e2dfbe890022d1a0ca2443754a Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 17 Feb 2019 22:09:09 +0200 Subject: [PATCH] use colors by reference (makes the theme-aware) and reduce redundant colors --- .../drawable-anydpi-v21/dashed_border_1dp.xml | 4 +- .../drawable-anydpi-v21/dashed_border_8dp.xml | 4 +- .../ic_app_icon_dynamic.xml | 86 +++++++++++++++++++ .../ic_assignment_black_24dp.xml | 2 +- .../ic_event_note_black_24dp.xml | 2 +- .../ic_home_black_24dp.xml | 2 +- .../ic_settings_black_24dp.xml | 2 +- .../ic_view_list_black_24dp.xml | 2 +- .../res/drawable-anydpi-v21/list_divider.xml | 2 +- .../res/drawable-anydpi-v21/side_nav_bar.xml | 9 +- app/src/main/res/layout/activity_main.xml | 6 +- .../res/layout/activity_new_transaction.xml | 2 +- .../res/layout/activity_profile_detail.xml | 2 +- app/src/main/res/layout/crash_dialog.xml | 2 +- app/src/main/res/layout/nav_header_logo.xml | 3 +- app/src/main/res/layout/no_profiles.xml | 8 +- .../main/res/layout/transaction_list_row.xml | 8 +- app/src/main/res/values/attr.xml | 8 ++ 18 files changed, 125 insertions(+), 29 deletions(-) create mode 100644 app/src/main/res/drawable-anydpi-v21/ic_app_icon_dynamic.xml create mode 100644 app/src/main/res/values/attr.xml diff --git a/app/src/main/res/drawable-anydpi-v21/dashed_border_1dp.xml b/app/src/main/res/drawable-anydpi-v21/dashed_border_1dp.xml index f90b3212..c9e5e96c 100644 --- a/app/src/main/res/drawable-anydpi-v21/dashed_border_1dp.xml +++ b/app/src/main/res/drawable-anydpi-v21/dashed_border_1dp.xml @@ -18,10 +18,10 @@ + android:tint="?colorAccent"> diff --git a/app/src/main/res/drawable-anydpi-v21/dashed_border_8dp.xml b/app/src/main/res/drawable-anydpi-v21/dashed_border_8dp.xml index b66a7e58..884aed26 100644 --- a/app/src/main/res/drawable-anydpi-v21/dashed_border_8dp.xml +++ b/app/src/main/res/drawable-anydpi-v21/dashed_border_8dp.xml @@ -18,10 +18,10 @@ + android:tint="?colorAccent"> diff --git a/app/src/main/res/drawable-anydpi-v21/ic_app_icon_dynamic.xml b/app/src/main/res/drawable-anydpi-v21/ic_app_icon_dynamic.xml new file mode 100644 index 00000000..e99168ba --- /dev/null +++ b/app/src/main/res/drawable-anydpi-v21/ic_app_icon_dynamic.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable-anydpi-v21/ic_assignment_black_24dp.xml b/app/src/main/res/drawable-anydpi-v21/ic_assignment_black_24dp.xml index abe90bc9..90086221 100644 --- a/app/src/main/res/drawable-anydpi-v21/ic_assignment_black_24dp.xml +++ b/app/src/main/res/drawable-anydpi-v21/ic_assignment_black_24dp.xml @@ -17,7 +17,7 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable-anydpi-v21/side_nav_bar.xml b/app/src/main/res/drawable-anydpi-v21/side_nav_bar.xml index 28959b95..c141e312 100644 --- a/app/src/main/res/drawable-anydpi-v21/side_nav_bar.xml +++ b/app/src/main/res/drawable-anydpi-v21/side_nav_bar.xml @@ -17,10 +17,7 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index a1782e14..9c0fb62b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -27,7 +27,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="@color/colorPrimary" + android:background="?colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> @@ -138,7 +138,7 @@ android:layout_weight="1" android:indeterminate="true" android:padding="0dp" - android:progressTint="@color/colorPrimary" + android:progressTint="?colorPrimary" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> diff --git a/app/src/main/res/layout/activity_new_transaction.xml b/app/src/main/res/layout/activity_new_transaction.xml index 0cea5a59..b17bc1f7 100644 --- a/app/src/main/res/layout/activity_new_transaction.xml +++ b/app/src/main/res/layout/activity_new_transaction.xml @@ -60,7 +60,7 @@ android:padding="@dimen/fab_margin" android:tint="@android:color/white" android:visibility="gone" - app:backgroundTint="@color/colorPrimary" + app:backgroundTint="?colorPrimary" app:layout_constraintBottom_toBottomOf="@id/save_transaction_progress" app:layout_constraintEnd_toEndOf="@id/save_transaction_progress" app:layout_constraintStart_toStartOf="@id/save_transaction_progress" diff --git a/app/src/main/res/layout/activity_profile_detail.xml b/app/src/main/res/layout/activity_profile_detail.xml index 71376b93..bc5bf973 100644 --- a/app/src/main/res/layout/activity_profile_detail.xml +++ b/app/src/main/res/layout/activity_profile_detail.xml @@ -64,7 +64,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical|start" android:layout_margin="@dimen/fab_margin" - app:backgroundTint="@color/colorAccent" + app:backgroundTint="?colorAccent" app:layout_anchor="@+id/profile_detail_container" app:layout_anchorGravity="top|end" app:srcCompat="@drawable/ic_save_white_24dp" /> diff --git a/app/src/main/res/layout/crash_dialog.xml b/app/src/main/res/layout/crash_dialog.xml index 61a0e70c..2b1bcbfc 100644 --- a/app/src/main/res/layout/crash_dialog.xml +++ b/app/src/main/res/layout/crash_dialog.xml @@ -13,7 +13,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="9" - android:background="@color/table_row_light_bg" + android:background="?table_row_light_bg" android:scrollbars="horizontal|vertical" android:visibility="gone"> diff --git a/app/src/main/res/layout/nav_header_logo.xml b/app/src/main/res/layout/nav_header_logo.xml index 0e24314c..32ddb62f 100644 --- a/app/src/main/res/layout/nav_header_logo.xml +++ b/app/src/main/res/layout/nav_header_logo.xml @@ -22,5 +22,6 @@ android:layout_height="48dp" android:contentDescription="@string/nav_header_desc" android:visibility="visible" - app:srcCompat="@drawable/ic_app_icon" + android:id="@+id/app_icon" + app:srcCompat="@drawable/ic_app_icon_dynamic" tools:showIn="@layout/activity_main" /> \ No newline at end of file diff --git a/app/src/main/res/layout/no_profiles.xml b/app/src/main/res/layout/no_profiles.xml index 7be27685..ddced2ec 100644 --- a/app/src/main/res/layout/no_profiles.xml +++ b/app/src/main/res/layout/no_profiles.xml @@ -21,8 +21,8 @@ android:id="@+id/no_profiles_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/colorPrimaryDark" - tools:showIn="@layout/activity_main"> + android:background="?table_row_dark_bg" + > @@ -44,6 +45,7 @@ android:layout_marginEnd="8dp" android:text="@string/text_welcome_profile_needed" android:textSize="20sp" + android:textColor="?textColor" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView" /> @@ -56,7 +58,7 @@ android:layout_marginTop="24dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" - android:backgroundTint="@color/colorPrimary" + android:backgroundTint="?colorAccent" android:drawablePadding="16dp" android:text="@string/create_profile_label" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/layout/transaction_list_row.xml b/app/src/main/res/layout/transaction_list_row.xml index 16bab069..05128852 100644 --- a/app/src/main/res/layout/transaction_list_row.xml +++ b/app/src/main/res/layout/transaction_list_row.xml @@ -71,6 +71,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/dashed_border_1dp" + android:alpha="0.3" android:minHeight="2dp" android:orientation="horizontal" app:layout_constraintEnd_toEndOf="parent" @@ -157,7 +158,7 @@ android:id="@+id/transaction_delimiter_month" android:layout_width="wrap_content" android:layout_height="match_parent" - android:background="@color/colorPrimary" + android:background="?colorPrimary" android:paddingStart="4dp" android:paddingEnd="4dp" android:text="---------" @@ -170,7 +171,7 @@ android:id="@+id/transaction_delimiter_date" android:layout_width="wrap_content" android:layout_height="match_parent" - android:background="@color/colorPrimary" + android:background="?colorPrimary" android:paddingStart="4dp" android:paddingEnd="4dp" android:text="--.--.----" @@ -186,6 +187,7 @@ android:layout_marginStart="8dp" android:layout_marginEnd="8dp" android:background="@drawable/dashed_border_1dp" + android:alpha="0.3" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/transaction_delimiter_date" app:layout_constraintStart_toEndOf="@id/transaction_delimiter_month" @@ -195,7 +197,7 @@ android:id="@+id/transaction_delimiter_thick" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/colorPrimary" + android:background="?colorPrimary" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/transaction_delimiter_date" app:layout_constraintStart_toEndOf="@id/transaction_delimiter_month" diff --git a/app/src/main/res/values/attr.xml b/app/src/main/res/values/attr.xml new file mode 100644 index 00000000..f2032412 --- /dev/null +++ b/app/src/main/res/values/attr.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file -- 2.39.5