Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
development
Commits
88436bd9
Commit
88436bd9
authored
9 years ago
by
Chris Banes
Browse files
Options
Download
Email Patches
Plain Diff
Add demo for TextInputLayout's counter
Change-Id: I3a2453b6d5ad3d5ea2abd5de66c95a7db0bd6f83
parent
3848c332
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
samples/SupportDesignDemos/res/layout/design_text_input.xml
samples/SupportDesignDemos/res/layout/design_text_input.xml
+31
-9
samples/SupportDesignDemos/res/values/strings.xml
samples/SupportDesignDemos/res/values/strings.xml
+1
-0
No files found.
samples/SupportDesignDemos/res/layout/design_text_input.xml
View file @
88436bd9
...
...
@@ -36,6 +36,24 @@
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/show_error"
android:onClick=
"showError"
/>
<Button
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/clear_error"
android:onClick=
"clearError"
/>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/input_email"
android:layout_width=
"match_parent"
...
...
@@ -51,16 +69,20 @@
</android.support.design.widget.TextInputLayout>
<Button
android:layout_width=
"wrap_content"
<android.support.design.widget.TextInputLayout
android:id=
"@+id/input_description"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/show_error"
android:onClick=
"showError"
/>
android:layout_marginTop=
"8dp"
app:counterEnabled=
"true"
app:counterMaxLength=
"30"
>
<Button
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/clear_error"
android:onClick=
"clearError"
/>
<EditText
android:id=
"@+id/edit_description"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"@string/form_description"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
samples/SupportDesignDemos/res/values/strings.xml
View file @
88436bd9
...
...
@@ -52,6 +52,7 @@
<string
name=
"form_username"
>
Username
</string>
<string
name=
"form_email"
>
Email address
</string>
<string
name=
"form_description"
>
Description
</string>
<string
name=
"show_error"
>
Show error
</string>
<string
name=
"clear_error"
>
Clear error
</string>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment