Skip to content

[ui] improve start/stop button#391

Open
capcom6 wants to merge 1 commit into
masterfrom
ui/improve-start-stop-button
Open

[ui] improve start/stop button#391
capcom6 wants to merge 1 commit into
masterfrom
ui/improve-start-stop-button

Conversation

@capcom6

@capcom6 capcom6 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Start/Stop control now reflects the actual service running state by syncing from live status (instead of the previous checked state).
  • UI Updates
    • Replaced the Start/Stop ToggleButton with a MaterialButton.
    • Button label and background tint now update dynamically (green when running, grey when stopped).
  • Resource Updates
    • Added new colors for running/non-running states.
    • Added “Start Service” and “Stop Service” labels.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4b261978-d524-4d40-ad52-022cd38e013e

📥 Commits

Reviewing files that changed from the base of the PR and between ed106cf and a5c1592.

📒 Files selected for processing (4)
  • app/src/main/java/me/capcom/smsgateway/ui/HomeFragment.kt
  • app/src/main/res/layout/fragment_home.xml
  • app/src/main/res/values/colors.xml
  • app/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/src/main/res/values/colors.xml
  • app/src/main/res/values/strings.xml
  • app/src/main/res/layout/fragment_home.xml

Walkthrough

The start control changes from a ToggleButton to a MaterialButton. HomeFragment reads the running state from stateLiveData for clicks and updates the button label and tint from the observer. Two colors and two strings are added.

Changes

MaterialButton Start/Stop Control

Layer / File(s) Summary
Layout widget and supporting resources
app/src/main/res/layout/fragment_home.xml, app/src/main/res/values/colors.xml, app/src/main/res/values/strings.xml
buttonStart becomes a MaterialButton with margin, tint, and corner radius; the layout root is reformatted; and start/stop strings plus green/grey colors are added.
HomeFragment click handler and state observer
app/src/main/java/me/capcom/smsgateway/ui/HomeFragment.kt
ColorStateList is added, the click handler uses stateLiveData.value instead of isChecked, and the observer sets the button text and backgroundTintList from the running state.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main UI change to the start/stop button.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ui/improve-start-stop-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/res/layout/fragment_home.xml`:
- Around line 254-259: The MaterialButton with android:id of buttonStart is
missing a default text label in the XML layout, causing it to render blank until
stateLiveData emits a value. Add an android:text attribute to the MaterialButton
element with a default label value of "Start" to ensure the button displays
properly on initial render and provides appropriate visual feedback to the user
before any state changes occur.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3d9ce403-c6f0-4239-977e-8fc52b3df4db

📥 Commits

Reviewing files that changed from the base of the PR and between 361de56 and 1364eae.

📒 Files selected for processing (4)
  • app/src/main/java/me/capcom/smsgateway/ui/HomeFragment.kt
  • app/src/main/res/layout/fragment_home.xml
  • app/src/main/res/values/colors.xml
  • app/src/main/res/values/strings.xml

Comment thread app/src/main/res/layout/fragment_home.xml
@capcom6
capcom6 force-pushed the ui/improve-start-stop-button branch 2 times, most recently from 1474e9e to b51ad3e Compare June 24, 2026 02:10
@capcom6
capcom6 marked this pull request as ready for review June 24, 2026 07:03
@capcom6 capcom6 added the ready label Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

🤖 Pull request artifacts

file commit
app-release.apk a5c1592
app-release.aab a5c1592
app-insecure.apk a5c1592
app-insecure.aab a5c1592

@capcom6
capcom6 force-pushed the ui/improve-start-stop-button branch from b51ad3e to d9cbcf3 Compare June 25, 2026 00:16
@github-actions github-actions Bot removed the ready label Jun 25, 2026
@capcom6 capcom6 added the ready label Jun 25, 2026
@capcom6
capcom6 force-pushed the ui/improve-start-stop-button branch from d9cbcf3 to 0d74167 Compare July 2, 2026 02:18
@github-actions github-actions Bot removed the ready label Jul 2, 2026
@capcom6 capcom6 added the ready label Jul 2, 2026
@capcom6
capcom6 force-pushed the ui/improve-start-stop-button branch from 0d74167 to ed106cf Compare July 8, 2026 01:12
@github-actions github-actions Bot removed the ready label Jul 8, 2026
@capcom6 capcom6 added the ready label Jul 8, 2026
@capcom6
capcom6 force-pushed the ui/improve-start-stop-button branch from ed106cf to a5c1592 Compare July 14, 2026 01:18
@github-actions github-actions Bot removed the ready label Jul 14, 2026
@capcom6 capcom6 added the ready label Jul 16, 2026
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