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
119
and <code>setMentionAdapter()</code>.
120
120
</p>
121
-
121
+
122
122
<pre><codeclass="language-java">ArrayAdapter<Hashtag> hashtagAdapter = new HashtagAdapter(getContext());
123
123
hashtagAdapter.add(new Hashtag("yolo"));
124
124
hashtagAdapter.add(new Hashtag("swag", 500));
@@ -136,18 +136,18 @@ <h3>Auto-complete</h3>
136
136
);
137
137
textView.setMentionAdapter(mentionAdapter);
138
138
</code></pre>
139
-
139
+
140
140
<p>
141
141
To customize hashtag or mention adapter, create a custom adapter using
142
142
customized <code>SocialAdapter</code> or write your own <code>ArrayAdapter</code>.
143
143
</p>
144
-
144
+
145
145
<blockquote>
146
-
146
+
147
147
<p>Custom adapters are experimental, see sample for example.</p>
148
-
148
+
149
149
</blockquote>
150
-
150
+
151
151
<pre><codeclass="language-java">public class Person {
152
152
public final String name;
153
153
@@ -179,15 +179,15 @@ <h3>Auto-complete</h3>
179
179
// and of course, filtering logic
180
180
}
181
181
</code></pre>
182
-
182
+
183
183
<p>Then, use the custom adapter.</p>
184
-
184
+
185
185
<pre><codeclass="language-java">ArrayAdapter<Person> adapter = new PersonAdapter(getContext());
186
186
adapter.add(personA);
187
187
adapter.add(personB);
188
188
textView.setMentionAdapter(adapter);
189
189
</code></pre>
190
-
190
+
191
191
<footerclass="site-footer">
192
192
<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