Commit 048d0c38 authored by Niklas Fix's avatar Niklas Fix 🎓

make short summary for swipe answers better to understand

parent 2282aeb7
......@@ -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)
}
}
}
}
......
<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>
<?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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment