Преглед изворни кода

fixed initialization error (no postValue!), last played works again now

yattoz пре 4 година
родитељ
комит
931b46c496
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt

+ 4 - 2
app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt Прегледај датотеку

1
 package fr.forum_thalie.tsumugi.playerstore
1
 package fr.forum_thalie.tsumugi.playerstore
2
 
2
 
3
 import androidx.lifecycle.MutableLiveData
3
 import androidx.lifecycle.MutableLiveData
4
+import fr.forum_thalie.tsumugi.noConnectionValue
4
 
5
 
5
 class Song(artistTitle: String = "", _id : Int = 0) {
6
 class Song(artistTitle: String = "", _id : Int = 0) {
6
 
7
 
35
                 title.value = data.substring(hyphenPos + 3)
36
                 title.value = data.substring(hyphenPos + 3)
36
         } catch (e: Exception) {
37
         } catch (e: Exception) {
37
             if (artist.value != "")
38
             if (artist.value != "")
38
-                artist.postValue("")
39
+                artist.value = ""
39
             if (title.value != data)
40
             if (title.value != data)
40
-                title.postValue(data)
41
+                title.value = data
42
+            // else : do nothing
41
         }
43
         }
42
     }
44
     }
43
 
45