Skip to content

Refactor fragment container creation with MyLuaFileManager#299

Open
ZL114514 wants to merge 10 commits intomainfrom
codex/refactor-myluafragment-creation-process
Open

Refactor fragment container creation with MyLuaFileManager#299
ZL114514 wants to merge 10 commits intomainfrom
codex/refactor-myluafragment-creation-process

Conversation

@ZL114514
Copy link
Copy Markdown
Collaborator

@ZL114514 ZL114514 commented Apr 4, 2026

Motivation

  • Centralize creation and management of the two fragment host containers so the layout and container-selection logic are maintained in one place via a file manager.
  • Allow each container to be wrapped in a MaterialCardView so the two containers can be displayed side-by-side (parallel) or overlapping on the fg host depending on screen width (inSekai).
  • Simplify static layout and fragment lifecycle code by delegating container sizing/selection/tagging to a small API instead of manual view manipulation across scripts.

Description

  • Add mods/MyLuaFileManager.lua which programmatically creates two MaterialCardView wrappers containing FrameLayout hosts and exposes new, getContainerPair, setParallelMode, selectTargetContainer, markContainer, and initDefaultTags APIs.
  • Update app/src/main/assets_bin/home.lua to require "mods.MyLuaFileManager", instantiate the manager with MyLuaFileManager.new(fg), obtain f1,f2 via getContainerPair(), call setParallelMode on layout changes, and initialize tags with initDefaultTags().
  • Simplify app/src/main/assets_bin/layout/fragment.aly so fg is now a dedicated horizontal host for the manager to populate instead of containing static f1/f2 frames.
  • Adjust app/src/main/assets_bin/mods/muk.lua to prefer myLuaFileManager for selecting and marking the target container in MyLuaFileFragment.onDestroy and newActivity, while keeping the original logic as a fallback when the manager is not present.

Testing

  • Ran git diff --check which completed without issues.
  • Verified repository changes were committed successfully (commit created during the rollout).
  • No automated runtime tests were run in this environment; changes are limited to Lua layout/coordination code and include fallbacks to existing logic.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant