mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-28 20:19:58 +00:00
Fix widget
This commit is contained in:
parent
6d0d0efe36
commit
9a7858f279
18 changed files with 39 additions and 32 deletions
|
@ -84,7 +84,8 @@ flutter {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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")
|
implementation("androidx.work:work-runtime-ktx:2.9.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
style="@style/Widget.Android.AppWidget.Container"
|
style="@style/Widget.Android.AppWidget.Container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSecondaryContainer"
|
||||||
android:theme="@style/Theme.Android.AppWidgetContainer"
|
android:theme="@style/Theme.Android.AppWidgetContainer"
|
||||||
android:id="@+id/widget_day_oreo">
|
android:id="@+id/widget_day_oreo">
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
android:shadowRadius="1"
|
android:shadowRadius="1"
|
||||||
android:textSize="@dimen/widget_large_title_text_size"
|
android:textSize="@dimen/widget_large_title_text_size"
|
||||||
tools:ignore="ObsoleteLayoutParam"
|
tools:ignore="ObsoleteLayoutParam"
|
||||||
tools:text="Saturday, September 30 │ " />
|
tools:text="Saturday, September 30 " />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/widget_day_icon"
|
android:id="@+id/widget_day_icon"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
style="@style/Widget.Android.AppWidget.Container"
|
style="@style/Widget.Android.AppWidget.Container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSecondaryContainer"
|
||||||
android:theme="@style/Theme.Android.AppWidgetContainer"
|
android:theme="@style/Theme.Android.AppWidgetContainer"
|
||||||
android:id="@+id/widget_day_oreo">
|
android:id="@+id/widget_day_oreo">
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
android:shadowRadius="1"
|
android:shadowRadius="1"
|
||||||
android:textSize="@dimen/widget_large_title_text_size"
|
android:textSize="@dimen/widget_large_title_text_size"
|
||||||
tools:ignore="ObsoleteLayoutParam"
|
tools:ignore="ObsoleteLayoutParam"
|
||||||
tools:text="Saturday, September 30 │ " />
|
tools:text="Saturday, September 30 " />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/widget_day_icon"
|
android:id="@+id/widget_day_icon"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
style="@style/Widget.Android.AppWidget.Container"
|
style="@style/Widget.Android.AppWidget.Container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSecondaryContainer"
|
||||||
android:theme="@style/Theme.Android.AppWidgetContainer"
|
android:theme="@style/Theme.Android.AppWidgetContainer"
|
||||||
android:id="@+id/widget_day_oreo">
|
android:id="@+id/widget_day_oreo">
|
||||||
|
|
||||||
|
@ -32,8 +33,8 @@
|
||||||
android:shadowRadius="1"
|
android:shadowRadius="1"
|
||||||
android:textAppearance="@android:style/TextAppearance.Material.Large"
|
android:textAppearance="@android:style/TextAppearance.Material.Large"
|
||||||
android:textSize="@dimen/widget_title_text_size"
|
android:textSize="@dimen/widget_title_text_size"
|
||||||
tools:text="21°"
|
tools:ignore="ObsoleteLayoutParam"
|
||||||
tools:ignore="ObsoleteLayoutParam" />
|
tools:text="21°" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
style="@style/Widget.Android.AppWidget.Container"
|
style="@style/Widget.Android.AppWidget.Container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/colorSecondaryContainer"
|
||||||
android:theme="@style/Theme.Android.AppWidgetContainer"
|
android:theme="@style/Theme.Android.AppWidgetContainer"
|
||||||
android:id="@+id/widget_day_oreo">
|
android:id="@+id/widget_day_oreo">
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
<!-- 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:forceDarkAllowed">false</item>
|
||||||
<item name="android:windowFullscreen">false</item>
|
<item name="android:windowFullscreen">false</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
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>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<!--
|
<!--
|
||||||
Having themes.xml for night-v31 because of the priority order of the resource qualifiers.
|
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="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
|
||||||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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 -->
|
<!-- 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
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<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:windowFullscreen">false</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">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>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
This theme determines the color of the Android Window while your
|
This theme determines the color of the Android Window while your
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
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>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
<!-- 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:forceDarkAllowed">false</item>
|
||||||
<item name="android:windowFullscreen">false</item>
|
<item name="android:windowFullscreen">false</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
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>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
and @android:dimen/system_app_widget_internal_padding requires API level 31
|
and @android:dimen/system_app_widget_internal_padding requires API level 31
|
||||||
-->
|
-->
|
||||||
<style name="Theme.Android.AppWidgetContainerParent"
|
<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="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
|
||||||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<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_style">EEE, d MMM │</string>
|
||||||
<string name="date_format_widget_oreo_big_style">EEEE, d MMM │</string>
|
<string name="date_format_widget_oreo_big_style">EEEE, d MMM │</string>
|
||||||
</resources>
|
</resources>
|
|
@ -2,14 +2,14 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<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
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode
|
||||||
setting is off -->
|
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
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<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:windowFullscreen">false</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">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>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
This theme determines the color of the Android Window while your
|
This theme determines the color of the Android Window while your
|
||||||
|
@ -17,15 +17,15 @@
|
||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
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>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||||
<item name="android:id">@android:id/background</item>
|
<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>
|
||||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||||
<item name="android:background">?android:attr/colorBackground</item>
|
<item name="android:background">?attr/colorSurface</item>
|
||||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
<item name="android:textColor">?attr/itemTextColor</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<resources>
|
<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 -->
|
<!-- Radius of the outer bound of widgets to make the rounded corners -->
|
||||||
<item name="appWidgetRadius">16dp</item>
|
<item name="appWidgetRadius">16dp</item>
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -129,7 +129,7 @@ class _InfoWeatherCardState extends State<InfoWeatherCard> {
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: i == timeNow
|
color: i == timeNow
|
||||||
? context.theme.colorScheme.primaryContainer
|
? context.theme.colorScheme.secondaryContainer
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(20),
|
Radius.circular(20),
|
||||||
|
|
|
@ -115,7 +115,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: i == hourOfDay
|
color: i == hourOfDay
|
||||||
? context.theme.colorScheme.primaryContainer
|
? context.theme.colorScheme.secondaryContainer
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(20),
|
Radius.circular(20),
|
||||||
|
|
|
@ -164,7 +164,7 @@ class _InfoDailyCardState extends State<InfoDailyCard> {
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: i == hourOfDay
|
color: i == hourOfDay
|
||||||
? context.theme.colorScheme
|
? context.theme.colorScheme
|
||||||
.primaryContainer
|
.secondaryContainer
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(20),
|
Radius.circular(20),
|
||||||
|
|
|
@ -359,10 +359,10 @@ packages:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_native_splash
|
name: flutter_native_splash
|
||||||
sha256: edf39bcf4d74aca1eb2c1e43c3e445fd9f494013df7f0da752fefe72020eedc0
|
sha256: aa06fec78de2190f3db4319dd60fdc8d12b2626e93ef9828633928c2dcaea840
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.0"
|
version: "2.4.1"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
@ -31,6 +31,7 @@ dependencies:
|
||||||
time_machine: ^0.9.17
|
time_machine: ^0.9.17
|
||||||
dynamic_color: ^1.7.0
|
dynamic_color: ^1.7.0
|
||||||
path_provider: ^2.1.3
|
path_provider: ^2.1.3
|
||||||
|
# quick_settings: ^1.0.1
|
||||||
json_annotation: ^4.9.0
|
json_annotation: ^4.9.0
|
||||||
flutter_timezone: ^2.0.0
|
flutter_timezone: ^2.0.0
|
||||||
package_info_plus: ^8.0.0
|
package_info_plus: ^8.0.0
|
||||||
|
@ -41,6 +42,7 @@ dependencies:
|
||||||
hosted: https://pub.isar-community.dev/
|
hosted: https://pub.isar-community.dev/
|
||||||
flutter_displaymode: ^0.6.0
|
flutter_displaymode: ^0.6.0
|
||||||
lat_lng_to_timezone: ^0.2.0
|
lat_lng_to_timezone: ^0.2.0
|
||||||
|
# font_awesome_flutter: ^10.7.0
|
||||||
flutter_hsvcolor_picker: ^1.5.1
|
flutter_hsvcolor_picker: ^1.5.1
|
||||||
scrollable_positioned_list: ^0.3.8
|
scrollable_positioned_list: ^0.3.8
|
||||||
flutter_local_notifications: ^17.2.1+1
|
flutter_local_notifications: ^17.2.1+1
|
||||||
|
@ -64,7 +66,7 @@ dev_dependencies:
|
||||||
version: ^3.1.7
|
version: ^3.1.7
|
||||||
hosted: https://pub.isar-community.dev/
|
hosted: https://pub.isar-community.dev/
|
||||||
json_serializable: ^6.8.0
|
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: ^0.13.1
|
||||||
|
|
||||||
flutter_launcher_icons:
|
flutter_launcher_icons:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue