klint cleaning

This commit is contained in:
Valere 2019-10-28 15:12:49 +01:00
parent 199456487c
commit de4c389c76
5 changed files with 5 additions and 14 deletions

View file

@ -41,6 +41,5 @@ class EmojiChooserFragment : VectorBaseFragment() {
it.adapter = viewModel.adapter
it.adapter?.notifyDataSetChanged()
}
}
}

View file

@ -182,7 +182,6 @@ class EmojiReactionPickerActivity : VectorBaseActivity(),
newText?.let { emitter.onNext(it) }
return true
}
})
}

View file

@ -23,12 +23,10 @@ import im.vector.riotx.core.resources.StringProvider
import im.vector.riotx.core.ui.list.genericFooterItem
import javax.inject.Inject
class EmojiSearchResultController @Inject constructor(val stringProvider: StringProvider,
fontProvider: EmojiCompatFontProvider)
: TypedEpoxyController<EmojiSearchResultViewState>() {
var emojiTypeface: Typeface? = fontProvider.typeface
init {
@ -39,7 +37,6 @@ class EmojiSearchResultController @Inject constructor(val stringProvider: String
})
}
var listener: ReactionClickListener? = null
override fun buildModels(data: EmojiSearchResultViewState?) {
@ -47,20 +44,20 @@ class EmojiSearchResultController @Inject constructor(val stringProvider: String
if (results.isEmpty()) {
if (data.query.isEmpty()) {
//display 'Type something to find'
// display 'Type something to find'
genericFooterItem {
id("type.query.item")
text(stringProvider.getString(R.string.reaction_search_type_hint))
}
} else {
//Display no search Results
// Display no search Results
genericFooterItem {
id("no.results.item")
text(stringProvider.getString(R.string.no_result_placeholder))
}
}
} else {
//Build the search results
// Build the search results
results.forEach {
emojiSearchResultItem {
id(it.name)
@ -70,8 +67,6 @@ class EmojiSearchResultController @Inject constructor(val stringProvider: String
onClickListener(listener)
}
}
}
}
}

View file

@ -23,7 +23,6 @@ import com.airbnb.epoxy.EpoxyModelWithHolder
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
@EpoxyModelClass(layout = R.layout.item_emoji_result)
abstract class EmojiSearchResultItem : EpoxyModelWithHolder<EmojiSearchResultItem.Holder>() {
@ -41,7 +40,7 @@ abstract class EmojiSearchResultItem : EpoxyModelWithHolder<EmojiSearchResultIte
override fun bind(holder: Holder) {
super.bind(holder)
//TODO use query string to highlight the matched query in name and keywords?
// TODO use query string to highlight the matched query in name and keywords?
holder.emojiText.text = emojiItem.emojiString()
holder.emojiText.typeface = emojiTypeFace ?: Typeface.DEFAULT
holder.emojiNameText.text = emojiItem.name
@ -57,4 +56,3 @@ abstract class EmojiSearchResultItem : EpoxyModelWithHolder<EmojiSearchResultIte
val emojiKeywordText by bind<TextView>(R.id.item_emoji_keyword)
}
}

View file

@ -47,7 +47,7 @@ class EmojiSearchResultViewModel(val dataSource: EmojiDataSource, initialState:
companion object : MvRxViewModelFactory<EmojiSearchResultViewModel, EmojiSearchResultViewState> {
override fun create(viewModelContext: ViewModelContext, state: EmojiSearchResultViewState): EmojiSearchResultViewModel? {
//TODO get the data source from activity? share it with other fragment
// TODO get the data source from activity? share it with other fragment
return EmojiSearchResultViewModel(EmojiDataSource(viewModelContext.activity), state)
}
}