From 7e38445c983264845baacb322eaf272f7911b8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 29 Mar 2021 22:51:48 +0200 Subject: [PATCH 1/3] [Gradle] Update NavLib and Iconics. --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eadc01cc..f0308130 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -120,15 +120,15 @@ dependencies { implementation "eu.szkolny:nachos:0e5dfcaceb" implementation "eu.szkolny.selective-dao:annotation:27f8f3f194" implementation "eu.szkolny:ssl-provider:1.0.0" - implementation "pl.szczodrzynski:navlib:0.7.2" + implementation "pl.szczodrzynski:navlib:0.8.0" implementation "pl.szczodrzynski:numberslidingpicker:2921225f76" implementation "pl.szczodrzynski:recyclertablayout:700f980584" implementation "pl.szczodrzynski:tachyon:551943a6b5" kapt "eu.szkolny.selective-dao:codegen:27f8f3f194" // Iconics & related - implementation "com.mikepenz:iconics-core:5.2.8" - implementation "com.mikepenz:iconics-views:5.2.8" + implementation "com.mikepenz:iconics-core:5.3.0-b01" + implementation "com.mikepenz:iconics-views:5.3.0-b01" implementation "com.mikepenz:community-material-typeface:5.8.55.0-kotlin@aar" implementation "eu.szkolny:szkolny-font:1.3" From ebbb9e49048468de6fc321d8bdb53fcb85dd19f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 29 Mar 2021 22:55:56 +0200 Subject: [PATCH 2/3] [UI] Update UI to maintain icon size consistency. --- .../java/pl/szczodrzynski/edziennik/App.kt | 1 + .../pl/szczodrzynski/edziennik/MainActivity.kt | 2 +- .../attendance/AttendanceFragment_.java | 2 +- .../ui/modules/home/cards/HomeTimetableCard.kt | 6 +++--- .../ui/modules/login/LoginFormFragment.kt | 2 -- .../ui/modules/messages/MessageFragment.kt | 2 +- .../settings/SettingsLicenseActivity.kt | 2 +- .../ui/modules/settings/SettingsUtil.kt | 4 ++-- .../ui/modules/views/AttachmentAdapter.kt | 4 +--- .../WidgetNotificationsProvider.kt | 2 +- .../timetable/WidgetTimetableFactory.java | 2 +- .../timetable/WidgetTimetableProvider.kt | 4 ++-- .../res/layout/attendance_item_day_range.xml | 2 +- .../main/res/layout/attendance_item_month.xml | 2 +- .../res/layout/attendance_item_subject.xml | 2 +- .../main/res/layout/attendance_item_type.xml | 2 +- .../main/res/layout/card_home_timetable.xml | 18 +++++++++--------- .../main/res/layout/dialog_config_grades.xml | 2 +- .../main/res/layout/dialog_event_manual_v2.xml | 4 ++-- .../main/res/layout/grades_item_semester.xml | 4 ++-- app/src/main/res/layout/grades_item_stats.xml | 2 +- .../main/res/layout/grades_item_subject.xml | 2 +- app/src/main/res/layout/lab_item_object.xml | 2 +- .../main/res/layout/lab_item_sub_object.xml | 2 +- .../main/res/layout/login_form_fragment.xml | 2 +- .../main/res/layout/login_platform_item.xml | 2 +- app/src/main/res/layout/message_fragment.xml | 4 ---- app/src/main/res/layout/messages_details.xml | 3 --- .../main/res/layout/row_grades_editor_item.xml | 4 ++-- 29 files changed, 41 insertions(+), 51 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.kt b/app/src/main/java/pl/szczodrzynski/edziennik/App.kt index e64b33cb..25459878 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.kt @@ -165,6 +165,7 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope { .errorActivity(CrashActivity::class.java) .apply() Iconics.init(applicationContext) + Iconics.respectFontBoundsDefault = true // initialize companion object values App.db = AppDb(this) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 951a2cd7..ec31cef7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -505,7 +505,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope { .content(R.string.rate_snackbar_text) .icon(IconicsDrawable(this).apply { icon = CommunityMaterial.Icon3.cmd_star_outline - sizeDp = 20 + sizeDp = 24 colorInt = Themes.getPrimaryTextColor(this@MainActivity) }) .positiveText(R.string.rate_snackbar_positive) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment_.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment_.java index c46b3e09..01ec7f36 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment_.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment_.java @@ -127,7 +127,7 @@ public class AttendanceFragment_ extends Fragment { CafeBar.builder(activity) .to(activity.getNavView().getCoordinator()) .content(R.string.sync_old_data_info) - .icon(new IconicsDrawable(activity).icon(CommunityMaterial.Icon.cmd_download_outline).size(IconicsSize.dp(20)).color(IconicsColor.colorInt(Themes.INSTANCE.getPrimaryTextColor(activity)))) + .icon(new IconicsDrawable(activity).icon(CommunityMaterial.Icon.cmd_download_outline).size(IconicsSize.dp(24)).color(IconicsColor.colorInt(Themes.INSTANCE.getPrimaryTextColor(activity)))) .positiveText(R.string.refresh) .positiveColor(0xff4caf50) .negativeText(R.string.ok) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt index a2e4f9d7..d1a30053 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt @@ -90,21 +90,21 @@ class HomeTimetableCard( b.settings.setImageDrawable( IconicsDrawable(activity, CommunityMaterial.Icon.cmd_cog_outline).apply { colorAttr(activity, R.attr.colorIcon) - sizeDp = 20 + sizeDp = 24 } ) b.bellSync.setImageDrawable( IconicsDrawable(activity, SzkolnyFont.Icon.szf_alarm_bell_outline).apply { colorAttr(activity, R.attr.colorIcon) - sizeDp = 20 + sizeDp = 24 } ) b.showCounter.setImageDrawable( IconicsDrawable(activity, CommunityMaterial.Icon2.cmd_fullscreen).apply { colorAttr(activity, R.attr.colorIcon) - sizeDp = 20 + sizeDp = 24 } ) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt index 9e00200b..ea6bbe4d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt @@ -15,7 +15,6 @@ import androidx.core.widget.addTextChangedListener import androidx.fragment.app.Fragment import com.google.android.material.textfield.TextInputLayout import com.mikepenz.iconics.IconicsDrawable -import com.mikepenz.iconics.utils.paddingDp import com.mikepenz.iconics.utils.sizeDp import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -100,7 +99,6 @@ class LoginFormFragment : Fragment(), CoroutineScope { b.textLayout.startIconDrawable = IconicsDrawable(activity).apply { icon = credential.icon sizeDp = 24 - paddingDp = 2 colorAttr(activity, R.attr.colorOnBackground) } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt index 2fcadf55..30f40c30 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt @@ -67,7 +67,7 @@ class MessageFragment : Fragment(), CoroutineScope { b.closeButton.setImageDrawable( IconicsDrawable(activity, CommunityMaterial.Icon3.cmd_window_close).apply { colorAttr(activity, android.R.attr.textColorSecondary) - sizeDp = 12 + sizeDp = 16 } ) b.closeButton.setOnClickListener { activity.navigateUp() } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt index e0c6be5e..22f21b8d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt @@ -26,7 +26,7 @@ class SettingsLicenseActivity : MaterialAboutActivity() { get() = IconicsDrawable(this).apply { icon = CommunityMaterial.Icon.cmd_book_outline colorInt = foregroundColor - sizeDp = 18 + sizeDp = 24 } override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsUtil.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsUtil.kt index 258f4a17..a86fe2e3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsUtil.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsUtil.kt @@ -25,7 +25,7 @@ class SettingsUtil( fun refresh() = onRefresh() - private fun IIcon.asDrawable(color: Int? = null, size: Int = 20) = + private fun IIcon.asDrawable(color: Int? = null, size: Int = 24) = IconicsDrawable(activity).apply { icon = this@asDrawable sizeDp = size @@ -66,7 +66,7 @@ class SettingsUtil( val moreItem = MaterialAboutActionItem.Builder() .text(R.string.settings_more_text) - .icon(CommunityMaterial.Icon.cmd_chevron_down.asDrawable(iconColor, size = 14)) + .icon(CommunityMaterial.Icon.cmd_chevron_down.asDrawable(iconColor, size = 24)) .build() moreItem.setOnClickAction { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/views/AttachmentAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/views/AttachmentAdapter.kt index 6f8bc4c7..5712207c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/views/AttachmentAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/views/AttachmentAdapter.kt @@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView import com.google.android.material.chip.Chip import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial -import com.mikepenz.iconics.utils.paddingDp import com.mikepenz.iconics.utils.sizeDp import eu.szkolny.font.SzkolnyFont import kotlinx.coroutines.CoroutineScope @@ -85,12 +84,11 @@ class AttachmentAdapter( icon = attachmentIcon colorAttr(context, R.attr.colorOnSurface) sizeDp = 24 - paddingDp = 2 } b.chip.closeIcon = IconicsDrawable(context).apply { icon = CommunityMaterial.Icon.cmd_check colorAttr(context, R.attr.colorOnSurface) - sizeDp = 18 + sizeDp = 24 } b.chip.isCloseIconVisible = item.isDownloaded && !item.isDownloading diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/notifications/WidgetNotificationsProvider.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/notifications/WidgetNotificationsProvider.kt index 3832b6c7..a0bf3b00 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/notifications/WidgetNotificationsProvider.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/notifications/WidgetNotificationsProvider.kt @@ -32,7 +32,7 @@ class WidgetNotificationsProvider : AppWidgetProvider() { for (appWidgetId in appWidgetIds) { val config = widgetConfigs.getJsonObject(appWidgetId.toString())?.let { app.gson.fromJson(it, WidgetConfig::class.java) } ?: continue - val iconSize = if (config.bigStyle) 24 else 16 + val iconSize = if (config.bigStyle) 28 else 20 val views: RemoteViews = if (config.bigStyle) { RemoteViews(app.packageName, if (config.darkTheme) R.layout.widget_notifications_dark_big else R.layout.widget_notifications_big) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableFactory.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableFactory.java index 8a351b1f..369f6783 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableFactory.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableFactory.java @@ -130,7 +130,7 @@ public class WidgetTimetableFactory implements RemoteViewsService.RemoteViewsFac private Bitmap homeIconBitmap() { return new IconicsDrawable(context).apply((drawable) -> { IconicsConvertersKt.setColorRes(drawable, R.color.md_red_500); - IconicsConvertersKt.setSizeDp(drawable, 10); + IconicsConvertersKt.setSizeDp(drawable, 14); IconicsDrawableExtensionsKt.icon(drawable, CommunityMaterial.Icon2.cmd_home); return Unit.INSTANCE; }).toBitmap(); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableProvider.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableProvider.kt index daffae65..6d5badf5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableProvider.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/widgets/timetable/WidgetTimetableProvider.kt @@ -119,7 +119,7 @@ class WidgetTimetableProvider : AppWidgetProvider() { R.id.widgetTimetableRefresh, IconicsDrawable(context, CommunityMaterial.Icon3.cmd_refresh).apply { colorInt = Color.WHITE - sizeDp = if (config.bigStyle) 24 else 16 + sizeDp = if (config.bigStyle) 28 else 20 }.toBitmap() ) @@ -127,7 +127,7 @@ class WidgetTimetableProvider : AppWidgetProvider() { R.id.widgetTimetableSync, IconicsDrawable(context, CommunityMaterial.Icon.cmd_download_outline).apply { colorInt = Color.WHITE - sizeDp = if (config.bigStyle) 24 else 16 + sizeDp = if (config.bigStyle) 28 else 20 }.toBitmap() ) diff --git a/app/src/main/res/layout/attendance_item_day_range.xml b/app/src/main/res/layout/attendance_item_day_range.xml index 4d33192f..da855aac 100644 --- a/app/src/main/res/layout/attendance_item_day_range.xml +++ b/app/src/main/res/layout/attendance_item_day_range.xml @@ -57,7 +57,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-chevron-down" - app:iiv_size="18dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_more" /> diff --git a/app/src/main/res/layout/attendance_item_month.xml b/app/src/main/res/layout/attendance_item_month.xml index 6016a81c..f3dcb13d 100644 --- a/app/src/main/res/layout/attendance_item_month.xml +++ b/app/src/main/res/layout/attendance_item_month.xml @@ -66,7 +66,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-chevron-down" - app:iiv_size="18dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_more" /> diff --git a/app/src/main/res/layout/attendance_item_subject.xml b/app/src/main/res/layout/attendance_item_subject.xml index bcf95152..d1fb9ce8 100644 --- a/app/src/main/res/layout/attendance_item_subject.xml +++ b/app/src/main/res/layout/attendance_item_subject.xml @@ -66,7 +66,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-chevron-down" - app:iiv_size="18dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_more" /> diff --git a/app/src/main/res/layout/attendance_item_type.xml b/app/src/main/res/layout/attendance_item_type.xml index 2ec5cd4e..682660a6 100644 --- a/app/src/main/res/layout/attendance_item_type.xml +++ b/app/src/main/res/layout/attendance_item_type.xml @@ -77,7 +77,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-chevron-down" - app:iiv_size="18dp" + app:iiv_size="24dp" tools:background="@android:drawable/ic_menu_more" /> diff --git a/app/src/main/res/layout/card_home_timetable.xml b/app/src/main/res/layout/card_home_timetable.xml index 88141c86..9b210f7b 100644 --- a/app/src/main/res/layout/card_home_timetable.xml +++ b/app/src/main/res/layout/card_home_timetable.xml @@ -178,27 +178,27 @@ diff --git a/app/src/main/res/layout/dialog_config_grades.xml b/app/src/main/res/layout/dialog_config_grades.xml index 78ce28bb..1e0e9058 100644 --- a/app/src/main/res/layout/dialog_config_grades.xml +++ b/app/src/main/res/layout/dialog_config_grades.xml @@ -132,7 +132,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-help-circle-outline" - app:iiv_size="16dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_help" /> diff --git a/app/src/main/res/layout/dialog_event_manual_v2.xml b/app/src/main/res/layout/dialog_event_manual_v2.xml index b8e12927..8d2fc267 100644 --- a/app/src/main/res/layout/dialog_event_manual_v2.xml +++ b/app/src/main/res/layout/dialog_event_manual_v2.xml @@ -145,11 +145,11 @@ app:iiv_end_icon="cmd-chevron-down" app:iiv_end_color="?android:textColorSecondary" - app:iiv_end_size="16dp" + app:iiv_end_size="24dp" app:iiv_end_checked_icon="cmd-chevron-up" app:iiv_end_checked_color="?android:textColorSecondary" - app:iiv_end_checked_size="16dp"/> + app:iiv_end_checked_size="24dp"/> diff --git a/app/src/main/res/layout/grades_item_stats.xml b/app/src/main/res/layout/grades_item_stats.xml index 765aed8b..8ffeab4f 100644 --- a/app/src/main/res/layout/grades_item_stats.xml +++ b/app/src/main/res/layout/grades_item_stats.xml @@ -167,7 +167,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-help-circle-outline" - app:iiv_size="16dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_help" /> diff --git a/app/src/main/res/layout/lab_item_object.xml b/app/src/main/res/layout/lab_item_object.xml index 76800f1a..0336f65e 100644 --- a/app/src/main/res/layout/lab_item_object.xml +++ b/app/src/main/res/layout/lab_item_object.xml @@ -47,7 +47,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-chevron-down" - app:iiv_size="18dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_more" /> diff --git a/app/src/main/res/layout/lab_item_sub_object.xml b/app/src/main/res/layout/lab_item_sub_object.xml index c0fb2f05..9bd72dca 100644 --- a/app/src/main/res/layout/lab_item_sub_object.xml +++ b/app/src/main/res/layout/lab_item_sub_object.xml @@ -42,7 +42,7 @@ android:scaleType="centerInside" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-chevron-down" - app:iiv_size="18dp" + app:iiv_size="24dp" tools:src="@android:drawable/ic_menu_more" /> diff --git a/app/src/main/res/layout/login_form_fragment.xml b/app/src/main/res/layout/login_form_fragment.xml index ac4afd93..c1026eb7 100644 --- a/app/src/main/res/layout/login_form_fragment.xml +++ b/app/src/main/res/layout/login_form_fragment.xml @@ -106,7 +106,7 @@ android:layout_height="24dp" app:iiv_color="?colorOnError" app:iiv_icon="cmd-alert-circle-outline" - app:iiv_size="20dp" /> + app:iiv_size="24dp" /> + app:iiv_size="40dp" /> diff --git a/app/src/main/res/layout/message_fragment.xml b/app/src/main/res/layout/message_fragment.xml index b368e671..1bae5bb5 100644 --- a/app/src/main/res/layout/message_fragment.xml +++ b/app/src/main/res/layout/message_fragment.xml @@ -204,7 +204,6 @@ android:id="@+id/replyIcon" android:layout_width="24dp" android:layout_height="24dp" - android:padding="4dp" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-reply-outline" tools:srcCompat="@android:drawable/ic_menu_revert" /> @@ -234,7 +233,6 @@ android:id="@+id/forwardIcon" android:layout_width="24dp" android:layout_height="24dp" - android:padding="4dp" app:iiv_color="?android:textColorSecondary" app:iiv_icon="cmd-arrow-right" tools:srcCompat="@android:drawable/ic_media_ff" /> @@ -265,7 +263,6 @@ @@ -295,7 +292,6 @@ diff --git a/app/src/main/res/layout/messages_details.xml b/app/src/main/res/layout/messages_details.xml index 5aa8f319..1da445b8 100644 --- a/app/src/main/res/layout/messages_details.xml +++ b/app/src/main/res/layout/messages_details.xml @@ -288,7 +288,6 @@ @@ -317,7 +316,6 @@ @@ -345,7 +343,6 @@ diff --git a/app/src/main/res/layout/row_grades_editor_item.xml b/app/src/main/res/layout/row_grades_editor_item.xml index 86f5615b..113f1bf3 100644 --- a/app/src/main/res/layout/row_grades_editor_item.xml +++ b/app/src/main/res/layout/row_grades_editor_item.xml @@ -17,7 +17,7 @@ android:layout_height="60dp" android:layout_gravity="center_vertical" android:background="@color/md_red_500" - android:padding="20dp" + android:padding="18dp" app:iiv_color="@color/md_white_1000" app:iiv_icon="cmd-delete" tools:srcCompat="@tools:sample/avatars" /> @@ -27,7 +27,7 @@ android:layout_height="60dp" android:layout_gravity="center_vertical" android:background="@color/md_green_500" - android:padding="20dp" + android:padding="18dp" app:iiv_color="@color/md_white_1000" app:iiv_icon="cmd-pencil" tools:srcCompat="@tools:sample/avatars" /> From 6287f694f4311418fe0ba91382a20022ea51a0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 30 Mar 2021 11:11:17 +0200 Subject: [PATCH 3/3] [UI] Replace dropdown arrow drawable with Iconics. --- .../edziennik/utils/TextInputDropDown.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/TextInputDropDown.kt b/app/src/main/java/pl/szczodrzynski/edziennik/utils/TextInputDropDown.kt index b809f524..f8836374 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/TextInputDropDown.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/TextInputDropDown.kt @@ -3,9 +3,11 @@ package pl.szczodrzynski.edziennik.utils import android.content.Context import android.util.AttributeSet import androidx.appcompat.widget.PopupMenu -import androidx.core.graphics.drawable.DrawableCompat import com.google.android.material.textfield.TextInputEditText -import pl.szczodrzynski.edziennik.R +import com.mikepenz.iconics.IconicsDrawable +import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial +import com.mikepenz.iconics.utils.colorInt +import com.mikepenz.iconics.utils.sizeDp open class TextInputDropDown : TextInputEditText { constructor(context: Context) : super(context) { @@ -32,11 +34,12 @@ open class TextInputDropDown : TextInputEditText { } open fun create(context: Context) { - val drawable = context.resources.getDrawable(R.drawable.dropdown_arrow) - val wrappedDrawable = DrawableCompat.wrap(drawable) - DrawableCompat.setTint(wrappedDrawable, Themes.getPrimaryTextColor(context)) + val drawable = IconicsDrawable(context, CommunityMaterial.Icon.cmd_chevron_down).apply { + colorInt = Themes.getPrimaryTextColor(context) + sizeDp = 24 + } - setCompoundDrawablesWithIntrinsicBounds(null, null, wrappedDrawable, null) + setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) isFocusableInTouchMode = false isCursorVisible = false isLongClickable = false