splitwise / TokenAutoComplete

Gmail style MultiAutoCompleteTextView for Android
Apache License 2.0
1.3k stars 384 forks source link

Is there any way to show tokens on the first line and show some tokens on 2nd line with count of remaining tokens #396

Closed bijobaby-2009 closed 4 years ago

bijobaby-2009 commented 4 years ago

img_20191120

mgod commented 4 years ago

I don't think so. The way it's currently implemented, the system that figures out how to put the count in doesn't have a way to deal with multiple lines of text and it would not be easy to add that functionality.

bijobaby-2009 commented 4 years ago

Thanks for your reply . My problem is when I add a long text as token and add few small length tokens.

img_20191121

After focus change

ipmsgclip_r_1574308915_0

Only count is showing on the first line. When first token is a long text. Any solution is available for that? Can I show at least one token with count when a long text token is first entered?

My Token xml is

<com.app.example.TokenAutoComplete.TokenTextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/token_background" android:textSize="14sp" android:maxLines="1" android:ellipsize="end" android:padding="8dp"/>

mgod commented 4 years ago

You could set a maxWidth on your token that is small enough to allow a token and the +2 to show up on the first line.

I'll also note that you might find it better to use setPrefix("To") on the token field rather than having a separate "To" label depending on your layout needs.

bijobaby-2009 commented 4 years ago

Thanks