Skip to content

Commit

Permalink
android widget: screw firstRun at this point
Browse files Browse the repository at this point in the history
nothing never works right so atp just parse content even if we are configuring the widget
  • Loading branch information
Toni500github committed Dec 21, 2024
1 parent 2d1b249 commit 7cc9ffe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class WidgetSizeProvider(

}

var firstRun = true
internal fun updateAppWidget(
context: Context,
appWidgetManager: AppWidgetManager,
Expand All @@ -109,17 +108,15 @@ internal fun updateAppWidget(
Log.d("widthTesting", "width = $width")
Log.d("wrappingTest", "disableLineWrap = $disableLineWrap")

val parsedContent = if (!firstRun) {
val parsedContent =
customfetchRender.getParsedContent(
context,
appWidgetId,
width,
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)
Expand Down

0 comments on commit 7cc9ffe

Please sign in to comment.