Skip to content

Commit e5b18c0

Browse files
authored
Merge pull request #2 from ravidsrk/patch-1
Updated readme with syntax highlighting.
2 parents 7ce76a2 + a00b2c3 commit e5b18c0

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,24 @@ Hence why we created this simple component :)
3535

3636
In exactly the same way as the support library! Simply wrap an edit text field like so:
3737

38-
<org.buffer.android.buffertextinputlayout.BufferTextInputLayout
39-
android:layout_width="match_parent"
40-
android:layout_height="wrap_content"
41-
app:counterEnabled="true"
42-
app:counterMaxLength="10"
43-
app:counterOverflowTextAppearance="@style/counterOverride"
44-
app:counterTextAppearance="@style/counterText"
45-
app:hintEnabled="true"
46-
app:counterMode="ascending">
47-
48-
<EditText
49-
android:layout_width="match_parent"
50-
android:layout_height="wrap_content"
51-
android:hint="@string/text_hint" />
52-
53-
</org.buffer.android.buffertextinputlayout.BufferTextInputLayout>
54-
38+
```xml
39+
<org.buffer.android.buffertextinputlayout.BufferTextInputLayout
40+
android:layout_width="match_parent"
41+
android:layout_height="wrap_content"
42+
app:counterEnabled="true"
43+
app:counterMaxLength="10"
44+
app:counterOverflowTextAppearance="@style/counterOverride"
45+
app:counterTextAppearance="@style/counterText"
46+
app:hintEnabled="true"
47+
app:counterMode="ascending">
48+
49+
<EditText
50+
android:layout_width="match_parent"
51+
android:layout_height="wrap_content"
52+
android:hint="@string/text_hint" />
53+
54+
</org.buffer.android.buffertextinputlayout.BufferTextInputLayout>
55+
```
5556

5657
#Setting attributes via XML
5758

@@ -62,8 +63,10 @@ In our XML layout, we can set two extra attributes for the BufferTextInputLayout
6263

6364
e.g
6465

65-
app:displayFromCount="5"
66-
app:counterMode="descending"
66+
```xml
67+
app:displayFromCount="5"
68+
app:counterMode="descending"
69+
```
6770

6871

6972
#Setting attributes programmatically
@@ -72,6 +75,7 @@ e.g
7275
- setCharactersRemainingUntilCounterDisplay(int remainingCharacters) -> Set the value for which how many characters should be remaining until the counter becomes visible
7376

7477
e.g.
75-
76-
bufferTextInputLayout.setCounterMode(CounterMode.DESCENDING);
77-
bufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40);
78+
```java
79+
bufferTextInputLayout.setCounterMode(CounterMode.DESCENDING);
80+
bufferTextInputLayout.setCharactersRemainingUntilCounterDisplay(40);
81+
```

0 commit comments

Comments
 (0)