Android: configure Dynamic Widget placements from the Home Screen (`android:configure`)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- android, react-native
- 領域
- mobile
調査の方向性
This is design work, so start with the open decisions rather than code: the ADR must settle which parameters are listed, opt-in scope, pre-Android-12 behaviour and pinned widgets. Read the per-widget provider XML the plugin writes to res/xml/voltra_widget_<id>_info.xml, the localized strings in voltra_widgets.xml, and the prior attempt in commit 2188ff4. Done means an accepted ADR, then a native configure Activity tested on API 24, 28, 31 and 35.
索引モデルが issue の本文から書いたものです。
説明
Feature Description
A native configuration screen for Android Dynamic Widgets that declare appIntent.parameters. It opens when the user places the widget or picks Reconfigure from the launcher, and writes the placement's values to the existing instance layer (ADR 0006). This is the Android counterpart of the iOS Edit Widget sheet.
Problem Statement
On Android a placement's configuration can only be changed from inside the app, with setWidgetInstanceConfiguration. Long-pressing the widget offers nothing. ADR 0006 left the launcher-side flow (android:configure, a trampoline Activity, widgetFeatures) for its own decision, since it changes placement semantics for every widget that declares parameters. On iOS, the same appIntent.parameters already generate the system Edit Widget sheet, so the two platforms diverge.
This matters most for dynamicOptions parameters (#392, #396, not merged yet): the app supplies the choices, but on Android the user can't pick one without the app building its own screen.
Proposed Solution
An ADR, then an implementation. The ADR should decide:
-
Which parameters the screen lists. Proposal: every
appIntentparameter (fixedoptions,dynamicOptionsand free text), in declaration order, to match iOS. The first version in #396 listed onlydynamicOptionsparameters, so a widget with a fixedunitsand a dynamicmasjidoffered onlymasjid. -
Which widgets get it. Proposal: opt-in per widget at first (for example
android.configureOnPlace: truein the widget's config), because addingandroid:configurechanges what placing an existing widget does. -
Android versions below 12. The Glance configuration guide says
reconfigurableandconfiguration_optionalare "only available starting in Android 12 (API level 31)… the system ignores them and follows the default behavior" on earlier versions. The default is that the host launches the configuration activity once, right after the user adds the widget. And perACTION_APPWIDGET_CONFIGURE, returningRESULT_CANCELEDmeans "the host will cancel the add and not display this AppWidget". So below 12, every add opens the screen, backing out of it removes the widget, and there is no Reconfigure. minSdk is 24.Proposal: declare
android:configureandwidgetFeaturesonly in an API-31 variant of the widget'sappwidget-providerXML (res/xml-v31/), so Android 12+ gets an optional, reconfigurable screen and older versions keep today's in-app-only flow. The widget docs don't mention per-version provider XML. It relies on the standard platform-version resource qualifier, which needs checking on a pre-12 device. Today the plugin writes a singleres/xml/voltra_widget_<id>_info.xml. -
What a save does. Proposal: write the instance layer in one transaction (the same path as
setWidgetInstanceConfiguration), then trigger the redraw and the ADR 0007 per-instance fetch from the activity. The activity has to trigger it itself: the Glance guide says "The system doesn't send the ACTION_APPWIDGET_UPDATE broadcast when a configuration activity is launched… It's the responsibility of the configuration activity to request an update". TheAppWidgetManagerreference says aRESULT_OKdoes send one, so the two pages disagree. Requesting the update explicitly works either way. The result must carryEXTRA_APPWIDGET_ID. -
How the screen is built. Proposal: a native Activity that reads the localized parameter titles the plugin already writes to
voltra_widgets.xmlfor an in-app configuration screen (ADR 0009 §6), so it opens without starting the React Native runtime. AdynamicOptionsparameter with no choices yet shows an empty state rather than a blank picker. -
Pinned widgets.
requestPinGlanceAppWidgetplaces a widget without the launcher's configuration screen ("Launcher will not show the configuration activity associated with the provider in this case",AppWidgetManager.requestPinAppWidget). A pinned placement starts from the widget-type values and can only be configured later through Reconfigure (Android 12+) or the app.
Alternatives Considered
- App-only configuration (today). Works, but every app has to build its own per-placement UI, and nothing in the launcher points users to it.
- Open a host-app screen from the launcher. Reuses the app's UI, but starts the full RN runtime on every placement and needs the app to handle a deep link correctly.
- Show the screen on every Android version. Simpler XML, but below Android 12 it can't be skipped or reopened, and cancelling it removes the widget.
Current Library Version
@use-voltra/android-client 2.7.1
Implementation
- I would be willing to submit a pull request for this feature
Additional Context
- Split out of #396 at review. The earlier version,
VoltraWidgetConfigureActivity, is in that branch's history at mrevanzak/voltra@2188ff4 and can be a starting point once the questions above are settled. - Should be tested on API 24, 28, 31 and 35, on the Pixel launcher and at least one third-party launcher. The Android docs don't say how other launchers handle
reconfigurableorconfiguration_optional, andAppWidgetProviderInfocallswidgetFeatures"hints to the widget host". The first version was tested only on API 35. AppWidgetProviderInfolistsWIDGET_FEATURE_RECONFIGURABLEas added in API 28, but the Glance guide says these options are ignored before Android 12. Worth confirming on an API 28–30 device.- Related ADRs: 0006 (instance configuration), 0007 (per-instance fetch), 0014 (dynamic parameter options, in #392).
- 主要言語
- TypeScript
- スター
- 865
- フォーク
- 50
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstackincubator/voltra のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
callstackincubator/voltra#376 ·
メンテナーはふだん 1 日以内に返信
-
refactor-scout
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
callstackincubator/voltra#308 ·
メンテナーはふだん 1 日以内に返信
-
refactor-scout
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
callstackincubator/voltra#307 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 45/100
callstackincubator/voltra#398 ·
メンテナーはふだん 1 日以内に返信
-
Keep Edit Widget choices when an app moves an existing configurable widget to Voltra対応中かも @mrevanzak が 6 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 40/100
callstackincubator/voltra#393 ·
メンテナーはふだん 1 日以内に返信
callstackincubator/voltra の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
audacity/audacity.github.io#118 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
crxjs/chrome-extension-tools#1261 ·
-
Resources: Update work of fuzhou対応中かも @rmt-svc が今日担当しました。 オープンresources
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
railmapgen/rmp-gallery#4245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
mike-north/AgentMonitors#717 ·
メンテナーはふだん 1 日以内に返信