Skip to content

Commit

Permalink
Fix widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonavichus committed Jul 7, 2024
1 parent 6d0d0ef commit 9a7858f
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 32 deletions.
3 changes: 2 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ flutter {
}

dependencies {
implementation("androidx.core:core-remoteviews:1.0.0")
implementation("androidx.core:core-remoteviews:1.1.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.work:work-runtime-ktx:2.9.0")
}

Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/res/layout/oreo_widget_big.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
style="@style/Widget.Android.AppWidget.Container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSecondaryContainer"
android:theme="@style/Theme.Android.AppWidgetContainer"
android:id="@+id/widget_day_oreo">

Expand All @@ -27,7 +28,7 @@
android:shadowRadius="1"
android:textSize="@dimen/widget_large_title_text_size"
tools:ignore="ObsoleteLayoutParam"
tools:text="Saturday, September 30 " />
tools:text="Saturday, September 30 " />

<ImageView
android:id="@+id/widget_day_icon"
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/res/layout/oreo_widget_medium.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
style="@style/Widget.Android.AppWidget.Container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSecondaryContainer"
android:theme="@style/Theme.Android.AppWidgetContainer"
android:id="@+id/widget_day_oreo">

Expand All @@ -27,7 +28,7 @@
android:shadowRadius="1"
android:textSize="@dimen/widget_large_title_text_size"
tools:ignore="ObsoleteLayoutParam"
tools:text="Saturday, September 30 " />
tools:text="Saturday, September 30 " />

<ImageView
android:id="@+id/widget_day_icon"
Expand Down
5 changes: 3 additions & 2 deletions android/app/src/main/res/layout/oreo_widget_mini.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
style="@style/Widget.Android.AppWidget.Container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSecondaryContainer"
android:theme="@style/Theme.Android.AppWidgetContainer"
android:id="@+id/widget_day_oreo">

Expand Down Expand Up @@ -32,8 +33,8 @@
android:shadowRadius="1"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textSize="@dimen/widget_title_text_size"
tools:text="21°"
tools:ignore="ObsoleteLayoutParam" />
tools:ignore="ObsoleteLayoutParam"
tools:text="21°" />

</LinearLayout>

Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/layout/oreo_widget_small.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
style="@style/Widget.Android.AppWidget.Container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSecondaryContainer"
android:theme="@style/Theme.Android.AppWidgetContainer"
android:id="@+id/widget_day_oreo">

Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/res/values-night-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="LaunchTheme" parent="@style/Theme.Material3.DynamicColors.Dark.NoActionBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
Expand All @@ -14,7 +14,7 @@
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="NormalTheme" parent="@style/Theme.Material3.DynamicColors.Dark.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values-night-v31/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
Having themes.xml for night-v31 because of the priority order of the resource qualifiers.
-->
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight">
<style name="Theme.Android.AppWidgetContainerParent" parent="@style/Theme.Material3.DynamicColors.DayNight">
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
</style>
Expand Down
12 changes: 6 additions & 6 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="LaunchTheme" parent="@style/Theme.Material3.DynamicColors.Dark.NoActionBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowDrawsSystemBarBackgrounds" >false</item>
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="NormalTheme" parent="@style/Theme.Material3.DynamicColors.Dark.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
4 changes: 2 additions & 2 deletions android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<style name="LaunchTheme" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
Expand All @@ -14,7 +14,7 @@
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<style name="NormalTheme" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values-v31/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and @android:dimen/system_app_widget_internal_padding requires API level 31
-->
<style name="Theme.Android.AppWidgetContainerParent"
parent="@android:style/Theme.DeviceDefault.DayNight">
parent="@style/Theme.Material3.DynamicColors.DayNight">
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
</style>
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_widget_description">Oreo Widget</string>
<string name="app_widget_description">Rain Widget</string>
<string name="date_format_widget_oreo_style">EEE, d MMM │</string>
<string name="date_format_widget_oreo_big_style">EEEE, d MMM │</string>
</resources>
14 changes: 7 additions & 7 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode
setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<style name="LaunchTheme" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<style name="NormalTheme" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
<item name="android:id">@android:id/background</item>
<item name="android:background">?android:attr/colorBackground</item>
<item name="android:background">?attr/colorSurface</item>
</style>
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
<item name="android:background">?android:attr/colorBackground</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:background">?attr/colorSurface</item>
<item name="android:textColor">?attr/itemTextColor</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault">
<style name="Theme.Android.AppWidgetContainerParent" parent="@style/Theme.Material3.DynamicColors.DayNight">
<!-- Radius of the outer bound of widgets to make the rounded corners -->
<item name="appWidgetRadius">16dp</item>
<!--
Expand Down
2 changes: 1 addition & 1 deletion lib/app/modules/cards/view/info_weather_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class _InfoWeatherCardState extends State<InfoWeatherCard> {
),
decoration: BoxDecoration(
color: i == timeNow
? context.theme.colorScheme.primaryContainer
? context.theme.colorScheme.secondaryContainer
: Colors.transparent,
borderRadius: const BorderRadius.all(
Radius.circular(20),
Expand Down
2 changes: 1 addition & 1 deletion lib/app/modules/main/view/weather.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class _WeatherPageState extends State<WeatherPage> {
),
decoration: BoxDecoration(
color: i == hourOfDay
? context.theme.colorScheme.primaryContainer
? context.theme.colorScheme.secondaryContainer
: Colors.transparent,
borderRadius: const BorderRadius.all(
Radius.circular(20),
Expand Down
2 changes: 1 addition & 1 deletion lib/app/widgets/daily/info_daily_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class _InfoDailyCardState extends State<InfoDailyCard> {
decoration: BoxDecoration(
color: i == hourOfDay
? context.theme.colorScheme
.primaryContainer
.secondaryContainer
: Colors.transparent,
borderRadius: const BorderRadius.all(
Radius.circular(20),
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_native_splash
sha256: edf39bcf4d74aca1eb2c1e43c3e445fd9f494013df7f0da752fefe72020eedc0
sha256: aa06fec78de2190f3db4319dd60fdc8d12b2626e93ef9828633928c2dcaea840
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.4.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies:
time_machine: ^0.9.17
dynamic_color: ^1.7.0
path_provider: ^2.1.3
# quick_settings: ^1.0.1
json_annotation: ^4.9.0
flutter_timezone: ^2.0.0
package_info_plus: ^8.0.0
Expand All @@ -41,6 +42,7 @@ dependencies:
hosted: https://pub.isar-community.dev/
flutter_displaymode: ^0.6.0
lat_lng_to_timezone: ^0.2.0
# font_awesome_flutter: ^10.7.0
flutter_hsvcolor_picker: ^1.5.1
scrollable_positioned_list: ^0.3.8
flutter_local_notifications: ^17.2.1+1
Expand All @@ -64,7 +66,7 @@ dev_dependencies:
version: ^3.1.7
hosted: https://pub.isar-community.dev/
json_serializable: ^6.8.0
flutter_native_splash: ^2.4.0
flutter_native_splash: ^2.4.1
flutter_launcher_icons: ^0.13.1

flutter_launcher_icons:
Expand Down

0 comments on commit 9a7858f

Please sign in to comment.