Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.chicagoroboto.features.sessiondetail.SessionDetailComponent
import com.chicagoroboto.model.Feedback
import kotlinx.android.synthetic.main.dialog_feedback.view.*
import javax.inject.Inject
import kotlin.math.roundToInt

class FeedbackDialog(context: Context, val sessionId: String) : Dialog(context, true, null), FeedbackMvp.View {

Expand All @@ -25,7 +26,7 @@ class FeedbackDialog(context: Context, val sessionId: String) : Dialog(context,

view = LayoutInflater.from(context).inflate(R.layout.dialog_feedback, null, false)
view.submit.setOnClickListener {
presenter.submit(view.overall.rating, view.technical.rating, view.speaker.rating)
presenter.submit(view.overall.rating, view.technical.progress.toFloat(), view.speaker.rating)
}

view.cancel.setOnClickListener {
Expand All @@ -47,7 +48,7 @@ class FeedbackDialog(context: Context, val sessionId: String) : Dialog(context,

override fun setFeedback(feedback: Feedback) {
view.overall.rating = feedback.overall ?: 0f
view.technical.rating = feedback.technical ?: 0f
view.technical.progress = feedback.technical?.roundToInt() ?: 0
view.speaker.rating = feedback.speaker ?: 0f
}
}
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ic_technical_thumb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="?attr/colorControlActivated" />
<size
android:width="6dp"
android:height="24dp" />
<corners android:radius="2dp" />
</shape>
9 changes: 9 additions & 0 deletions android/app/src/main/res/drawable/ic_technical_tick.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<solid android:color="#fff"/>
<size
android:width="8dp"
android:height="8dp" />
</shape>
90 changes: 73 additions & 17 deletions android/app/src/main/res/layout/dialog_feedback.xml
Original file line number Diff line number Diff line change
@@ -1,71 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout

<android.support.constraint.ConstraintLayout
android:id="@+id/container_ratings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
android:paddingRight="16dp"
android:paddingTop="16dp">

<TextView
android:id="@+id/feedback_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/feedback_title"/>
android:text="@string/feedback_title"
android:textAppearance="?android:textAppearanceLarge" />

<TextView
android:id="@+id/overall_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_session"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/feedback_session"/>
app:layout_constraintTop_toBottomOf="@id/feedback_title" />

<RatingBar
android:id="@+id/overall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"/>
android:numStars="5"
app:layout_constraintTop_toBottomOf="@id/overall_title" />

<TextView
android:id="@+id/technical_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_content"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/feedback_content"/>
<RatingBar
android:id="@+id/technical"
app:layout_constraintTop_toBottomOf="@id/overall" />

<TextView
android:id="@+id/technical_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"/>
android:text="@string/not_enough"
android:textColor="?attr/colorControlActivated"
app:layout_constraintTop_toBottomOf="@id/technical_title" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/just_right"
android:textColor="?attr/colorControlActivated"
app:layout_constraintLeft_toLeftOf="@id/technical"
app:layout_constraintRight_toRightOf="@id/technical"
app:layout_constraintTop_toBottomOf="@id/technical_title" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:text="@string/too_much"
android:textColor="?attr/colorControlActivated"
app:layout_constraintRight_toRightOf="@id/technical"
app:layout_constraintTop_toBottomOf="@id/technical_title" />

<android.support.v7.widget.AppCompatSeekBar
android:id="@+id/technical"
android:layout_width="0dp"
android:layout_height="48dp"
android:max="4"
android:maxHeight="48dp"
android:progress="2"
android:progressBackgroundTint="?attr/colorControlActivated"
android:progressBackgroundTintMode="src_over"
android:progressTint="?attr/colorControlActivated"
android:thumb="@drawable/ic_technical_thumb"
app:layout_constraintLeft_toLeftOf="@id/overall"
app:layout_constraintRight_toRightOf="@id/overall"
app:layout_constraintTop_toBottomOf="@id/technical_label"
app:tickMark="@drawable/ic_technical_tick"
app:tickMarkTint="?attr/colorControlActivated" />

<TextView
android:id="@+id/speaker_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/feedback_speaker"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/feedback_speaker"/>
app:layout_constraintTop_toBottomOf="@id/technical" />

<RatingBar
android:id="@+id/speaker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"/>
</LinearLayout>
android:numStars="5"
app:layout_constraintTop_toBottomOf="@id/speaker_title" />
</android.support.constraint.ConstraintLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:orientation="horizontal">

<Button
android:id="@+id/cancel"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancel"/>
android:text="@string/cancel" />

<Button
android:id="@+id/submit"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/submit"/>
android:text="@string/submit" />
</LinearLayout>
</LinearLayout>
5 changes: 4 additions & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
<string name="cd_logo">Event Logo</string>
<string name="note_feedback_title">%1$s complete</string>
<string name="note_feedback_msg">Don\'t forget to submit feedback.</string>
<string name="feedback_note_channel">Session Feedback</string>
<string name="feedback_note_channel">Session Feedback</string>
<string name="not_enough">Not\nenough</string>
<string name="just_right">Just\nright</string>
<string name="too_much">Too\nmuch</string>
</resources>
2 changes: 1 addition & 1 deletion android/feedback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feedback submitted in the app will be entered in the web into a `feedback` colle
"[talk-id]": {
"[user-id]": {
"overall": [0-5],
"technical": [0-5],
"technical": [0-4],
"speaker": [0-5]
},
...
Expand Down