Display survey info && can cancel the response to a survey

This commit is contained in:
Pierre HUBERT
2018-09-06 19:01:30 +02:00
parent c66365b002
commit 79f2fa3c2d
17 changed files with 701 additions and 6 deletions

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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="match_parent">
<LinearLayout
android:id="@+id/choicesTarget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/question" />
<android.support.constraint.ConstraintLayout
android:id="@+id/cancelSurveyResponseForm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/choicesTarget">
<TextView
android:id="@+id/selectedChoiceView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/cancelButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Your choice: A response" />
<Button
android:id="@+id/cancelButton"
style="@style/Base.Widget.AppCompat.Button.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:backgroundTint="@color/holo_red_dark"
android:text="@string/action_cancel_response_survey"
android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/sendResponseForm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cancelSurveyResponseForm">
<Spinner
android:id="@+id/responsesSpinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/respondButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/respondButton"
style="@style/Base.Widget.AppCompat.Button.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:text="@string/action_send_survey_response"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="A survey question" />
</android.support.constraint.ConstraintLayout>

View File

@ -291,4 +291,6 @@
<string name="err_update_account_image_visibility">Une erreur a survenu lors de la mise à jour du niveau de visibilité de l\'image de compte !</string>
<string name="err_find_tag">Le tag spécifié n\'a pas été trouvé !</string>
<string name="err_groups_not_supported">Les groupes ne sont pas encore supportés sur l\'application Android…</string>
<string name="survey_choice">(%1$d) %2$s</string>
<string name="survey_your_choice">Votre choix : %1$s</string>
</resources>

View File

@ -290,4 +290,9 @@
<string name="err_update_account_image_visibility">Could not update account image visibility level!</string>
<string name="err_find_tag">Could not find requested tag!</string>
<string name="err_groups_not_supported">Groups are not supported yet by the Android application!</string>
<string name="survey_choice">(%1$d) %2$s</string>
<string name="survey_your_choice">Your choice : %1$s</string>
<string name="action_cancel_response_survey">Cancel</string>
<string name="action_send_survey_response">Respond</string>
<string name="err_cancel_response">Could not cancel your response to the survey!</string>
</resources>