feat: add input field for testing#2040
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a “Test input” panel to the app’s main screen so users can bring up the keyboard and quickly verify different inputType behaviors (text/number/password/phone/email/url), with persistence for panel visibility/expanded state.
Changes:
- Introduces
TestInputPanelcustom view with input-type pills, clear button, collapse/hide actions, and preference persistence. - Integrates the panel into
activity_main.xmland adds a toolbar action to restore it when hidden. - Adds supporting resources (strings/localizations, colors, backgrounds, and icons).
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/themes.xml | Adds pill TextView style used by the input-type selector. |
| app/src/main/res/values/strings.xml | Adds English strings for the test input panel and actions. |
| app/src/main/res/values/colors.xml | Adds day-mode colors for the panel background/stroke states. |
| app/src/main/res/values-night/colors.xml | Adds night-mode colors for the panel background/stroke states. |
| app/src/main/res/values-zh-rTW/strings.xml | Adds zh-TW strings for the test input panel. |
| app/src/main/res/values-zh-rCN/strings.xml | Adds zh-CN strings for the test input panel. |
| app/src/main/res/layout/test_input_panel.xml | New layout for the panel UI (header, pills, edit field, clear/hide/collapse). |
| app/src/main/res/layout/activity_main.xml | Places TestInputPanel on the main screen and adjusts content layout sizing. |
| app/src/main/res/drawable/bg_test_input_panel.xml | Background shape for the panel container. |
| app/src/main/res/drawable/bg_test_input_field.xml | Selector background for the test EditText focus state. |
| app/src/main/res/drawable/bg_input_type_pill.xml | Selector background for pill selection state. |
| app/src/main/res/color/text_input_type_pill.xml | Color state list for pill text (selected vs unselected). |
| app/src/main/res/drawable/ic_baseline_phone_24.xml | New icon for phone input type pill. |
| app/src/main/res/drawable/ic_baseline_numbers_24.xml | New icon for number input type pill. |
| app/src/main/res/drawable/ic_baseline_lock_24.xml | New icon for password input type pill. |
| app/src/main/res/drawable/ic_baseline_link_24.xml | New icon for URL input type pill. |
| app/src/main/res/drawable/ic_baseline_email_24.xml | New icon for email input type pill. |
| app/src/main/java/com/osfans/trime/ui/main/TestInputPanel.kt | Implements the panel behavior, selection logic, and preference persistence. |
| app/src/main/java/com/osfans/trime/ui/main/MainActivity.kt | Binds panel visibility to a “Show test input” toolbar item and adjusts insets for IME. |
| app/src/main/java/com/osfans/trime/data/prefs/AppPrefs.kt | Adds persisted preferences for test input visibility/expanded state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+51
to
+55
| setBackgroundResource(R.drawable.bg_test_input_panel) | ||
| val paddingPx = (12 * resources.displayMetrics.density).toInt() | ||
| setPadding(paddingPx, paddingPx, paddingPx, paddingPx) | ||
| binding = TestInputPanelBinding.inflate(LayoutInflater.from(context), this) | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
This one is not correct. Custom view should not call this method.
Comment on lines
+36
to
+38
| private val binding: TestInputPanelBinding | ||
| private val activity = context as FragmentActivity | ||
| private var onVisibilityChanged: ((visible: Boolean) -> Unit)? = null |
Comment on lines
+231
to
+234
| val icon = ContextCompat.getDrawable(context, iconRes)?.mutate() | ||
| pill.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null) | ||
| TextViewCompat.setCompoundDrawableTintList(pill, pill.textColors) | ||
| } |
Comment on lines
+16
to
+20
| <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> | ||
|
|
||
| <path android:fillColor="@android:color/white" android:pathData="M20.5,10L21,8h-4l1,-4h-2l-1,4h-4l1,-4h-2L9,8H5l-0.5,2h4l-1,4h-4L3,16h4l-1,4h2l1,-4h4l-1,4h2l1,-4h4l0.5,-2h-4l1,-4H20.5zM13.5,14h-4l1,-4h4L13.5,14z"/> | ||
|
|
||
| </vector> |
Bambooin
approved these changes
Jul 5, 2026
Bambooin
left a comment
Collaborator
There was a problem hiding this comment.
I verified this patch, please fix the reasonable comments by copilot.
Collaborator
Author
|
Suggestions (beside the first one) by copolit are committed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request
Issue tracker
Fixes will automatically close the related issues
Fixes #1987
Feature
Add a input field for testing different input type in the main screen.
Code of conduct
Code style
make sytle-lintBuild pass
make debugManually test
Code Review
Daily build
Login and download artifact at https://github.com/osfans/trime/actions
Additional Info