hanggrian / socialview

Android TextView and EditText with hashtag, mention, and hyperlink support
http://hanggrian.com/socialview/
Apache License 2.0
323 stars 81 forks source link

fix formating bug #47

Closed stanbar closed 6 years ago

stanbar commented 6 years ago

getQuantityString require twice if you want formating From docs

When using the getQuantityString() method, you need to pass the count twice if your string includes string formatting with a number. For example, for the string %d songs found, the first count parameter selects the appropriate plural string and the second count parameter is inserted into the %d placeholder. If your plural strings do not include string formatting, you don't need to pass the third parameter to getQuantityString.

and you forgot to set the visibility if the hashtag.count is not null

hanggrian commented 6 years ago

and you forgot to set the visibility if the hashtag.count is not null

This is an interesting topic. When a count is not null and 0, should count view also be gone?

stanbar commented 6 years ago

Yes, I would like to show 0 count as well

hanggrian commented 6 years ago

hashtag.count null checks combined, and merged. Thanks for your contribution!

stanbar commented 5 years ago

Hello my friend. The same thing happens in MentionArrayAdapter You set the text

            if (!mention.displayname.isNullOrEmpty()) {
                holder.displaynameView.text = mention.displayname
            }

but doesn't change visibility, which is always

        <TextView
            android:id="@+id/socialview_mention_displayname"
            style="?android:attr/dropDownItemStyle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="marquee"
            android:singleLine="true"
            android:textAppearance="?textAppearanceLargePopupMenu"
            android:visibility="gone" />

gone

hanggrian commented 5 years ago

I will investigate this, but I warn you, it could take some time. This library is undergoing downgrade to Java.

stanbar commented 5 years ago

Why is that ? :O

hanggrian commented 5 years ago

I began to question that myself. But I'm supposed it's for lower dependencies since not everyone uses Kotlin. And this is a fairly simple project, Kotlin might have been an overkill.