From 3f74f077c18c8df6118999ef092b3f92d7d3ed8a Mon Sep 17 00:00:00 2001 From: Toni500git Date: Sat, 22 Feb 2025 18:58:57 +0100 Subject: [PATCH] doc: move the config explaination to --how-it-works also add it on the android widget app during configuration --- .../widget/CustomfetchConfigureActivity.kt | 12 +- .../main/res/layout/customfetch_configure.xml | 43 ++++++-- customfetch.1 | 3 + include/config.hpp | 83 +------------- src/main.cpp | 103 +++++++++++++++++- 5 files changed, 151 insertions(+), 93 deletions(-) diff --git a/android/app/src/main/java/org/toni/customfetch_android/widget/CustomfetchConfigureActivity.kt b/android/app/src/main/java/org/toni/customfetch_android/widget/CustomfetchConfigureActivity.kt index 20803da..c45b247 100644 --- a/android/app/src/main/java/org/toni/customfetch_android/widget/CustomfetchConfigureActivity.kt +++ b/android/app/src/main/java/org/toni/customfetch_android/widget/CustomfetchConfigureActivity.kt @@ -120,10 +120,16 @@ class CustomfetchConfigureActivity : Activity() { binding.argumentsConfigure.setText(getArgsPref(this@CustomfetchConfigureActivity, appWidgetId)) binding.additionalTruncateWidth.setText(getAppSettingsPrefString(this, "additional_truncate")) binding.truncateText.isChecked = getAppSettingsPrefBool(this, "always_truncate") - binding.argsHelp.text = customfetchRender.mainAndroid("customfetch --help", true) + binding.docsHelp.text = customfetchRender.mainAndroid("customfetch --help", true) - binding.showModulesList.setOnCheckedChangeListener { _, isChecked -> - binding.argsHelp.text = customfetchRender.mainAndroid("customfetch ${if (isChecked) "-l" else "-h"}", true) + binding.btnArgsHelp.setOnClickListener { + binding.docsHelp.text = customfetchRender.mainAndroid("customfetch --help", true) + } + binding.btnConfigHelp.setOnClickListener { + binding.docsHelp.text = customfetchRender.mainAndroid("customfetch --how-it-works", true) + } + binding.btnModulesHelp.setOnClickListener { + binding.docsHelp.text = customfetchRender.mainAndroid("customfetch --list-modules", true) } // set everything of the radio buttons at first configuration from the app. diff --git a/android/app/src/main/res/layout/customfetch_configure.xml b/android/app/src/main/res/layout/customfetch_configure.xml index cd3021e..729dd72 100644 --- a/android/app/src/main/res/layout/customfetch_configure.xml +++ b/android/app/src/main/res/layout/customfetch_configure.xml @@ -133,19 +133,48 @@ android:layout_marginTop="8dp" android:text="@string/add_widget" /> - + android:layout_marginTop="40dp" > + + +