Browse Source

Prevent keyboard to pop over result pages.

housekeeping/remove-warnings
Antoine POPINEAU 4 years ago
parent
commit
e4da4af3f3
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
  1. 7
      app/src/main/java/com/github/apognu/otter/activities/SearchActivity.kt
  2. 5
      app/src/main/java/com/github/apognu/otter/fragments/TracksFragment.kt

7
app/src/main/java/com/github/apognu/otter/activities/SearchActivity.kt

@ -12,7 +12,6 @@ import com.github.apognu.otter.fragments.ArtistsFragment @@ -12,7 +12,6 @@ import com.github.apognu.otter.fragments.ArtistsFragment
import com.github.apognu.otter.repositories.*
import com.github.apognu.otter.utils.Album
import com.github.apognu.otter.utils.Artist
import com.github.apognu.otter.utils.log
import com.github.apognu.otter.utils.untilNetwork
import kotlinx.android.synthetic.main.activity_search.*
import java.net.URLEncoder
@ -38,6 +37,8 @@ class SearchActivity : AppCompatActivity() { @@ -38,6 +37,8 @@ class SearchActivity : AppCompatActivity() {
results.layoutManager = LinearLayoutManager(this)
results.adapter = it
}
search.requestFocus()
}
override fun onResume() {
@ -48,8 +49,6 @@ class SearchActivity : AppCompatActivity() { @@ -48,8 +49,6 @@ class SearchActivity : AppCompatActivity() {
tracksRepository = TracksSearchRepository(this@SearchActivity, "")
favoritesRepository = FavoritesRepository(this@SearchActivity)
search.requestFocus()
search.setOnQueryTextListener(object : androidx.appcompat.widget.SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(rawQuery: String?): Boolean {
search.clearFocus()
@ -79,7 +78,7 @@ class SearchActivity : AppCompatActivity() { @@ -79,7 +78,7 @@ class SearchActivity : AppCompatActivity() {
refresh()
}
albumsRepository.fetch(Repository.Origin.Network.origin).untilNetwork(lifecycleScope) { albums, _, _ ,_ ->
albumsRepository.fetch(Repository.Origin.Network.origin).untilNetwork(lifecycleScope) { albums, _, _, _ ->
done++
adapter.albums.addAll(albums)

5
app/src/main/java/com/github/apognu/otter/fragments/TracksFragment.kt

@ -150,10 +150,7 @@ class TracksFragment : OtterFragment<Track, TracksAdapter>() { @@ -150,10 +150,7 @@ class TracksFragment : OtterFragment<Track, TracksAdapter>() {
lifecycleScope.launch(Main) {
CommandBus.get().collect { command ->
when (command) {
is Command.RefreshTrack -> {
log("${command.track?.title} -> ${command.track?.favorite}")
refreshCurrentTrack(command.track)
}
is Command.RefreshTrack -> refreshCurrentTrack(command.track)
}
}
}

Loading…
Cancel
Save