From 43f085b13ce9c3fa0ac795f607ec377dd38b4009 Mon Sep 17 00:00:00 2001 From: azuo Date: Fri, 3 Sep 2021 20:40:44 +0800 Subject: [PATCH] Remove extra spacing after event time when weather disabled. --- .../tommasoberlose/anotherwidget/helpers/IntentHelper.kt | 2 +- .../tommasoberlose/anotherwidget/helpers/WidgetHelper.kt | 2 +- .../anotherwidget/ui/widgets/AlignedWidget.kt | 8 ++++---- .../anotherwidget/ui/widgets/StandardWidget.kt | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt index 4c4bae0..712d533 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt @@ -53,7 +53,7 @@ object IntentHelper { mapIntent } else { val map = "https://www.google.com/maps/search/?api=1&query=${Uri.encode(address)}" - val i = Intent(Intent.ACTION_VIEW, Uri.parse(map)); + val i = Intent(Intent.ACTION_VIEW, Uri.parse(map)) i } } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WidgetHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WidgetHelper.kt index 4524984..20fd92d 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WidgetHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WidgetHelper.kt @@ -71,7 +71,7 @@ object WidgetHelper { } override fun onTypefaceRequestFailed(reason: Int) { - handlerThread.quit(); + handlerThread.quit() function.invoke(null) } } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/AlignedWidget.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/AlignedWidget.kt index 40f5327..d9ab2d9 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/AlignedWidget.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/AlignedWidget.kt @@ -96,7 +96,7 @@ class AlignedWidget(val context: Context, val rightAligned: Boolean = false) { // Weather if (Preferences.showWeather && Preferences.weatherIcon != "") { views.setViewVisibility(R.id.weather_rect, View.VISIBLE) - views.setViewVisibility(R.id.weather_sub_line, View.GONE) + views.setViewVisibility(R.id.weather_sub_line_rect, View.GONE) val i = Intent(context, WidgetClickListenerReceiver::class.java) i.action = Actions.ACTION_OPEN_WEATHER_INTENT @@ -116,7 +116,7 @@ class AlignedWidget(val context: Context, val rightAligned: Boolean = false) { ) } else { views.setViewVisibility(R.id.weather_rect, View.GONE) - views.setViewVisibility(R.id.weather_sub_line, View.GONE) + views.setViewVisibility(R.id.weather_sub_line_rect, View.GONE) } @@ -233,7 +233,7 @@ class AlignedWidget(val context: Context, val rightAligned: Boolean = false) { views.setViewVisibility(R.id.calendar_layout_rect, View.VISIBLE) views.setViewVisibility(R.id.sub_line_rect, View.VISIBLE) - views.setViewVisibility(R.id.weather_sub_line_rect, View.VISIBLE) + views.setViewVisibility(R.id.weather_sub_line_rect, if (Preferences.showWeather && Preferences.weatherIcon != "") View.VISIBLE else View.GONE) views.setViewVisibility(R.id.first_line_rect, View.GONE) views.setViewVisibility(R.id.sub_line_top_margin_small_sans, View.GONE) @@ -575,7 +575,7 @@ class AlignedWidget(val context: Context, val rightAligned: Boolean = false) { bindingView.dateLayout.isVisible = false bindingView.calendarLayout.isVisible = true bindingView.subLine.isVisible = true - bindingView.weatherSubLine.isVisible = true + bindingView.weatherSubLine.isVisible = Preferences.showWeather && Preferences.weatherIcon != "" bindingView.subLineTopMarginSmall.visibility = View.GONE bindingView.subLineTopMarginMedium.visibility = View.GONE diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/StandardWidget.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/StandardWidget.kt index 9671bc6..78f2d56 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/StandardWidget.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/StandardWidget.kt @@ -99,7 +99,7 @@ class StandardWidget(val context: Context) { // Weather if (Preferences.showWeather && Preferences.weatherIcon != "") { views.setViewVisibility(R.id.weather_rect, View.VISIBLE) - views.setViewVisibility(R.id.weather_sub_line, View.GONE) + views.setViewVisibility(R.id.weather_sub_line_rect, View.GONE) val i = Intent(context, WidgetClickListenerReceiver::class.java) i.action = Actions.ACTION_OPEN_WEATHER_INTENT @@ -119,7 +119,7 @@ class StandardWidget(val context: Context) { ) } else { views.setViewVisibility(R.id.weather_rect, View.GONE) - views.setViewVisibility(R.id.weather_sub_line, View.GONE) + views.setViewVisibility(R.id.weather_sub_line_rect, View.GONE) } @@ -263,7 +263,7 @@ class StandardWidget(val context: Context) { ) views.setViewVisibility(R.id.calendar_layout_rect, View.VISIBLE) views.setViewVisibility(R.id.sub_line_rect, View.VISIBLE) - views.setViewVisibility(R.id.weather_sub_line_rect, View.VISIBLE) + views.setViewVisibility(R.id.weather_sub_line_rect, if (Preferences.showWeather && Preferences.weatherIcon != "") View.VISIBLE else View.GONE) views.setViewVisibility(R.id.first_line_rect, View.GONE) @@ -604,7 +604,7 @@ class StandardWidget(val context: Context) { bindingView.dateLayout.isVisible = false bindingView.calendarLayout.isVisible = true bindingView.subLine.isVisible = true - bindingView.weatherSubLine.isVisible = true + bindingView.weatherSubLine.isVisible = Preferences.showWeather && Preferences.weatherIcon != "" bindingView.subLineTopMarginSmall.visibility = if (Preferences.secondRowTopMargin == Constants.SecondRowTopMargin.SMALL.rawValue) View.VISIBLE else View.GONE