File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,7 @@ class MainActivity : SimpleActivity() {
143143 main_menu.setupMenu()
144144
145145 main_menu.onSearchClosedListener = {
146- search_holder.animate().alpha(0f ).setDuration(SHORT_ANIMATION_DURATION ).withEndAction {
147- search_holder.beGone()
148- searchTextChanged(" " , true )
149- }.start()
146+ fadeOutSearch()
150147 }
151148
152149 main_menu.onSearchTextChangedListener = { text ->
@@ -155,10 +152,7 @@ class MainActivity : SimpleActivity() {
155152 search_holder.fadeIn()
156153 }
157154 } else {
158- search_holder.animate().alpha(0f ).setDuration(SHORT_ANIMATION_DURATION ).withEndAction {
159- search_holder.beGone()
160- searchTextChanged(" " , true )
161- }.start()
155+ fadeOutSearch()
162156 }
163157 searchTextChanged(text)
164158 }
@@ -384,6 +378,13 @@ class MainActivity : SimpleActivity() {
384378 }
385379 }
386380
381+ private fun fadeOutSearch () {
382+ search_holder.animate().alpha(0f ).setDuration(SHORT_ANIMATION_DURATION ).withEndAction {
383+ search_holder.beGone()
384+ searchTextChanged(" " , true )
385+ }.start()
386+ }
387+
387388 @SuppressLint(" NotifyDataSetChanged" )
388389 private fun notifyDatasetChanged () {
389390 getOrCreateConversationsAdapter().notifyDataSetChanged()
You can’t perform that action at this time.
0 commit comments