List tabs (#1570)
* List tabs * Add comment * Move decoder part to TabData.createTabDataFromId * Fix drawable tint * Use dedicated view for list picker * Error log * Fix logging Co-Authored-By: Konrad Pozniak <connyduck@users.noreply.github.com> * Fix tint color Co-Authored-By: Konrad Pozniak <connyduck@users.noreply.github.com> * Fix missing import * Move encoding part too * Fix comment * Fix decoder * Revert "Fix decoder" This reverts commit fdc45aac9c113348f8740e6692d2d8e9ace14f7f. * Revert "Fix comment" This reverts commit 704b4e6d2e5545d5f2d20c9bc6bc276d6257d119. * Revert "Move encoding part too" This reverts commit 32e77346ff98ae1133e76ab6dfd880b26171005e. * Revert "Move decoder part to TabData.createTabDataFromId" This reverts commit d1cd2070ab564d2e33874225272a71f0904d681e.
This commit is contained in:
parent
bbeb46adaf
commit
d6ae071a09
9 changed files with 125 additions and 5 deletions
|
@ -28,6 +28,8 @@ import com.keylesspalace.tusky.entity.Poll
|
|||
import com.keylesspalace.tusky.entity.Status
|
||||
import com.keylesspalace.tusky.json.SpannedTypeAdapter
|
||||
import com.keylesspalace.tusky.util.HtmlUtils
|
||||
import java.net.URLDecoder
|
||||
import java.net.URLEncoder
|
||||
import java.util.*
|
||||
|
||||
class Converters {
|
||||
|
@ -61,13 +63,14 @@ class Converters {
|
|||
return str?.split(";")
|
||||
?.map {
|
||||
val data = it.split(":")
|
||||
createTabDataFromId(data[0], data.drop(1))
|
||||
createTabDataFromId(data[0], data.drop(1).map { s -> URLDecoder.decode(s, "UTF-8") })
|
||||
}
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun tabDataToString(tabData: List<TabData>?): String? {
|
||||
return tabData?.joinToString(";") { it.id + ":" + it.arguments.joinToString(":") }
|
||||
// List name may include ":"
|
||||
return tabData?.joinToString(";") { it.id + ":" + it.arguments.joinToString(":") { s -> URLEncoder.encode(s, "UTF-8") } }
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue