diff --git a/.huskyrc b/.huskyrc new file mode 100644 index 0000000..0926705 --- /dev/null +++ b/.huskyrc @@ -0,0 +1 @@ +export PATH="/usr/local/bin:$PATH" \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8c4a410..1a2342e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -26,7 +26,27 @@ + + + + + + + + + + + + + + + + + + + val views = RemoteViews(context.packageName, R.layout.widget_layout).apply { + + // Open App on Widget Click + val pendingIntent = HomeWidgetLaunchIntent.getActivity(context, + MainActivity::class.java) + setOnClickPendingIntent(R.id.widget_root, pendingIntent) + + setTextViewText(R.id.obed, widgetData.getString("_obed", "Nic")) + + // Pending intent to update counter on button click + val backgroundIntent = HomeWidgetBackgroundIntent.getBroadcast(context, + Uri.parse("myAppWidget://update")) + setOnClickPendingIntent(R.id.bt_update, backgroundIntent) + } + appWidgetManager.updateAppWidget(widgetId, views) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/res/layout/widget_layout.xml b/android/app/src/main/res/layout/widget_layout.xml new file mode 100644 index 0000000..0f480c1 --- /dev/null +++ b/android/app/src/main/res/layout/widget_layout.xml @@ -0,0 +1,32 @@ + + + + + + +