Browse Source

Limit track info to one line on now playing preview. Properly encode search terms.

housekeeping/remove-warnings
Antoine POPINEAU 5 years ago
parent
commit
b735e20fbd
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
  1. 1
      .fdroid.yml
  2. 5
      app/src/main/java/com/github/apognu/otter/activities/SearchActivity.kt
  3. 5
      app/src/main/res/layout/partial_now_playing.xml

1
.fdroid.yml

@ -0,0 +1 @@ @@ -0,0 +1 @@
../fdroid/fdroiddata/metadata/com.github.apognu.otter.yml

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

@ -10,6 +10,7 @@ import com.github.apognu.otter.repositories.Repository @@ -10,6 +10,7 @@ import com.github.apognu.otter.repositories.Repository
import com.github.apognu.otter.repositories.SearchRepository
import com.github.apognu.otter.utils.untilNetwork
import kotlinx.android.synthetic.main.activity_search.*
import java.net.URLEncoder
import java.util.*
class SearchActivity : AppCompatActivity() {
@ -36,7 +37,9 @@ class SearchActivity : AppCompatActivity() { @@ -36,7 +37,9 @@ class SearchActivity : AppCompatActivity() {
search.setOnQueryTextListener(object : androidx.appcompat.widget.SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean {
query?.let {
repository = SearchRepository(this@SearchActivity, it.toLowerCase(Locale.ROOT))
val query = URLEncoder.encode(it, "UTF-8")
repository = SearchRepository(this@SearchActivity, query.toLowerCase(Locale.ROOT))
search_spinner.visibility = View.VISIBLE
search_no_results.visibility = View.GONE

5
app/src/main/res/layout/partial_now_playing.xml

@ -53,6 +53,7 @@ @@ -53,6 +53,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:layout_weight="2"
android:orientation="vertical">
@ -60,6 +61,8 @@ @@ -60,6 +61,8 @@
android:id="@+id/now_playing_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/itemTitle"
tools:text="Supermassive Black Hole" />
@ -67,6 +70,8 @@ @@ -67,6 +70,8 @@
android:id="@+id/now_playing_album"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
tools:text="Muse" />
</LinearLayout>

Loading…
Cancel
Save