Prevent keyboard to pop over result pages.
This commit is contained in:
parent
b9e9272336
commit
e4da4af3f3
|
@ -12,7 +12,6 @@ import com.github.apognu.otter.fragments.ArtistsFragment
|
||||||
import com.github.apognu.otter.repositories.*
|
import com.github.apognu.otter.repositories.*
|
||||||
import com.github.apognu.otter.utils.Album
|
import com.github.apognu.otter.utils.Album
|
||||||
import com.github.apognu.otter.utils.Artist
|
import com.github.apognu.otter.utils.Artist
|
||||||
import com.github.apognu.otter.utils.log
|
|
||||||
import com.github.apognu.otter.utils.untilNetwork
|
import com.github.apognu.otter.utils.untilNetwork
|
||||||
import kotlinx.android.synthetic.main.activity_search.*
|
import kotlinx.android.synthetic.main.activity_search.*
|
||||||
import java.net.URLEncoder
|
import java.net.URLEncoder
|
||||||
|
@ -38,6 +37,8 @@ class SearchActivity : AppCompatActivity() {
|
||||||
results.layoutManager = LinearLayoutManager(this)
|
results.layoutManager = LinearLayoutManager(this)
|
||||||
results.adapter = it
|
results.adapter = it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
search.requestFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@ -48,8 +49,6 @@ class SearchActivity : AppCompatActivity() {
|
||||||
tracksRepository = TracksSearchRepository(this@SearchActivity, "")
|
tracksRepository = TracksSearchRepository(this@SearchActivity, "")
|
||||||
favoritesRepository = FavoritesRepository(this@SearchActivity)
|
favoritesRepository = FavoritesRepository(this@SearchActivity)
|
||||||
|
|
||||||
search.requestFocus()
|
|
||||||
|
|
||||||
search.setOnQueryTextListener(object : androidx.appcompat.widget.SearchView.OnQueryTextListener {
|
search.setOnQueryTextListener(object : androidx.appcompat.widget.SearchView.OnQueryTextListener {
|
||||||
override fun onQueryTextSubmit(rawQuery: String?): Boolean {
|
override fun onQueryTextSubmit(rawQuery: String?): Boolean {
|
||||||
search.clearFocus()
|
search.clearFocus()
|
||||||
|
@ -79,7 +78,7 @@ class SearchActivity : AppCompatActivity() {
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
albumsRepository.fetch(Repository.Origin.Network.origin).untilNetwork(lifecycleScope) { albums, _, _ ,_ ->
|
albumsRepository.fetch(Repository.Origin.Network.origin).untilNetwork(lifecycleScope) { albums, _, _, _ ->
|
||||||
done++
|
done++
|
||||||
|
|
||||||
adapter.albums.addAll(albums)
|
adapter.albums.addAll(albums)
|
||||||
|
|
|
@ -150,10 +150,7 @@ class TracksFragment : OtterFragment<Track, TracksAdapter>() {
|
||||||
lifecycleScope.launch(Main) {
|
lifecycleScope.launch(Main) {
|
||||||
CommandBus.get().collect { command ->
|
CommandBus.get().collect { command ->
|
||||||
when (command) {
|
when (command) {
|
||||||
is Command.RefreshTrack -> {
|
is Command.RefreshTrack -> refreshCurrentTrack(command.track)
|
||||||
log("${command.track?.title} -> ${command.track?.favorite}")
|
|
||||||
refreshCurrentTrack(command.track)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue