Skip to content

Commit

Permalink
Support minLine attribute in the style for multilineTextInputEditText. (
Browse files Browse the repository at this point in the history
#1980)

* Support minLine attribute in the style for multilineTextInputEditText.

* Remove unwanted code.

* Remove unwanted changes.

* Address review comments.

---------

Co-authored-by: Santosh Pingle <[email protected]>
  • Loading branch information
santosh-pingle and Santosh Pingle committed Apr 23, 2023
1 parent db56f2b commit c07e7b8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
12 changes: 12 additions & 0 deletions catalog/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@

<item name="colorOutline">@color/outline_neutral_variant_50</item>

<item
name="questionnaireMultiLineTextInputEditTextStyle"
>@style/Catalog.MultiLineTextInputEditTextStyle
</item>

</style>

<style name="Theme.MyQuestionnaire.DefaultLayout">
Expand Down Expand Up @@ -115,4 +120,11 @@
<item name="cornerRadius">100dp</item>
</style>

<style
name="Catalog.MultiLineTextInputEditTextStyle"
parent="Questionnaire.MultiLineTextInputEditTextStyle"
>
<item name="android:minLines">2</item>
</style>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/text_input_edit_text"
style="?attr/questionnaireTextInputEditTextStyle"
style="?attr/questionnaireMultiLineTextInputEditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:minLines="3"
/>

</com.google.android.material.textfield.TextInputLayout>
Expand Down
6 changes: 6 additions & 0 deletions datacapture/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
<!-- Style for textInputEditText view. -->
<attr name="questionnaireTextInputEditTextStyle" format="reference" />

<!-- Style for multiline textInputEditText view. -->
<attr
name="questionnaireMultiLineTextInputEditTextStyle"
format="reference"
/>

<!-- Style for chip view. -->
<attr name="questionnaireChipStyle" format="reference" />

Expand Down
13 changes: 12 additions & 1 deletion datacapture/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@
</item>
<item
name="questionnaireTextInputEditTextStyle"
>@style/TextAppearance.Material3.BodyLarge
>@style/Questionnaire.TextInputEditTextStyle
</item>
<item
name="questionnaireMultiLineTextInputEditTextStyle"
>@style/Questionnaire.MultiLineTextInputEditTextStyle
</item>
<item
name="questionnaireChipStyle"
>@style/Widget.Material3.Chip.Input</item>
Expand Down Expand Up @@ -250,6 +254,13 @@
<item name="boxStrokeColor">@color/box_stroke_color</item>
</style>

<style
name="Questionnaire.MultiLineTextInputEditTextStyle"
parent="Questionnaire.TextInputEditTextStyle"
>
<item name="android:minLines">3</item>
</style>

<style
name="Questionnaire.TextInputEditTextStyle"
parent="ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
Expand Down

0 comments on commit c07e7b8

Please sign in to comment.