diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 5 | ||||
-rw-r--r-- | app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt | 9 | ||||
-rw-r--r-- | app/src/main/res/layout/widget.xml | 1 |
3 files changed, 7 insertions, 8 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c91f330..9e54dfb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ tools:replace="android:icon,android:label,android:theme" > <receiver - android:exported="true" + android:exported="false" android:name=".Widget" > <intent-filter> @@ -53,8 +53,7 @@ <activity android:name=".main.MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> - - <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> diff --git a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt index 070d053..443683a 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt @@ -54,12 +54,11 @@ fun render( ) { val views = RemoteViews(context.packageName, R.layout.widget) views.apply { - setOnClickPendingIntent( - R.id.settings_btn, - PendingIntent.getActivity( - context, 0, Intent(context, MainActivity::class.java), FLAG_UPDATE_CURRENT - ) + val openPIntent = PendingIntent.getActivity( + context, 0, Intent(context, MainActivity::class.java), FLAG_UPDATE_CURRENT ) + setOnClickPendingIntent(R.id.settings_btn, openPIntent) + setOnClickPendingIntent(R.id.widget_container, openPIntent) setImageViewResource( R.id.state_icon, diff --git a/app/src/main/res/layout/widget.xml b/app/src/main/res/layout/widget.xml index 6930429..dc3ac16 100644 --- a/app/src/main/res/layout/widget.xml +++ b/app/src/main/res/layout/widget.xml @@ -21,6 +21,7 @@ android:layout_width="match_parent" android:orientation="vertical" android:background="@drawable/bg_widget" + android:id="@+id/widget_container" > <LinearLayout android:layout_width="match_parent" |