Skip to content

Fix Android TV APK distribution#139

Merged
KuekHaoYang merged 4 commits intomainfrom
codex/issue-129-android-tv-apk
Apr 2, 2026
Merged

Fix Android TV APK distribution#139
KuekHaoYang merged 4 commits intomainfrom
codex/issue-129-android-tv-apk

Conversation

@KuekHaoYang
Copy link
Copy Markdown
Owner

Summary

  • make the Android TV app configurable at first launch so a generic APK is actually usable
  • add the missing Gradle wrapper and a GitHub Actions workflow to build and optionally publish the APK
  • update the README with download, build, and setup instructions

Root cause

The repository already contained an Android TV wrapper, but it hardcoded a placeholder URL and did not ship a complete Gradle wrapper or a GitHub-side delivery path. In practice that meant users still had to edit source code and compile locally.

Validation

  • git diff --check
  • GitHub Actions build on this branch after PR creation

Closes #129

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 2, 2026

Deploying kvideo with  Cloudflare Pages  Cloudflare Pages

Latest commit: eb72a36
Status: ✅  Deploy successful!
Preview URL: https://842662ab.kvideo.pages.dev
Branch Preview URL: https://codex-issue-129-android-tv-a.kvideo.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a dynamic configuration system for the Android TV WebView application, replacing the hardcoded server URL with a user-configurable setup screen. Key updates include increasing the minSdk to 26, adding SharedPreferences for URL persistence, and providing a new setup UI. The README.md has been updated to reflect these changes, including a new Gradle property for pre-configuring the URL. Review feedback highlights opportunities to improve the Android TV user experience by handling IME actions, adopting the modern OnBackPressedDispatcher API, and correcting an unsupported layout attribute.

Comment on lines +59 to +61
saveButton.setOnClickListener {
openConfiguredUrl()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The 'url_input' EditText has 'android:imeOptions="actionDone"' in the layout, but there is no listener to handle the 'Done' action from the on-screen keyboard. Adding an 'OnEditorActionListener' would allow users to submit the URL directly from the keyboard, which significantly improves the user experience on Android TV.

        saveButton.setOnClickListener {
            openConfiguredUrl()
        }

        urlInput.setOnEditorActionListener { _, actionId, _ ->
            if (actionId == android.view.inputmethod.EditorInfo.IME_ACTION_DONE) {
                openConfiguredUrl()
                true
            } else {
                false
            }
        }

Comment on lines 113 to 125
override fun onBackPressed() {
if (isSetupVisible()) {
@Suppress("DEPRECATION")
super.onBackPressed()
return
}

if (webView.canGoBack()) {
webView.goBack()
} else {
@Suppress("DEPRECATION")
super.onBackPressed()
showSetup(getString(R.string.status_settings_hint))
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The 'onBackPressed()' method is deprecated starting from API 33. Since the project includes 'androidx.activity:activity-ktx', it is recommended to use 'OnBackPressedDispatcher' with an 'OnBackPressedCallback'. This provides a more robust and lifecycle-aware way to handle back navigation.

Comment on lines +22 to +28
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F31A1C22"
android:elevation="12dp"
android:maxWidth="680dp"
android:orientation="vertical"
android:padding="32dp">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The 'android:maxWidth' attribute is not supported by 'LinearLayout' and will be ignored. On large TV screens, the setup dialog will stretch to the full width of the screen, which may result in a poor user experience. To limit the width, you can set a fixed 'android:layout_width' (e.g., '680dp') and rely on the parent's 'gravity="center"' to keep it centered.

Suggested change
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F31A1C22"
android:elevation="12dp"
android:maxWidth="680dp"
android:orientation="vertical"
android:padding="32dp">
android:layout_width="680dp"
android:layout_height="wrap_content"
android:background="#F31A1C22"
android:elevation="12dp"
android:orientation="vertical"
android:padding="32dp">

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 2, 2026

Deploying kuekhaoyang with  Cloudflare Pages  Cloudflare Pages

Latest commit: eb72a36
Status: ✅  Deploy successful!
Preview URL: https://748f586a.kuekhaoyang.pages.dev
Branch Preview URL: https://codex-issue-129-android-tv-a.kuekhaoyang.pages.dev

View logs

@KuekHaoYang KuekHaoYang merged commit 644cc39 into main Apr 2, 2026
4 checks passed
@KuekHaoYang KuekHaoYang deleted the codex/issue-129-android-tv-apk branch April 2, 2026 13:03
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.

[Feat]: 能提供一个build好的AndroidTV apk吗?

1 participant