mirror of
https://github.com/PranshulGG/WeatherMaster.git
synced 2026-10-21 18:43:03 -05:00
fixes #549
This commit is contained in:
1 parent
5e1b4fff5d
commit
cd7bc00017
3 files changed
+38
No files matched your search
@@ -4,6 +4,8 @@ import android.appwidget.AppWidgetManager
|
||||
import android.appwidget.AppWidgetProvider
|
||||
import android.content.Context
|
||||
import android.widget.RemoteViews
|
||||
import android.app.PendingIntent
|
||||
import android.content.Intent
|
||||
import com.pranshulgg.weather_master_app.util.WeatherIconMapper
|
||||
|
||||
|
||||
@@ -34,6 +36,17 @@ class PillWidgetProvider : AppWidgetProvider() {
|
||||
|
||||
views.setImageViewResource(R.id.widget_icon_current_pill_pixel, iconRes)
|
||||
|
||||
|
||||
val intent = Intent(context, io.flutter.embedding.android.FlutterActivity::class.java).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
}
|
||||
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
|
||||
views.setOnClickPendingIntent(R.id.pill_widget, pendingIntent)
|
||||
|
||||
manager.updateAppWidget(id, views)
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -6,6 +6,8 @@ import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.RemoteViews
|
||||
import android.app.PendingIntent
|
||||
import android.content.Intent
|
||||
import com.pranshulgg.weather_master_app.util.WeatherIconMapper
|
||||
|
||||
class WeatherWidgetCastProvider : AppWidgetProvider() {
|
||||
@@ -112,6 +114,17 @@ class WeatherWidgetCastProvider : AppWidgetProvider() {
|
||||
views.addView(containerId, itemView)
|
||||
}
|
||||
|
||||
|
||||
val intent = Intent(context, io.flutter.embedding.android.FlutterActivity::class.java).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
}
|
||||
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
|
||||
views.setOnClickPendingIntent(R.id.widget_hourly_current, pendingIntent)
|
||||
|
||||
manager.updateAppWidget(id, views)
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -4,6 +4,8 @@ import android.appwidget.AppWidgetManager
|
||||
import android.appwidget.AppWidgetProvider
|
||||
import android.content.Context
|
||||
import android.widget.RemoteViews
|
||||
import android.app.PendingIntent
|
||||
import android.content.Intent
|
||||
import com.pranshulgg.weather_master_app.util.WeatherIconMapper
|
||||
|
||||
|
||||
@@ -36,6 +38,16 @@ class WeatherWidgetProvider : AppWidgetProvider() {
|
||||
|
||||
views.setImageViewResource(R.id.widget_icon_current_pill, iconRes)
|
||||
|
||||
val intent = Intent(context, io.flutter.embedding.android.FlutterActivity::class.java).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
}
|
||||
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
|
||||
views.setOnClickPendingIntent(R.id.weather_widget, pendingIntent)
|
||||
|
||||
manager.updateAppWidget(id, views)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user