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
a32489c6
Commit
a32489c6
authored
Oct 31, 2020
by
Niklas Fix
🎓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add onboarding for erstie event
parent
5872cf04
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
12 deletions
+59
-12
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/DashboardContract.kt
...akamu/tudarmstadt/features/dashboard/DashboardContract.kt
+2
-0
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/DashboardPresenter.kt
...kamu/tudarmstadt/features/dashboard/DashboardPresenter.kt
+18
-0
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/MainActivity.kt
...a/de/akamu/tudarmstadt/features/dashboard/MainActivity.kt
+19
-6
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_main.xml
+11
-6
app/src/main/res/values-de/strings.xml
app/src/main/res/values-de/strings.xml
+3
-0
app/src/main/res/values-en/strings.xml
app/src/main/res/values-en/strings.xml
+3
-0
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+3
-0
No files found.
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/DashboardContract.kt
View file @
a32489c6
...
...
@@ -49,6 +49,8 @@ interface DashboardContract {
fun
loadAppUserFromServer
()
/** Fetch user's pools **/
fun
fetchPools
()
/** Fetch user's friends **/
fun
fetchFriends
()
}
}
\ No newline at end of file
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/DashboardPresenter.kt
View file @
a32489c6
package
de.akamu.tudarmstadt.features.dashboard
import
de.akamu.tudarmstadt.data.friends.FriendsDataSource
import
de.akamu.tudarmstadt.data.friends.FriendsDataSourceImpl
import
de.akamu.tudarmstadt.data.questionpools.QuestionPoolsDataSource
import
de.akamu.tudarmstadt.data.questionpools.QuestionPoolsDataSourceImpl
import
de.akamu.tudarmstadt.data.user.UserDataSource
import
de.akamu.tudarmstadt.features.friends.FriendsListInteractor
import
de.akamu.tudarmstadt.features.questionpools.QuestionPoolsInteractor
import
de.akamu.tudarmstadt.interactors.UserInteractor
import
de.akamu.tudarmstadt.model.Pool
...
...
@@ -65,6 +68,21 @@ class DashboardPresenter(private var view: DashboardContract.View?, private val
})
}
override
fun
fetchFriends
()
{
val
friend_interactor
=
FriendsListInteractor
(
FriendsDataSourceImpl
())
friend_interactor
.
fetchFriends
(
object
:
FriendsDataSource
.
FetchFriendsCallback
{
override
fun
onFetchFriendsSuccess
(
friends
:
ArrayList
<
User
>)
{
if
(
friends
.
isEmpty
())
{
view
?.
showInfoBox
()
}
}
override
fun
onFetchFriendsFailed
(
reason
:
String
)
{
// silent
}
})
}
override
fun
stop
()
{
view
=
null
}
...
...
app/src/main/java/de/akamu/tudarmstadt/features/dashboard/MainActivity.kt
View file @
a32489c6
package
de.akamu.tudarmstadt.features.dashboard
import
android.content.Context
import
android.content.Intent
import
android.content.res.Configuration
import
android.os.Bundle
import
android.view.View
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatDelegate
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.FragmentTransaction
...
...
@@ -89,7 +87,8 @@ class MainActivity : BaseActivity(), DashboardContract.View, NextLevelEventHandl
fillProfile
()
setupBottomNavigation
()
presenter
.
fetchPools
()
// presenter.fetchPools()
presenter
.
fetchFriends
()
when
(
intent
.
getIntExtra
(
Constants
.
KEY_MAINACTIVITY_PAGE
,
0
))
{
Constants
.
DUEL_LIST_FRAGMENT
->
navigateToDuelList
()
...
...
@@ -114,9 +113,15 @@ class MainActivity : BaseActivity(), DashboardContract.View, NextLevelEventHandl
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
data
?.
getBooleanExtra
(
"finishActivity"
,
false
)
==
true
)
{
finish
()
}
else
if
(
data
?.
getBooleanExtra
(
"hasSelectedPools"
,
false
)
==
true
)
{
constraintlayout_main_info
.
visibility
=
View
.
GONE
}
/*else if (data?.getBooleanExtra("hasSelectedPools", false) == true) {
textView_main_info.text = getString(R.string.info_add_friend)
button_main_info_action.text = getString(R.string.find_friends)
button_main_info_action.setOnClickListener {
navigateToChallenge()
constraintlayout_main_info.visibility = View.GONE
}
}*/
}
@Suppress
(
"UNUSED_PARAMETER"
)
...
...
@@ -203,6 +208,8 @@ class MainActivity : BaseActivity(), DashboardContract.View, NextLevelEventHandl
override
fun
onResume
()
{
super
.
onResume
()
presenter
.
loadAppUserFromServer
()
// presenter.fetchPools()
presenter
.
fetchFriends
()
}
override
fun
finishActivity
()
{
...
...
@@ -244,10 +251,16 @@ class MainActivity : BaseActivity(), DashboardContract.View, NextLevelEventHandl
override
fun
showInfoBox
()
{
constraintlayout_main_info
.
visibility
=
View
.
VISIBLE
button_main_needs_pools
.
setOnClickListener
{
/*button_main_info_action
.setOnClickListener {
val i = Intent(this, QuestionPoolsActivity::class.java)
i.putExtra(Constants.KEY_NEEDS_POOL, true)
startActivityForResult(i, Constants.MAIN_ACTIVITY_REQ_CODE)
}*/
textView_main_info
.
text
=
getString
(
R
.
string
.
info_add_friend_tmpErstie
)
button_main_info_action
.
text
=
getString
(
R
.
string
.
find_friends
)
button_main_info_action
.
setOnClickListener
{
navigateToChallenge
()
constraintlayout_main_info
.
visibility
=
View
.
GONE
}
}
}
app/src/main/res/layout/activity_main.xml
View file @
a32489c6
...
...
@@ -186,26 +186,31 @@
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/textView_main_info"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:
textColor=
"@color/darkText
"
android:
layout_weight=
"0.6
"
android:padding=
"6dp"
android:text=
"@string/info_needs_pools"
android:
layout_weight=
"0.6"
/>
android:
textColor=
"@color/darkText"
/>
<Button
android:id=
"@+id/button_main_
needs_pools
"
android:id=
"@+id/button_main_
info_action
"
style=
"@style/AppButtonWhite"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:text=
"@string/choose_pools"
android:layout_margin=
"6dp"
android:layout_weight=
"0.3"
/>
android:layout_weight=
"0.3"
android:text=
"@string/choose_pools"
/>
</LinearLayout>
...
...
app/src/main/res/values-de/strings.xml
View file @
a32489c6
...
...
@@ -235,4 +235,7 @@
<string
name=
"updated_pools_failed"
>
Pools konnten nicht geupdated werden: %1$s
</string>
<string
name=
"profilesubjectactivity_more"
>
"Mit diesem Button lässt sich die Fragenpool-Info anzeigen. "
</string>
<string
name=
"no_questionpool_selected"
>
Kein Fragenpool ausgewählt
</string>
<string
name=
"info_add_friend"
>
Super! Suche als Nächstes nach deinen Freunden und fordere sie zum Duell heraus!
</string>
<string
name=
"find_friends"
>
Freunde finden
</string>
<string
name=
"info_add_friend_tmpErstie"
>
Schön, dass du dich entschieden hast Akamu zu spielen! Suche nach deinen Freunden und fordere sie zum Duell heraus!
</string>
</resources>
\ No newline at end of file
app/src/main/res/values-en/strings.xml
View file @
a32489c6
...
...
@@ -283,4 +283,7 @@
<string
name=
"updated_pools_failed"
>
Failed to update pool due to %1$s
</string>
<string
name=
"profilesubjectactivity_more"
>
This is the button for showing
</string>
<string
name=
"no_questionpool_selected"
>
No question pool selected
</string>
<string
name=
"find_friends"
>
Find friends
</string>
<string
name=
"info_add_friend"
>
Nice! Now search for your friends and challenge them to a duel!
</string>
<string
name=
"info_add_friend_tmpErstie"
>
Thanks for playing Akamu! Search for your friends and challenge them to a duell!
</string>
</resources>
app/src/main/res/values/strings.xml
View file @
a32489c6
...
...
@@ -351,5 +351,8 @@
<string
name=
"choose_pools"
>
Choose pools
</string>
<string
name=
"updated_pools_success"
>
Successfully updated your pools.
</string>
<string
name=
"updated_pools_failed"
>
Failed to update pool due to %1$s
</string>
<string
name=
"find_friends"
>
Find friends
</string>
<string
name=
"info_add_friend"
>
Nice! Now search for your friends and challenge them to a duel!
</string>
<string
name=
"info_add_friend_tmpErstie"
>
Thanks for playing Akamu! Search for your friends and challenge them to a duel!
</string>
</resources>
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