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
048d0c38
Commit
048d0c38
authored
Nov 03, 2020
by
Niklas Fix
🎓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make short summary for swipe answers better to understand
parent
2282aeb7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
14 deletions
+67
-14
app/src/main/java/de/akamu/tudarmstadt/features/questions/answers/SwipeAnswerShortSummaryAdapter.kt
...tures/questions/answers/SwipeAnswerShortSummaryAdapter.kt
+20
-9
app/src/main/res/drawable-anydpi/ic_close_red.xml
app/src/main/res/drawable-anydpi/ic_close_red.xml
+11
-0
app/src/main/res/drawable-hdpi/ic_close_red.png
app/src/main/res/drawable-hdpi/ic_close_red.png
+0
-0
app/src/main/res/drawable-mdpi/ic_close_red.png
app/src/main/res/drawable-mdpi/ic_close_red.png
+0
-0
app/src/main/res/drawable-xhdpi/ic_close_red.png
app/src/main/res/drawable-xhdpi/ic_close_red.png
+0
-0
app/src/main/res/drawable-xxhdpi/ic_close_red.png
app/src/main/res/drawable-xxhdpi/ic_close_red.png
+0
-0
app/src/main/res/layout/item_swipe_answer_short_summary.xml
app/src/main/res/layout/item_swipe_answer_short_summary.xml
+36
-5
No files found.
app/src/main/java/de/akamu/tudarmstadt/features/questions/answers/SwipeAnswerShortSummaryAdapter.kt
View file @
048d0c38
...
...
@@ -5,6 +5,7 @@ import android.graphics.Paint
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.RecyclerView
...
...
@@ -39,24 +40,34 @@ class SwipeAnswerShortSummaryAdapter(
inner
class
SwipeShortSummaryViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
private
var
answerTextView
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
textView_swipe_answer_short_summary_answerText
)
private
var
indicator
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
textView_swipe_answer_short_summary
_indicator
)
private
var
rightIndicator
:
View
=
itemView
.
findViewById
(
R
.
id
.
view_swipe_answer_shortSummary_right
_indicator
)
private
var
leftIndicator
:
View
=
itemView
.
findViewById
(
R
.
id
.
view_swipe_answer_shortSummary_left_indicator
)
private
var
finalIndicator
:
ImageView
=
itemView
.
findViewById
(
R
.
id
.
imageView_swipe_answer_shortSummary_final_indicator
)
fun
bind
(
answeredCorrectly
:
Boolean
,
answerItem
:
MultipleChoiceAnswerItem
)
{
answerTextView
.
text
=
answerItem
.
text
if
(
answeredCorrectly
)
{
indicator
.
text
=
mContext
.
getString
(
R
.
string
.
correct
)
indicator
.
background
=
mContext
.
getDrawable
(
R
.
drawable
.
background_indicator_correct
)
finalIndicator
.
setBackgroundResource
(
R
.
drawable
.
ic_checked_akamu_green
)
}
else
{
indicator
.
text
=
mContext
.
getString
(
R
.
string
.
wrong
)
indicator
.
background
=
mContext
.
getDrawable
(
R
.
drawable
.
background_indicator_wrong
)
finalIndicator
.
setBackgroundResource
(
R
.
drawable
.
ic_close_red
)
}
if
(
answerItem
.
isCorrect
)
{
leftIndicator
.
setBackgroundResource
(
R
.
color
.
akamu_green
)
//answerTextView.setTextColor(ContextCompat.getColor(mContext, R.color.akamu_green))
leftIndicator
.
setBackgroundResource
(
R
.
drawable
.
background_indicator_correct
)
}
else
{
leftIndicator
.
setBackgroundResource
(
R
.
color
.
colorLost
)
//answerTextView.setTextColor(ContextCompat.getColor(mContext, R.color.colorLost))
leftIndicator
.
setBackgroundResource
(
R
.
drawable
.
background_indicator_wrong
)
}
if
(
answerItem
.
isCorrect
)
{
if
(
answeredCorrectly
)
{
rightIndicator
.
setBackgroundResource
(
R
.
drawable
.
background_indicator_correct
)
}
else
{
rightIndicator
.
setBackgroundResource
(
R
.
drawable
.
background_indicator_wrong
)
}
}
else
{
if
(
answeredCorrectly
)
{
rightIndicator
.
setBackgroundResource
(
R
.
drawable
.
background_indicator_wrong
)
}
else
{
rightIndicator
.
setBackgroundResource
(
R
.
drawable
.
background_indicator_correct
)
}
}
}
}
...
...
app/src/main/res/drawable-anydpi/ic_close_red.xml
0 → 100644
View file @
048d0c38
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
android:tint=
"#C95D63"
android:alpha=
"0.8"
>
<path
android:fillColor=
"@android:color/white"
android:pathData=
"M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
/>
</vector>
app/src/main/res/drawable-hdpi/ic_close_red.png
0 → 100644
View file @
048d0c38
234 Bytes
app/src/main/res/drawable-mdpi/ic_close_red.png
0 → 100644
View file @
048d0c38
200 Bytes
app/src/main/res/drawable-xhdpi/ic_close_red.png
0 → 100644
View file @
048d0c38
238 Bytes
app/src/main/res/drawable-xxhdpi/ic_close_red.png
0 → 100644
View file @
048d0c38
365 Bytes
app/src/main/res/layout/item_swipe_answer_short_summary.xml
View file @
048d0c38
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"6dp"
xmlns:tools=
"http://schemas.android.com/tools"
>
android:layout_margin=
"6dp"
>
<View
android:id=
"@+id/view_swipe_answer_shortSummary_left_indicator"
...
...
@@ -24,12 +24,12 @@
android:text=
"Here stands a sample answer.\nLorem ipsum dolor."
android:textColor=
"@color/textLight"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/
textView_swipe_answer_short_summary
_indicator"
app:layout_constraintEnd_toStartOf=
"@+id/
view_swipe_answer_shortSummary_right
_indicator"
app:layout_constraintStart_toEndOf=
"@id/view_swipe_answer_shortSummary_left_indicator"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"HardcodedText"
/>
<TextView
<
!--
TextView
android:id="@+id/textView_swipe_answer_short_summary_indicator"
android:layout_width="96dp"
android:layout_height="wrap_content"
...
...
@@ -41,6 +41,37 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore=
"HardcodedText"
/>
tools:ignore="HardcodedText" /-->
<!--Button
android:id="@+id/imageView_swipe_incorrect_answer_short_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_circle_ripple_red"
android:contentDescription="@string/wrong_answer"
android:drawableEnd="@drawable/ic_cross_light"
android:clickable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ind"
app:layout_constraintTop_toTopOf="parent" /-->
<View
android:id=
"@+id/view_swipe_answer_shortSummary_right_indicator"
android:layout_width=
"12dp"
android:layout_height=
"0dp"
android:background=
"@color/colorLost"
android:layout_marginEnd=
"12dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/imageView_swipe_answer_shortSummary_final_indicator"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/imageView_swipe_answer_shortSummary_final_indicator"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ic_checked_akamu_green"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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