Making the Hilltop Sunset App Part 2: Problem Solving and Creating a Song List

Oct 6, 2015 ryan's Blog


Well, it turns out I was right; I was able to make lists delete entries as Id set out to do at the end of my last post! It was a bit more complicated than anything else I had done: I had to combine a Remove List Item block with an Index Item block where the indexed thing was joined to a block listing my Wheel-O-Songs button with its current text. That way, it would remove that item from the specified list! Once that was accomplished, I figured itd be good to include some text letting the user know theyve reached the end of the list. And after that, I was done! ...but then I started thinking of some other additions for my lackluster app. Before I knew it, I had a whole slew of upgrades to the app that I had never planning on incorporating, including a song list from two albums of mine, with lyrics; two additional randomizer buttons that selected only songs from a specified album; and a link to my main website. Because of the new direction I was taking my app, I figured a Home page would benefit me, so I made a new screen, included a label with the title Hilltop Sunset (the name of my music project) and added 3 buttons: Visit Main Website, View Song List, and Wheel-O-Songs. After this, I made corresponding screens for those buttons to redirect when clicked. I really wanted to include a list of songs and their lyrics because people often ask to know what my lyrics are, whether because theyre hearing a song for the first time and want to make sure they catch every word or because they want to sing along. To do this, I first experimented with some of the basic list options available in the Designer tools, but after testing ListPicker and ListView I decided that neither could adequately accomplish what I wanted. I ended up making individual Buttons for every song--at this point there were 22 of them instead of just the 16 from Part 1--and sorted them by album. The next task was to figure out how I was going to include the lyrics. To do this, I tried making a label and changing its text to a huge body of lyrics when a specified song was clicked. Unfortunately I ran into several problems, mostly that the text ran straight off the phones window because there didnt seem to be any way to put the text on multiple lines. When I added a textbox instead of a label, the multiline option became available from the Design window, but the formatting was atrocious; the whole song was just a block of text mushed together with no defined line breaks. After some quick research, I discovered that including \n in the text created a line break! I went through and typed out my lyrics, including \n with every break, and it worked like magic! I was so thrilled to finally see my lyrics--well-formatted--displayed whenever I clicked a song. The lyrics popped up directly underneath the name of the album the song was from, just as they were supposed to. The only thing about using a textbox instead of a label is that its able to be edited in the app. This was fine in my instance, since the changes arent ever saved when input, and the app was intended for personal use anyway. But if you dont want people having the ability to edit your text, perhaps youll be better off finding another way to work around the limitations. Next week Ill go over how I linked my website, added the album-specific randomizers, and changed the colors of...everything. Because the default colors are very harsh and clashing. Stay tuned!