-
-
Notifications
You must be signed in to change notification settings - Fork 23
ADFA-3375: Support TextInputLayout and TextInputEditText in preview #1312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dara-abijo-adfa
merged 11 commits into
stage
from
ADFA-3375-support-text-input-layout-in-preview
May 18, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d6686a3
fix(ADFA-3375): Exclude child views from generic layout parameters
dara-abijo-adfa 06786b3
feat(ADFA-3375): Support TextInputEditText in the layout editor
dara-abijo-adfa 27f10b7
feat(ADFA-3375): Support TextInputLayout in the layout editor
dara-abijo-adfa ac37b57
fix(ADFA-3375): Prevent the parsing of internal widgets
dara-abijo-adfa 21be9ed
feat(ADFA-3375): Handle text inputs in palette and structure view
dara-abijo-adfa 73806f9
refactor(ADFA-3375): Refactor drawing function
dara-abijo-adfa 12af60c
Merge branch 'stage' into ADFA-3375-support-text-input-layout-in-preview
dara-abijo-adfa 4b53170
refactor(ADFA-3375): Replace Java method with Kotlin
dara-abijo-adfa 831165a
fix(ADFA-3375): Handle NPE defensively
dara-abijo-adfa 10a0ec3
refactor(ADFA-3375): Flatten nested if branches
dara-abijo-adfa e4c755e
Merge branch 'stage' into ADFA-3375-support-text-input-layout-in-preview
dara-abijo-adfa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
4 changes: 0 additions & 4 deletions
4
.../java/org/appdevforall/codeonthego/layouteditor/editor/callers/TextInputLayoutCaller.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
.../org/appdevforall/codeonthego/layouteditor/editor/callers/text/TextInputEditTextCaller.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package org.appdevforall.codeonthego.layouteditor.editor.callers.text | ||
|
|
||
| open class TextInputEditTextCaller : EditTextCaller() { | ||
| // Inherits typical EditText attributes | ||
| } |
38 changes: 38 additions & 0 deletions
38
...va/org/appdevforall/codeonthego/layouteditor/editor/callers/text/TextInputLayoutCaller.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package org.appdevforall.codeonthego.layouteditor.editor.callers.text | ||
|
|
||
| import android.content.Context | ||
| import android.view.View | ||
| import com.google.android.material.textfield.TextInputLayout | ||
| import org.appdevforall.codeonthego.layouteditor.managers.ProjectManager | ||
| import org.appdevforall.codeonthego.layouteditor.managers.ValuesManager | ||
| import org.appdevforall.codeonthego.layouteditor.tools.ValuesResourceParser | ||
|
|
||
| object TextInputLayoutCaller { | ||
|
|
||
| @JvmStatic | ||
| fun setHint(target: View, value: String, context: Context) { | ||
| var finalValue = value | ||
| if (finalValue.startsWith("@string/")) { | ||
| val project = ProjectManager.instance.openedProject ?: return | ||
| finalValue = ValuesManager.getValueFromResources( | ||
| ValuesResourceParser.TAG_STRING, finalValue, project.stringsPath | ||
| ) | ||
| } | ||
| (target as TextInputLayout).hint = finalValue | ||
| } | ||
|
|
||
| @JvmStatic | ||
| fun setHintEnabled(target: View, value: String, context: Context) { | ||
| (target as TextInputLayout).isHintEnabled = value.toBoolean() | ||
| } | ||
|
|
||
| @JvmStatic | ||
| fun setErrorEnabled(target: View, value: String, context: Context) { | ||
| (target as TextInputLayout).isErrorEnabled = value.toBoolean() | ||
| } | ||
|
|
||
| @JvmStatic | ||
| fun setCounterEnabled(target: View, value: String, context: Context) { | ||
| (target as TextInputLayout).isCounterEnabled = value.toBoolean() | ||
| } | ||
| } | ||
43 changes: 43 additions & 0 deletions
43
.../org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputEditTextDesign.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package org.appdevforall.codeonthego.layouteditor.editor.palette.text | ||
|
|
||
| import android.content.Context | ||
| import android.graphics.Canvas | ||
| import com.google.android.material.textfield.TextInputEditText | ||
| import org.appdevforall.codeonthego.layouteditor.utils.Constants | ||
| import org.appdevforall.codeonthego.layouteditor.utils.Utils | ||
|
|
||
| open class TextInputEditTextDesign(context: Context) : TextInputEditText(context) { | ||
|
|
||
| private var drawStrokeEnabled: Boolean = false | ||
| private var isBlueprint: Boolean = false | ||
|
|
||
| override fun dispatchDraw(canvas: Canvas) { | ||
| super.dispatchDraw(canvas) | ||
|
|
||
| if (drawStrokeEnabled) { | ||
| Utils.drawDashPathStroke( | ||
| this, | ||
| canvas, | ||
| if (isBlueprint) Constants.BLUEPRINT_DASH_COLOR else Constants.DESIGN_DASH_COLOR | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| fun setStrokeEnabled(enabled: Boolean) { | ||
| drawStrokeEnabled = enabled | ||
| invalidate() | ||
| } | ||
|
|
||
| override fun draw(canvas: Canvas) { | ||
| if (isBlueprint) { | ||
| Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR) | ||
| } else { | ||
| super.draw(canvas) | ||
| } | ||
| } | ||
|
dara-abijo-adfa marked this conversation as resolved.
|
||
|
|
||
| fun setBlueprint(isBlueprint: Boolean) { | ||
| this.isBlueprint = isBlueprint | ||
| invalidate() | ||
| } | ||
| } | ||
43 changes: 43 additions & 0 deletions
43
...va/org/appdevforall/codeonthego/layouteditor/editor/palette/text/TextInputLayoutDesign.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package org.appdevforall.codeonthego.layouteditor.editor.palette.text | ||
|
|
||
| import android.content.Context | ||
| import android.graphics.Canvas | ||
| import com.google.android.material.textfield.TextInputLayout | ||
| import org.appdevforall.codeonthego.layouteditor.utils.Constants | ||
| import org.appdevforall.codeonthego.layouteditor.utils.Utils | ||
|
|
||
| open class TextInputLayoutDesign(context: Context) : TextInputLayout(context) { | ||
|
|
||
| private var drawStrokeEnabled: Boolean = false | ||
| private var isBlueprint: Boolean = false | ||
|
|
||
| override fun dispatchDraw(canvas: Canvas) { | ||
| super.dispatchDraw(canvas) | ||
|
|
||
| if (drawStrokeEnabled) { | ||
| Utils.drawDashPathStroke( | ||
| this, | ||
| canvas, | ||
| if (isBlueprint) Constants.BLUEPRINT_DASH_COLOR else Constants.DESIGN_DASH_COLOR | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| fun setStrokeEnabled(enabled: Boolean) { | ||
| drawStrokeEnabled = enabled | ||
| invalidate() | ||
| } | ||
|
|
||
| override fun draw(canvas: Canvas) { | ||
| if (isBlueprint) { | ||
| Utils.drawDashPathStroke(this, canvas, Constants.BLUEPRINT_DASH_COLOR) | ||
| } else { | ||
| super.draw(canvas) | ||
| } | ||
| } | ||
|
|
||
| fun setBlueprint(isBlueprint: Boolean) { | ||
| this.isBlueprint = isBlueprint | ||
| invalidate() | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.