diff --git a/app/src/main/java/org/woheller69/weather/widget/WeatherDigitalClockWidget.java b/app/src/main/java/org/woheller69/weather/widget/WeatherDigitalClockWidget.java index 90f7042..63f44a8 100644 --- a/app/src/main/java/org/woheller69/weather/widget/WeatherDigitalClockWidget.java +++ b/app/src/main/java/org/woheller69/weather/widget/WeatherDigitalClockWidget.java @@ -99,7 +99,7 @@ public static void updateView(Context context, AppWidgetManager appWidgetManager SQLiteHelper dbHelper = SQLiteHelper.getInstance(context); SharedPreferences prefManager = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); - + views.setFloat(R.id.widget_background,"setAlpha", (100.0f - prefManager.getInt("pref_WidgetTransparency", 0)) /100.0f); if (prefManager.getBoolean("pref_TimeFormat", true)==TRUE) views.setCharSequence(R.id.textClockTime,"setFormat12Hour","HH:mm"); else diff --git a/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java b/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java index 582e000..256a830 100644 --- a/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java +++ b/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java @@ -183,6 +183,7 @@ public static void updateView(Context context, AppWidgetManager appWidgetManager views.setTextViewText(R.id.widget_max_Temp,StringFormatUtils.formatTemperature(context, weekforecasts.get(0).getMaxTemperature())); views.setTextViewText(R.id.widget_min_Temp,StringFormatUtils.formatTemperature(context, weekforecasts.get(0).getMinTemperature())); views.setTextViewText(R.id.widget_city_name, city.getCityName()); + views.setFloat(R.id.widget_background,"setAlpha", (100.0f - prefManager.getInt("pref_WidgetTransparency", 0)) /100.0f); if (riseTime==zoneseconds*1000 || setTime==zoneseconds*1000) views.setTextViewText(R.id.widget_sunrise_sunset,"\u2600\u25b2 --:--" + " \u25bc --:--"); else { diff --git a/app/src/main/java/org/woheller69/weather/widget/WeatherWidget5day.java b/app/src/main/java/org/woheller69/weather/widget/WeatherWidget5day.java index 2f1b8ab..8897b29 100644 --- a/app/src/main/java/org/woheller69/weather/widget/WeatherWidget5day.java +++ b/app/src/main/java/org/woheller69/weather/widget/WeatherWidget5day.java @@ -7,6 +7,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.widget.RemoteViews; @@ -30,6 +31,8 @@ import static androidx.core.app.JobIntentService.enqueueWork; import static org.woheller69.weather.services.UpdateDataService.SKIP_UPDATE_INTERVAL; +import androidx.preference.PreferenceManager; + public class WeatherWidget5day extends AppWidgetProvider { public void updateAppWidget(Context context, final int appWidgetId) { @@ -49,7 +52,8 @@ public void updateAppWidget(Context context, final int appWidgetId) { public static void updateView(Context context, AppWidgetManager appWidgetManager, RemoteViews views, int appWidgetId, CityToWatch city, List weekforecasts) { - + SharedPreferences prefManager = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); + views.setFloat(R.id.widget_background,"setAlpha", (100.0f - prefManager.getInt("pref_WidgetTransparency", 0)) /100.0f); int cityId=getWidgetCityID(context); SQLiteHelper database = SQLiteHelper.getInstance(context.getApplicationContext()); int zonemilliseconds = database.getCurrentWeatherByCityId(cityId).getTimeZoneSeconds()*1000; diff --git a/app/src/main/res/layout/weather_widget.xml b/app/src/main/res/layout/weather_widget.xml index 0a55b1e..9dcccce 100644 --- a/app/src/main/res/layout/weather_widget.xml +++ b/app/src/main/res/layout/weather_widget.xml @@ -175,7 +175,7 @@ android:layout_marginBottom="5dp" android:paddingTop="4dp" android:text="CityName" - android:textColor="@color/colorPrimaryDark" + android:textColor="@color/lightgrey" android:textSize="18dp" android:textStyle="bold" /> @@ -189,7 +189,7 @@ android:layout_marginEnd="8dp" android:paddingBottom="6dp" android:text="Weather data by Open-Meteo.com" - android:textColor="@color/colorPrimaryDark" + android:textColor="@color/lightgrey" android:textSize="15dp" /> - - + + - - - - - - - - + android:layout_alignTop="@id/widget5day_layout" + android:layout_alignBottom="@id/widget5day_layout" + android:src="@drawable/widget_background" /> - - - - - + + - - - - - - + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + android:orientation="vertical" + android:layout_weight="1"> + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 4bbcf08..9b6d050 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -114,5 +114,6 @@ Aquesta aplicació té llicència GPLv3. Utilitza codi de: m/s kn + Widget transparency diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index c2061a7..20460ad 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -116,6 +116,7 @@ Denne app er licenseret under GPLv3. Den bruger kode fra: m/s kn + Widget gennemsigtighed diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ca0f9b0..c1af1e0 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -117,5 +117,6 @@ Diese App ist unter GPLv3 lizenziert. Sie verwendet Code von: m/s kn + Widget-Transparenz diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e46fee9..62c3f8d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -116,5 +116,6 @@ Esta aplicación tiene licencia GPLv3. Utiliza código de: m/s kn + Transparencia del widget diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 95d7718..1458f5f 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -117,5 +117,6 @@ Cette application est sous licence GPLv3. Il utilise le code de : m/s kn + Transparence des widgets \ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index fd3fd42..1fc6231 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -114,4 +114,5 @@ Questa app è concessa in licenza con GPLv3. Utilizza il codice da: m/s kn + Trasparenza del widget diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index c516d70..fc2692e 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -116,6 +116,7 @@ Deze app is gelicentieerd onder GPLv3. Het gebruikt code van: m/s kn + Widget transparantie diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index c0e007b..8094e88 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -114,5 +114,6 @@ Ta aplikacja jest objęta licencją GPLv3. Wykorzystuje kod z: m/s kn + Widget transparency diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 96c1270..7646414 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -114,4 +114,5 @@ Esta aplicação está licenciada sob GPLv3. Utiliza código de: m/s kn + Transparência do widget \ No newline at end of file diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 93c4da9..b9bfa18 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -114,4 +114,5 @@ Táto aplikácia je licencovaná pod GPLv3. Využíva zdrojové kódy týchto projektov: m/s kn + Widget transparency diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index a1bd18e..4abe37f 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -116,6 +116,7 @@ Denna app är licensierad under GPLv3. Den använder kod från: m/s kn + Widget-transparens diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index d0b4c14..0e9cf86 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -114,4 +114,5 @@ Bu uygulama GPLv3 kapsamında lisanslıdır. Şu kaynaktan gelen kodu kullanır: m/s kn + Widget transparency diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index cacb027..be843a0 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -114,4 +114,5 @@ Ця програма ліцензована згідно з GPLv3. Він використовує код із: m/s kn + Widget transparency diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9a4aa81..2b3605f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -124,4 +124,5 @@ This app is licensed under GPLv3. It uses code from: m/s kn + Widget transparency diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index ada633e..d2327b1 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -76,6 +76,12 @@ android:title="@string/settings_darkmode" android:defaultValue="false" /> +