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] [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" />