From 7cc9ffecc2c20f70384af4e3d86e4c8c735483a3 Mon Sep 17 00:00:00 2001 From: Toni500git Date: Sat, 21 Dec 2024 20:05:45 +0100 Subject: [PATCH] android widget: screw firstRun at this point nothing never works right so atp just parse content even if we are configuring the widget --- .../java/org/toni/customfetch_android/SettingsActivity.kt | 2 +- .../java/org/toni/customfetch_android/widget/customfetch.kt | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/java/org/toni/customfetch_android/SettingsActivity.kt b/android/app/src/main/java/org/toni/customfetch_android/SettingsActivity.kt index 06f0925..fa5aadc 100644 --- a/android/app/src/main/java/org/toni/customfetch_android/SettingsActivity.kt +++ b/android/app/src/main/java/org/toni/customfetch_android/SettingsActivity.kt @@ -58,7 +58,7 @@ class SettingsActivity : AppCompatActivity() { AlertDialog.Builder(this) .setTitle("Application is useless, use widget") .setMessage("The application settings doesn't do anything, currently.\n"+ - "The main purpose of customfetch is the widget, so might as well check that out :)") + "The main purpose of customfetch is the widget, so might as well check that out instead :)") .setPositiveButton("Ok" ) { _, _ -> } .setIcon(android.R.drawable.ic_dialog_info) diff --git a/android/app/src/main/java/org/toni/customfetch_android/widget/customfetch.kt b/android/app/src/main/java/org/toni/customfetch_android/widget/customfetch.kt index c9802fb..0f0ef08 100644 --- a/android/app/src/main/java/org/toni/customfetch_android/widget/customfetch.kt +++ b/android/app/src/main/java/org/toni/customfetch_android/widget/customfetch.kt @@ -88,7 +88,6 @@ class WidgetSizeProvider( } -var firstRun = true internal fun updateAppWidget( context: Context, appWidgetManager: AppWidgetManager, @@ -109,7 +108,7 @@ internal fun updateAppWidget( Log.d("widthTesting", "width = $width") Log.d("wrappingTest", "disableLineWrap = $disableLineWrap") - val parsedContent = if (!firstRun) { + val parsedContent = customfetchRender.getParsedContent( context, appWidgetId, @@ -117,9 +116,7 @@ internal fun updateAppWidget( disableLineWrap, textPaint ) - } else "useless text" - firstRun = false // Construct the RemoteViews object val views = RemoteViews(context.packageName, R.layout.customfetch) views.setTextViewText(R.id.customfetch_text, parsedContent)