Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Game Client Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Akamu
Game Client Android
Commits
6333d227
Commit
6333d227
authored
Oct 31, 2020
by
Niklas Fix
🎓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
#37
parent
75f52e78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/duels/DuelListFragment.kt
.../tudarmstadt/features/dashboard/duels/DuelListFragment.kt
+0
-1
app/src/main/java/de/akamu/tudarmstadt/features/questions/QuestionActivity.kt
.../akamu/tudarmstadt/features/questions/QuestionActivity.kt
+10
-2
app/src/main/java/de/akamu/tudarmstadt/features/questions/QuestionContract.kt
.../akamu/tudarmstadt/features/questions/QuestionContract.kt
+2
-0
app/src/main/java/de/akamu/tudarmstadt/features/questions/QuestionPresenter.kt
...akamu/tudarmstadt/features/questions/QuestionPresenter.kt
+5
-0
No files found.
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/duels/DuelListFragment.kt
View file @
6333d227
...
...
@@ -272,7 +272,6 @@ class DuelListFragment :
intent
.
putExtra
(
KEY_DUEL
,
duel
)
intent
.
putExtra
(
KEY_POOL
,
pool
)
startActivity
(
intent
)
activity
?.
finish
()
}
override
fun
onDuelClick
(
duel
:
Duel
,
status
:
String
)
{
...
...
app/src/main/java/de/akamu/tudarmstadt/features/questions/QuestionActivity.kt
View file @
6333d227
...
...
@@ -3,6 +3,8 @@ package de.akamu.tudarmstadt.features.questions
import
android.app.AlertDialog
import
android.content.DialogInterface
import
android.content.Intent
import
android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK
import
android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import
android.os.Bundle
import
android.text.Editable
import
android.text.TextWatcher
...
...
@@ -133,6 +135,7 @@ class QuestionActivity :
val
answerFragment
=
loadAnswerFragment
(
answer
)
ft
.
replace
(
R
.
id
.
fragment_questionactivity_bottomcontainer
,
answerFragment
)
ft
.
addToBackStack
(
null
)
ft
.
commit
()
}
...
...
@@ -222,6 +225,7 @@ class QuestionActivity :
// i.putExtra(KEY_DUEL, mDuel)
// As long as this is not implemented, directly navigate back to the dashboard
val
i
=
Intent
(
this
,
MainActivity
::
class
.
java
)
i
.
addFlags
(
FLAG_ACTIVITY_NEW_TASK
or
FLAG_ACTIVITY_CLEAR_TASK
)
startActivity
(
i
)
finish
()
}
...
...
@@ -307,8 +311,12 @@ class QuestionActivity :
}
override
fun
onBackPressed
()
{
Toast
.
makeText
(
this
,
this
.
getString
(
R
.
string
.
back_during_question
),
Toast
.
LENGTH_LONG
)
.
show
()
if
(
presenter
.
duelHasStarted
)
{
Toast
.
makeText
(
this
,
this
.
getString
(
R
.
string
.
back_during_question
),
Toast
.
LENGTH_LONG
)
.
show
()
}
else
{
super
.
onBackPressed
()
}
}
/*
...
...
app/src/main/java/de/akamu/tudarmstadt/features/questions/QuestionContract.kt
View file @
6333d227
...
...
@@ -44,6 +44,8 @@ interface QuestionContract {
interface
Presenter
:
BasePresenter
{
/** Indicates whether the user answered correctly or not **/
var
userAnswers
:
ArrayList
<
Boolean
>
/** Indicates whether the duel has started **/
var
duelHasStarted
:
Boolean
/** Load the current round from the server **/
fun
loadRound
(
roundID
:
Int
)
/** Decide how to move on **/
...
...
app/src/main/java/de/akamu/tudarmstadt/features/questions/QuestionPresenter.kt
View file @
6333d227
...
...
@@ -21,6 +21,7 @@ class QuestionPresenter(
override
var
userAnswers
:
ArrayList
<
Boolean
>
=
arrayListOf
()
override
var
duelHasStarted
:
Boolean
=
false
lateinit
var
mRound
:
Round
var
questionNumber
:
Int
=
0
...
...
@@ -35,6 +36,7 @@ class QuestionPresenter(
override
fun
loadRound
(
roundID
:
Int
)
{
interactor
.
loadRound
(
roundID
,
object
:
DuelDataSource
.
LoadRoundCallback
{
override
fun
onLoadRoundSuccess
(
round
:
Round
)
{
duelHasStarted
=
true
mRound
=
round
view
?.
hideLoadingAnimation
()
view
?.
showQuestionLayout
()
...
...
@@ -43,6 +45,7 @@ class QuestionPresenter(
}
override
fun
onLoadRoundFailed
(
reason
:
String
)
{
duelHasStarted
=
false
view
?.
hideLoadingAnimation
()
view
?.
showLoadRoundFailed
(
reason
)
}
...
...
@@ -154,6 +157,8 @@ class QuestionPresenter(
override
fun
onSubmitUserAnswerFailed
(
reason
:
String
)
{
view
?.
showSubmitUserAnswerFailed
(
reason
)
// Note: We need the following because otherwise the user is stuck in the current screen
view
?.
showContinueOptions
()
}
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment