Hello,
I have been working to re-work and launch a better trivia app that does not include 15+ activity modules. Im trying to make it lean and mean so when i add content it will not be bulky.
So i began to play with Panels and got to the point where
Where i can click next after the above module and load another episode of my trivia game as below indicates
I have run into several issues where i have seemed to be close to solving but not exactly solving it. I will list them for input or guidance.
1. I have attached a screenshot. My goal is to have a drop down at the top outside of the panel so people can choose the episode within that season to play. As you can see by the screenshot it holds over the trivia. I cant seem to find where in my code the panel is setup for full view. The next button at the button does not seem to be an issue. I even moved Episode three next to the next button and no help.
2. It seems that i would have to create for instance this season of trivia has 22 epsiodes.. So i would need to create 22 panels. question labals, curs labels and next buttons. With that i would have to as seen in the second piece of code remove every single view from the activity for it to not overlap and give issues. This is where i think i might be able to use class's and load it?
3. Going to the extreme end is their a way i can make it even more dynamic and just use the same panel and make the database code load Instead of episode 2 go to another episode without doing number 2?
I know i have done this in javascript programming but that was well a decade ago.
Thoughts? suggestions?
I thank this community as you are always helpful and the search is awesome i have gotten so many ideas and implementation ideas.
I have been working to re-work and launch a better trivia app that does not include 15+ activity modules. Im trying to make it lean and mean so when i add content it will not be bulky.
So i began to play with Panels and got to the point where
B4X:
Activity.LoadLayout("S1E1")
'Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "jerichobackground.png"))
rbtAnswer(0).Initialize("rbtAnswer")
rbtAnswer(0).Tag = 0
panel1.AddView(rbtAnswer(0), 10dip, 5dip, 450dip, 75dip)
rbtAnswer(1).Initialize("rbtAnswer")
rbtAnswer(1).Tag = 1
panel1.AddView(rbtAnswer(1), 10dip, 50dip, 450dip, 75dip)
rbtAnswer(2).Initialize("rbtAnswer")
rbtAnswer(2).Tag = 2
panel1.AddView(rbtAnswer(2), 10dip, 95dip, 450dip, 75dip)
If File.Exists(File.DirDefaultExternal, "SeasonOne.db") = False Then
File.Copy(File.DirAssets, "SeasonOne.db", File.DirDefaultExternal, "SeasonOne.db")
End If
QuestionList.Initialize
AnswerList1.Initialize
AnswerList2.Initialize
AnswerList3.Initialize
RightIndex.Initialize
xSQL.Initialize(File.DirDefaultExternal, "SeasonOne.db", True)
xCursor = xSQL.ExecQuery("SELECT * FROM One ")
Log(xCursor.RowCount)
For i = 0 To xCursor.RowCount - 1
xCursor.Position = i
Log(xCursor.GetString("Question"))
Log(xCursor.GetString("ChoiceOne"))
Log(xCursor.GetString("ChoiceTwo"))
Log(xCursor.GetString("ChoiceThree"))
Log(xCursor.GetString("ansind"))
Log(" ")
QuestionList.Add(xCursor.GetString("Question"))
AnswerList1.Add(xCursor.GetString("ChoiceOne"))
AnswerList2.Add(xCursor.GetString("ChoiceTwo"))
AnswerList3.Add(xCursor.GetString("ChoiceThree"))
RightIndex.Add(xCursor.GetInt("ansind"))
Next
xCursor.Close
btnNext_Click
Button1.SendToBack
Where i can click next after the above module and load another episode of my trivia game as below indicates
B4X:
panel1.RemoveView
btnNext.RemoveView
lblQuestion.RemoveView'
CursPosition.RemoveView
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "jerichobackground.png"))
rbtAnswer(0).Initialize("rbtAnswer")
rbtAnswer(0).Tag = 0
Panel2.AddView(rbtAnswer(0), 10dip, 5dip, 450dip, 75dip)
rbtAnswer(1).Initialize("rbtAnswer")
rbtAnswer(1).Tag = 1
Panel2.AddView(rbtAnswer(1), 10dip, 50dip, 450dip, 75dip)
rbtAnswer(2).Initialize("rbtAnswer")
rbtAnswer(2).Tag = 2
Panel2.AddView(rbtAnswer(2), 10dip, 95dip, 450dip, 75dip)
If File.Exists(File.DirDefaultExternal, "SeasonOne.db") = False Then
File.Copy(File.DirAssets, "SeasonOne.db", File.DirDefaultExternal, "SeasonOne.db")
End If
QuestionList.Initialize
AnswerList1.Initialize
AnswerList2.Initialize
AnswerList3.Initialize
RightIndex.Initialize
xSQL.Initialize(File.DirDefaultExternal, "SeasonOne.db", True)
xCursor = xSQL.ExecQuery("SELECT * FROM Three ")
Log(xCursor.RowCount)
For i = 0 To xCursor.RowCount - 1
xCursor.Position = i
Log(xCursor.GetString("Question"))
Log(xCursor.GetString("ChoiceOne"))
Log(xCursor.GetString("ChoiceTwo"))
Log(xCursor.GetString("ChoiceThree"))
Log(xCursor.GetString("ansind"))
Log(" ")
QuestionList.Add(xCursor.GetString("Question"))
AnswerList1.Add(xCursor.GetString("ChoiceOne"))
AnswerList2.Add(xCursor.GetString("ChoiceTwo"))
AnswerList3.Add(xCursor.GetString("ChoiceThree"))
RightIndex.Add(xCursor.GetInt("ansind"))
Next
xCursor.Close
Button1_Click
I have run into several issues where i have seemed to be close to solving but not exactly solving it. I will list them for input or guidance.
1. I have attached a screenshot. My goal is to have a drop down at the top outside of the panel so people can choose the episode within that season to play. As you can see by the screenshot it holds over the trivia. I cant seem to find where in my code the panel is setup for full view. The next button at the button does not seem to be an issue. I even moved Episode three next to the next button and no help.
2. It seems that i would have to create for instance this season of trivia has 22 epsiodes.. So i would need to create 22 panels. question labals, curs labels and next buttons. With that i would have to as seen in the second piece of code remove every single view from the activity for it to not overlap and give issues. This is where i think i might be able to use class's and load it?
3. Going to the extreme end is their a way i can make it even more dynamic and just use the same panel and make the database code load Instead of episode 2 go to another episode without doing number 2?
I know i have done this in javascript programming but that was well a decade ago.
Thoughts? suggestions?
I thank this community as you are always helpful and the search is awesome i have gotten so many ideas and implementation ideas.