Skip to content

Add configurable QS tile cycles and refresh the main UI - #12

Merged
Dhangofa merged 34 commits into
mainfrom
dev
Aug 11, 2026
Merged

Add configurable QS tile cycles and refresh the main UI#12
Dhangofa merged 34 commits into
mainfrom
dev

Conversation

@Dhangofa

Copy link
Copy Markdown
Owner

Summary

This PR completes Phase 4 of the NetToggle update by adding a configurable Quick Settings tile cycle and refreshing the main app interface.

Users can now choose an ordered cycle of two or three network modes. The selected order is preserved and used directly by the Quick Settings tile.

The update also removes the framework ActionBar, moves the app version into the main header, introduces compact segmented controls, and improves the overall light and dark theme presentation.

Configurable Quick Tile Cycle

  • Added a configurable Quick Settings tile cycle.
  • Added cycle options for:
    • 5G Only
    • 4G Only
    • Preferred 5G
    • Preferred 4G
  • Enforced a minimum of two selected modes.
  • Enforced a maximum of three selected modes.
  • Used selection order as the Quick Settings tile cycle order.
  • Added a live preview of the configured cycle sequence.
  • Added a selected-mode count indicator.
  • Preserved the configured cycle after reopening the app, rebooting, or updating the package.
  • Cleared the cached network state whenever the cycle configuration changes.
  • Used the first configured mode when the current network state is outside the selected cycle.

Quick Settings Tile Updates

  • Replaced the fixed tile cycle with the saved user-configured cycle.
  • Updated the unknown-state label to show the first configured target mode.
  • Fixed the active tile label to display the current network mode.
  • Limited the Tap to Set prompt to unknown tile states.
  • Prevented stale asynchronous readback from overriding a newer successful tile state.
  • Preserved active mode icons and command execution behavior.

Main UI Refresh

  • Removed the framework ActionBar.
  • Activated the custom light and dark NoActionBar themes.
  • Moved the application version into the main header as a compact pill.
  • Refined header spacing, title hierarchy, and application branding.
  • Added compact segmented controls for Execution Mode.
  • Added compact segmented controls for Target SIM.
  • Added a redesigned Quick Tile Cycle card.
  • Added a selected-mode count pill and cycle-order preview.
  • Refined card padding, margins, and vertical spacing.
  • Compacted the Developer section and social links.
  • Added reusable vector and selector resources for the refreshed interface.
  • Added theme-aware segmented control backgrounds and text colors.

New Files

  • cycle/TileCycleManager.java
  • ui/TileCycleUiController.java
  • res/layout/view_tile_cycle_card.xml
  • res/drawable/ic_refresh.xml
  • res/drawable/selector_segmented_tab.xml
  • res/drawable/shape_segmented_container.xml
  • res/color/color_segmented_text.xml

Updated Files

  • config/AppPreferences.java
  • MainActivity.java
  • NetworkTileService.java
  • activity_main.xml
  • AndroidManifest.xml
  • Light and dark color resources

Behavior Preserved

  • Root execution mode remains supported.
  • Shizuku execution mode remains supported.
  • Auto, SIM 1, and SIM 2 targeting remain supported.
  • Subscription IDs continue to be used for network mode readback.
  • Physical SIM slot indexes continue to be used when applying network modes.
  • Existing command execution and telephony modules remain unchanged.
  • Auto SIM detection warnings remain functional.
  • Cached tile-state behavior remains functional.
  • Existing four network modes remain unchanged.

…NetworkTileService

- Removed SIM resolution and telephony shell-command construction from NetworkTileService.
- Updated NetworkTileService to coordinate the modular telephony components.
- Preserved existing Target SIM, readback, switching, cache, label, icon, and Auto SIM error behavior.
- Added a dedicated Quick Tile Cycle card.
- Added mode selectors for 5G Only, 4G Only, Preferred 5G, and Preferred 4G.
- Added selected-mode count display.
- Added a live preview of the configured cycle order.
- Reused the existing card, control, border, text, and brand styling.
- Kept the cycle card in a separate reusable layout resource.
- Added a dedicated Quick Tile Cycle card.
- Added mode selectors for 5G Only, 4G Only, Preferred 5G, and Preferred 4G.
- Added selected-mode count display.
- Added a live preview of the configured cycle order.
- Reused the existing card, control, border, text, and brand styling.
- Kept the cycle card in a separate reusable layout resource.
- Added TileCycleUiController to keep cycle-selection logic out of MainActivity.
- Connected each cycle selector to its corresponding NetworkMode.
- Refreshed selector states from the saved ordered cycle.
- Blocked selections above the three-mode maximum.
- Blocked removals below the two-mode minimum.
- Restored the previous checkbox state after an invalid selection attempt.
- Added user feedback for minimum and maximum selection limits.
- Updated the selected count and cycle-order preview after each valid change.
- Initialized TileCycleManager from the shared AppPreferences instance.
- Initialized TileCycleUiController after the activity layout and views were ready.
- Kept cycle configuration logic outside MainActivity.
- Preserved existing Root, Shizuku, Target SIM, warning, link, and lifecycle behavior.
- Initialized TileCycleManager inside NetworkTileService.
- Replaced the fixed four-mode cycle with the saved user-configured cycle.
- Used the first configured mode when the current state is not part of the selected cycle.
- Updated the unknown-state tile label to show the first configured target mode.
- Preserved command execution, SIM resolution, readback, caching, icons, and switching-state behavior.
- Added the reusable Quick Tile Cycle card to the main app layout.
- Positioned the cycle configuration below the Execution Mode and Target SIM controls.
- Kept the Developer card below the new cycle section.
- Reused the existing spacing and card styling.
- Added a current-state check before applying asynchronous network mode readback.
- Ignored stale readback callbacks after a successful tile operation.
- Removed the redundant unknown-state UI update from failed readback.
- Prevented the configured first-mode prompt from overriding the active tile label.
- Preserved normal readback behavior when the cached state is still unknown.
- Activated the custom NoActionBar theme through the application manifest.
- Removed framework ActionBar initialization from MainActivity.
- Removed the ActionBar-hosted version pill and title styling.
- Removed unused ActionBar-specific imports.
- Retained app version lookup for a future in-layout version display.
- Preserved status bar styling and all existing app behavior.
- New Button added
- Developer card minimize
- App version added
- Restore all six IDs expected by TileCycleUiController.
- Use CheckBox, not static TextView, for cycle options.
- Reduced excessive spacing in the header and Quick Settings hint.
- Added consistent 12dp spacing between primary cards.
- Reduced outer horizontal and bottom padding for a more compact layout.
- Refined title, version pill, and description spacing.
- Added consistent minimum heights to segmented controls.
- Removed redundant Developer card top margin.
- Preserved the existing responsive ScrollView layout and visual hierarchy.
- Fixed the active QS tile label to display the current network mode.
- Limited the “Tap to Set” prompt to the unknown tile state.
- Kept the first configured cycle mode as the unknown-state target.
- Preserved dynamic icons, configured cycle order, caching, and asynchronous readback protection.
@Dhangofa
Dhangofa merged commit 021b21c into main Aug 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant