You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To display suggestions, it is required to <code>setHashtagAdapter()</code>
119
118
and <code>setMentionAdapter()</code>.
120
119
</p>
121
-
120
+
122
121
<pre><codeclass="language-java">ArrayAdapter<Hashtag> hashtagAdapter = new HashtagAdapter(getContext());
123
122
hashtagAdapter.add(new Hashtag("yolo"));
124
123
hashtagAdapter.add(new Hashtag("swag", 500));
@@ -131,23 +130,23 @@ <h3>Auto-complete</h3>
131
130
new Mention(
132
131
"johndoe",
133
132
"John Doe",
134
-
"url://to.profile",
133
+
"url://to.profile"
135
134
)
136
135
);
137
136
textView.setMentionAdapter(mentionAdapter);
138
137
</code></pre>
139
-
138
+
140
139
<p>
141
140
To customize hashtag or mention adapter, create a custom adapter using
142
141
customized <code>SocialAdapter</code> or write your own <code>ArrayAdapter</code>.
143
142
</p>
144
-
143
+
145
144
<blockquote>
146
-
145
+
147
146
<p>Custom adapters are experimental, see sample for example.</p>
148
-
147
+
149
148
</blockquote>
150
-
149
+
151
150
<pre><codeclass="language-java">public class Person {
152
151
public final String name;
153
152
@@ -179,15 +178,15 @@ <h3>Auto-complete</h3>
179
178
// and of course, filtering logic
180
179
}
181
180
</code></pre>
182
-
181
+
183
182
<p>Then, use the custom adapter.</p>
184
-
183
+
185
184
<pre><codeclass="language-java">ArrayAdapter<Person> adapter = new PersonAdapter(getContext());
186
185
adapter.add(personA);
187
186
adapter.add(personB);
188
187
textView.setMentionAdapter(adapter);
189
188
</code></pre>
190
-
189
+
191
190
<footerclass="site-footer">
192
191
<spanclass="site-footer-owner"><ahref="https://github.com/hanggrian/socialview/">socialview</a> is maintained by <ahref="https://github.com/hanggrian/">Hendra Anggrian</a></span><spanclass="site-footer-credits">Hosted on GitHub Pages — Theme by <ahref="https://github.com/jasonlong/cayman-theme/">jasonlong</a></span>
0 commit comments